What is a Cardinal Spline?

本文介绍了Cardinal样条曲线的基本原理及其数学公式。Cardinal样条是一种平滑的曲线,通过一组点来定义,并使用张力值进行平滑处理。这种样条属于Hermite曲线的一个子集,其特点是在点之间生成平滑而非锯齿状的路径。文章还提供了计算Cardinal样条切线的公式。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

This oddly named thing is simply a line with tension. A set of X,Y coordinates can be used to make a polygon or poly-line. Usually the points are connected by straight-line segments. A Cardinal Spline takes the positions of the current point and,along with the previous and next points, averages out the positions using a tension value. This smoothes the line and makes a path that is gently curved through the points rather than zigzagging through them. Figure 1 shows a cardinal spline drawn through several points. The black dots are the nodes, the lines are the curves generated by several different representations of the line at different tensions.

The red line has zero tension. The Indigo line has a tension of 1. The others are something in-between.

Cardinal splines are just a subset of the hermite curves. They don't need the tangent points because they will be calculated from the control points. We'll lose some of the flexibility of the hermite curves, but as a tradeoff the curves will be much easier to use. The formula for the tangents for cardinal splines is:
Ti = tension  * ( Pi+1 - Pi-1 )
tension  is a constant which affects the tightness of the curve. Write yourself a program and play around with it. ( tension should be between 0 and 1, but this is not a must).

 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值