rotate method

Angle rotate(
  1. Angle theta, [
  2. bool anticlockwise = true
])

Implementation

Angle rotate(Angle theta, [bool anticlockwise = true]) {
  if (!anticlockwise) theta = -theta;
  final x = (this.x * theta.cosValue) - (this.y * theta.sinValue);
  final y = (this.x * theta.sinValue) + (this.y * theta.cosValue);
  return Angle.fromXY(x, y);
}