quadraticAt function
The point at parameter t on a quadratic Bézier curve.
Implementation
DiagramPoint quadraticAt(
DiagramPoint start,
DiagramPoint control,
DiagramPoint end,
double t,
) {
final inverse = 1 - t;
return DiagramPoint(
inverse * inverse * start.x + 2 * inverse * t * control.x + t * t * end.x,
inverse * inverse * start.y + 2 * inverse * t * control.y + t * t * end.y,
);
}