rotated method

Vector2 rotated(
  1. double angle
)

Implementation

Vector2 rotated(double angle) {
  final ccos = cos(angle);
  final ssin = sin(angle);
  return Vector2(
    x * ccos - y * ssin,
    x * ssin + y * ccos,
  );
}