Spline approaches a point from the wrong side

I am designing a course made out of points on lines and splines. I am using splines to connect the last point of a line to the first point of the next line. The slope at the 2 points has been specified. Even though the slope is correct at both points, the second line is aproached by the spline from the wrong direction, creating a cusp. I would like the spline to aproach the second line from underneath to create a smooth course. In this figure the horizontal line is line 1 and the other line is line 2.
spline_bounds_x = [xfinal1 xinitial2];
spline_bounds_y = [yfinal1 yinitial2];
n = 100;
xx = linspace (xinitial_spline,xinitial, n)
yy = spline(spline_bounds_x, [slope1 spline_bounds_y slope2],xx);
slope1 and slope2 unfortunately are not angles but simple line coefficients. Therefore they carry no information of the direction in which the lines are percurred. Is there a way to express them in radians? I also tried to put a point with coordinates p(22,7) and what happens is that the line is approached from underneath but with the wrong slope2.

댓글 수: 1

There are some gaps to be filled in your spline curve: there is an infinite number of (spline) curves that can be used to join those two lines and match teh endslopes. And bear in mind that if you don't want the spline joint to have a cusp in the situations of your plot you need a curve (2-valued, 1-variate spline function), because there will be necessarily x locations with two y's.

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Splines에 대해 자세히 알아보기

질문:

2019년 4월 10일

댓글:

2019년 6월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by