Interpolating a three point curve at any angle using cubic splines

조회 수: 5 (최근 30일)
MC
MC 2017년 10월 17일
댓글: MC 2017년 10월 17일
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
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
Jan
Jan 2017년 10월 17일
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?
MC
MC 2017년 10월 17일
편집: MC 2017년 10월 17일
Sorry I'll try and make it more clear.
Given inputs: Beta and P0. Conditions for the output: Define P2 such that the normal vectors in P0 are perpendicular to the x-axis, given any input angle Beta. Wanted output: Well, I want it to fulfill the conditions above.

댓글을 달려면 로그인하십시오.

답변 (1개)

John D'Errico
John D'Errico 2017년 10월 17일
편집: John D'Errico 2017년 10월 17일
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.
  댓글 수: 1
MC
MC 2017년 10월 17일
I am not sure I follow you. So if we give P2 in polar coordinates, centered at (0,0.4) then generally it is given by:
P2 = [0;P1(2)] + [r2*cos(theta);r2*sin(theta)], where from the figure P1(2)=0.4.
I don't understand entirely what you mean by fit a curve for radius, as a function of theta.
The points are: P0 = [0;0] and P_1 = [r1*cos(beta); r1*sin(beta)], where r1 = sqrt((2*w)^2+(2*w)^2), where w = 0.2. And Beta is any angle, in the picture above it is 45 degrees.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Splines에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by