How to find u value at a point on cubic curve
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(4 个)
John D'Errico
2018-3-12
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 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!