TITLE: Find value of '$t$' at a point on a cubic Bezier curve
QUESTION [7 upvotes]: I have a cubic Bezier curve, and I need to divide it and create same curve between point on the original curve and the end point of the original curve.
From my research, I found the DeCasteljau algorithm helps in doing this. But, to use this algorithm, I need to know the '$t$' value at the dividing point.
Can anyone please help me out to find '$t$' at a given point on a cubic Bezier curve

I need to find the value of '$t$' at a given point B.

REPLY [2 votes]: This is function for cubic bezier
$p = p_0(1 - t)^3 + 3p_1t(1 - t)^2 + 3p_2t^2(1 - t) + p_3t^3$
It can be reaarange into
$
p = p_0(1 - 3t + 3t^2 - t^3) + 3p_1(t - 2t^2 + t^3) + 3p_2(t^2 - t^3) + p_3t^3
\\
t^3(p_3 - 3p_2 + 3p_1 - p_0) + t^23(p_2 - 2p_1 + p_0) + t3(p_1 - p_0) + p_0 - p = 0
$
From this point it's a cubic equation for $x$ and $y$
You can find $t$ from $x$ and cubic equation will result in 3 possible values. Then you put $t$ back into function to get 3 $y$ and select a value close to the $y$ you put in