rotate method

Point rotate(
  1. double angle
)

Returns a rotated version of this point around the origin.

Implementation

Point rotate(double angle) {
  final cos = math.cos(angle);
  final sin = math.sin(angle);
  return Point(
    x * cos - y * sin,
    x * sin + y * cos,
  );
}