rotated

fun rotated(angle: Number, center: Coordinate): Coordinate

Rotates Coordinate by angle degrees around center point.

With

  • Angle t,

  • Center point Z

  • Coordinate P

cos(phi) -sin(phi) * Px - Zx + Zx = cos(phi)*(Px-Zx) - sin(phi)*(Py-Zy) + Zx

Py - Zy sin(phi)*(Px-Zx) + cos(phi)*(Py-Zy) + Zy


fun rotated(angle: Double): Coordinate

Rotates coordinate by angle degrees around point (0,0).

With

  • Angle t,

  • Center point Z

  • Coordinate P

cos(phi) -sin(phi) * Px - Zx + Zx = cos(phi)*(Px-Zx) - sin(phi)*(Py-Zy) + Zx

Py - Zy sin(phi)*(Px-Zx) + cos(phi)*(Py-Zy) + Zy