getAngle method

double getAngle()

Returns the degree of this segment. 0 means vector to the right side --> Since positive values in y-direction points towards the bottom of the screen the angle runs clockwise.

Implementation

double getAngle() {
  if (_angle != null) return _angle!;
  _angle = atan2(end.y - start.y, end.x - start.x);
  _angle = toDegrees(_angle!);
  return _angle!;
}