Interpolating a three point curve at any angle using cubic splines
6 views (last 30 days)
Show older comments
I'm trying to interpolate a curve using cubic splines and three points in the x-y plane. I have some troubles finding the equation for the middle point such that the normal vectors in point P0 is always perpendicular to the x-axis, given any angle between the yellow line and the x-axis. See figure
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/168350/image.png)
P0 is always known, P1 is given by:
P_1 = [r1*cos(beta); r1*sin(beta)], where r1 is the the length of the yellow line and beta is the angle between the yellow line and the x-axis. In the image above I have experimentally found the equations for P2, which is:
P2 = [0.75*P1_x; 0.25*P1_y]. But this only works if beta is 45 degrees. I've tried to reverse engineer it but I failed miserably. How would I go about finding the equations for P2?
Best regards MC
2 Comments
Jan
on 17 Oct 2017
Start with defining the problem exactly: What are the given inputs? What are the conditions for the output? How does the wanted output look like?
Answers (1)
John D'Errico
on 17 Oct 2017
Edited: John D'Errico
on 17 Oct 2017
Simple. Work in polar coordinates, centered around the location (0,0.4).
Now you will fit a curve for radius (thus distance from the point (0,0,4)), as a function of polar angle theta.
I don't have your points, so I cannot show you how to solve the problem better than that. As I said, simple, even trivial.
See Also
Categories
Find more on Splines in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!