Name

rotate()

Examples
v = PVector(10.0, 20.0)
print(v)  # Prints "[ 10.0, 20.0, 0.0 ]"
v.rotate(HALF_PI)
print(v)  # Prints "[ -20.0, 9.999999, 0.0 ]"
Description Rotates a vector by the specified angle (2D vectors only), while maintaining the same magnitude.
Syntax
.rotate(theta)
Parameters
thetafloat: the angle of rotation

Updated on Tue Feb 27 14:07:12 2024.

If you see any errors or have comments, please let us know.