开发者

Calculation of tangents for cardinal spline curves

I am reading an article about about cubic Hermite interpolation开发者_运维问答. In the cardinal spline curve section they give a formula to calculate tangents at end points given by:

Ti = a * ( Pi+1 - Pi-1 )  

However, if I have two points P1 and P2 then to find T1

T1 = a*(P2-P0).

I need to calculate this but what should be my P0 point be? Similarly to find T2 I will need to know P3. Can anyone clarify this?


You're right, this formula only makes sense for inner points in your spline which have neighbours on both sides. For endpoints you have to get the tangent from other constraints. The common solutions are:

  • supply manually chosen tangent points
  • choose the tangent such that the curvature at the endpoint is zero, this is referred to as natural boundary condition
  • choose periodic boundary conditions, that is, the tangents of the start- and endpoint are equal. Then you only have to specify one of the tangents. For a closed spline, you can get the last tangent from the natural boundary condition.

These ideas are brought up in the context of cubic splines, which require to solve a system of linear equations in order to get the polynomial coefficients for any part of the spline, because they minimize the total curvature of the whole spline, but in your case of Hermite splines they should be applicable, too.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜