rotWithVec static method

Vec rotWithVec(
  1. Vec point,
  2. Vec center,
  3. double angle
)

Implementation

static Vec rotWithVec(Vec point, Vec center, double angle) {
  final s = sin(angle);
  final c = cos(angle);
  final px = point.x - center.x;
  final py = point.y - center.y;
  final nx = px * c - py * s;
  final ny = px * s + py * c;
  return Vec(nx + center.x, ny + center.y);
}