isClockwise property

bool isClockwise

True if the curve is clockwise.

A curve is clockwise if the angle between the line connecting the start and end points and the line connecting the start point and first control point is positive. On a standard Cartesian plane, when the end point is to the right of the start point, a clockwise curve will arch upward initially.

Implementation

bool get isClockwise {
  final firstControlPoint = points[1];
  final angle = cornerAngle(startPoint, endPoint, firstControlPoint);
  return angle > 0.0;
}