Referencia setHeading()

setHeading()

Rotates a 2D vector to a specific angle without changing its magnitude.

By convention, the positive x-axis has an angle of 0. Angles increase in the clockwise direction.

If the vector was created with createVector(), setHeading() uses the units of the current angleMode().

Ejemplos

Sintaxis

setHeading(angle)

Parámetros

angle
Number: angle of rotation.

Referencias Relacionadas