Import std.math.curves
CubicBezier
function
Public Function CubicBezier(a: Vec2, b: Vec2, c: Vec2, d: Vec2, t: Float): Vec2
The point t of the way along the cubic Bezier from a to d, pulled toward b, then c.
Examples
Local a = Vec2(0, 0)
Local d = Vec2(1, 0)
Local arch = Function(t: Float) => CubicBezier(a, Vec2(0, 1), Vec2(1, 1), d, t)
Expect(arch(0) == a && arch(1) == d)
Expect(IsClose(arch(0.5), Vec2(0.5, 0.75)))function
Public Function CubicBezier(a: Vec3, b: Vec3, c: Vec3, d: Vec3, t: Float): Vec3
The point t of the way along the cubic Bezier from a to d, pulled toward b, then c.
Report an issue with this page or with FutureBlitz on GitHub.