Skip to content

fitCurve

fitCurve方法可以将一组连续线段拟合成一组贝塞尔曲线

fitCurve (points: Array<IPoint>, maxError: number)

参数
  1. points 要被拟合的一组点,其中:
interface IPoint {
	x: number;
	y: number;
}
  1. maxError 拟合精度
示例
js
const curve = FP.fitCurve(points, 2)