参考 curvePoint()

curvePoint()

使用插值计算样条曲线上的坐标。

curvePoint() 使用锚点和控制点计算样条曲线上的坐标。它期望的点的顺序与 curve() 函数相同。curvePoint() 每次只在一个轴上工作。传递锚点和控制点的 x 坐标将计算曲线上一点的 x 坐标。传递锚点和控制点的 y 坐标将计算曲线上一点的 y 坐标。

第一个参数 a 是第一个控制点的坐标。

第二个和第三个参数 bc 是锚点的坐标。

第四个参数 d 是最后一个控制点的坐标。

第五个参数 t 是沿着曲线进行插值的量。0 是第一个锚点,1 是第二个锚点,0.5 是它们之间的中间点。

示例

语法

curvePoint(a, b, c, d, t)

参数

a

coordinate of first anchor point.

b

coordinate of first control point.

c

coordinate of second control point.

d

coordinate of second anchor point.

t

amount to interpolate between 0 and 1.

Notice any errors or typos? Please let us know. Please feel free to edit src/core/shape/curves.js and open a pull request!

相关参考