레퍼런스 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

angle of rotation.

Notice any errors or typos? Please let us know. Please feel free to edit src/math/p5.Vector.js and open a pull request!

관련 레퍼런스