参考 bezierPoint()

bezierPoint()

使用插值计算贝塞尔曲线上的坐标。

bezierPoint() 使用锚点和控制点计算贝塞尔曲线上的坐标。它的点的顺序与 bezier() 函数相同。 bezierPoint() 每次只在一个轴上工作。传递锚点和控制点的 x 坐标将计算曲线上一点的 x 坐标。传递锚点和控制点的 y 坐标将计算曲线上一点的 y 坐标。

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

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

第四个参数 d 最后一个锚点的坐标。

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

示例

语法

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

参数

a

coordinate of first control point.

b

coordinate of first anchor point.

c

coordinate of second anchor point.

d

coordinate of second control 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!

相关参考