pointAt method
- double t
Get point on curve at parameter t (0 = start, 1 = end)
Implementation
Point pointAt(double t) {
final mt = 1 - t;
final mt2 = mt * mt;
final t2 = t * t;
return Point(
mt2 * mt * start.x +
3 * mt2 * t * control1.x +
3 * mt * t2 * control2.x +
t2 * t * end.x,
mt2 * mt * start.y +
3 * mt2 * t * control1.y +
3 * mt * t2 * control2.y +
t2 * t * end.y,
);
}