Tag: 样条

一组双打的Akima插值

假设我有一个双打数组,使用Akima插值对这个系列进行采样有什么好算法? 将这些数学描述翻译成代码我太愚蠢了。 // values is an array of doubles // idx is the index of the left-hand value for the current interpolation // t is the normalized parameter between values[idx] and values[idx+1] // Don’t worry about array bounds, I’ll handle that separately. public double InterpolateAkima(double[] values, int idx, double t) { …? }

平滑手绘曲线

我有一个允许用户绘制曲线的程序。 但是这些曲线看起来不太好 – 它们看起来摇摇晃晃,手绘。 所以我想要一种能够自动平滑它们的算法。 我知道平滑过程中存在固有的模糊性,因此每次都不会是完美的,但是这些算法确实存在于几个绘图包中并且它们工作得很好。 是否有类似这样的代码示例? C#会很完美,但我可以翻译其他语言。