rotateVector

fun rotateVector(x: Double, y: Double, heading: Double): Pair<Double, Double>

Rotates a 2D vector by a given heading angle.

Return

Pair of rotated (x, y) components

Parameters

x

X component of the vector

y

Y component of the vector

heading

Angle in radians to rotate the vector