angle property

double angle

The direction of the curve at position.

When used with PathMetric.getTangentForOffset, this is the angle of the curve that is the given offset along the path (i.e. the direction of the curve at position).

This value is in radians, with 0.0 meaning pointing along the x axis in the positive x-axis direction, positive numbers pointing downward toward the negative y-axis, i.e. in a clockwise direction, and negative numbers pointing upward toward the positive y-axis, i.e. in a counter-clockwise direction.

Implementation

// flip the sign to be consistent with [Path.arcTo]'s `sweepAngle`
double get angle => -math.atan2(vector.dy, vector.dx);