I recently in math I study the parable, specifically, how to calculate the equation of the lines tangent to a known parabola AX^2 + BX +C (A , B , C ) INSERT BY USER and passing through a point P P(XP;YP) INSERT BY USER of known coordinates so the prof ask to create a js script to calculate it.
To summarize the procedure, take the coordinates entered by the user and insert them into the equation: y- yP = m(x - xP)
to find the equation of the generic straight line passing through P;
at this point the procedure involves equating the parabola of which we know the coefficients A, B, C in this way:
AX^2+BX+C = mX -mXP +YP
solve and then set the descriminant ( Δ = b^2 - 4 a c ) equal to 0
the problem arises here because I can't find a way to solve it in js.
I'll start by saying that I know the basics of js and so I apologize for any misunderstandings