I want to get the parametric distance (the "$t$" value) at a location on a quadratic Bezier curve, given the "$x$" and "$y$" coordinates of the point.
I have start point, end point and control point of the curve.
How can I get it? Is there any direct formula to get the "$t$" value?
Please advice.
Bezier curves of a particular order have a closed form based on their control points. In the case of quadratics, that form is: $p = (1-t)^2 \cdot a + 2t(1-t) \cdot b + t^2 \cdot c$, where a, b, and c are the control points in order. Given the x value, you can solve $p_x = (1-t)^2 \cdot a_x + 2t(1-t) \cdot b_x + t^2 \cdot c_x$ for t. You can also do this for y; if the t values match up, then the point is on the quadratic curve.
Note that you can get 0, 1, or 2 values for t from each coordinate, most likely 2. This is perfectly okay: remember that from most directions, you will cross parabolas twice. Simply choose the t value that's in both.