参考 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().

示例

语法

setHeading(angle)

参数

angle
Number: angle of rotation.

相关参考