So, quick question.
In a program I'm making, I wanted to draw a parabolic arc between any two points on the screen. Originally, what I did was the following:
1) Create a third point as a midpoint of the other two, and boost its y-coordinate up by a bit,
2) Generate three matrices to represent three equations to solve for a, b, and c in the standard form y = ax^2 + bx + c,
3) Use Cramer's Rule to solve for a, b, and c. Use a simple shader to shade the arc.
While this works beautifully in most situations, things start getting weird when the two points get very close to each other horizontally (which will happen regularly). Values for A, B, and C get sky-rocketingly large, and the vertex of the parabola zooms off the screen.
There is one of two solutions, here, I think:
1) Is there any way to generate the third midpoint precisely as the vertex, so I keep reasonable values for A, B, C?
or...
2) Can I generate the parabola parametrically? The x-coordinate is easy, but how do I find the parametric equation of the y-coordinate to start at one value and end up at another, arbitrarily? I was never good with parametrics. = P
Thanks in advance, math-GAF!
Edit: Option 2 is looking like the only viable one at the moment; I can't bring the parabola's vertex down even by manually moving the midpoint by miniscule amounts. I think it has something to do with an inherent inaccuracy and rounding error in using Cramer's Rule computationally, which is warned of in many texts.