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.
Notice any errors or typos? Please let us know. Please feel free to edit src/math/p5.Vector.js and open a pull request!