rotate

fun rotate(degrees: Double, origin: Vector2 = ZERO): Vector2(source)

Creates a new Vector2 with the given rotation and origin.

Parameters

degrees

The rotation in degrees.

origin

The point around which the vector is rotated, default is Vector2.ZERO.