How to find u value at a point on cubic curve
1 view (last 30 days)
Show older comments
I am trying to find equation of a hermetic cubic curve created by giving four points. I assume the parametric equation of the curve as x=a*u^3 + b*u^2 + c*u + d and y= e*u^3 + f*u^2 + g*u + h (where 0<=u<=1) and trying to find values of a,b,c,d,e,f,g,h. I assume u at any point on curve = (curve distance from start to the point) / (curve distance from start to end) But I am not getting correct equation satisfying all four points. Can someone suggest how to find u value at any point ?
0 Comments
Answers (4)
John D'Errico
on 12 Mar 2018
So you have 4 points on a parametric curve, thus (x(u),y(u)), for 4 values of u?
Just use polyfit, getting a cubic for x(u), then use it again to get y(u). Read the help for polyfit if you don't know how to use it.
As far as what you are doing to NOT get the correct equation, how can we know what you did wrong, since you did not show us what you actually did?
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!