2Dベクトルを角度だけ回転させます。ただし、その大きさは変更しません。
慣例により、正のx軸の角度は0とされています。角度は時計回りに増加します。
ベクトルがcreateVector()で作成された場合、 rotate()は現在のangleMode()の 単位を使用します。
rotate()の静的バージョン(例:p5.Vector.rotate(v, PI))は、 新しいp5.Vectorオブジェクトを返し、 元のオブジェクトは変更しません。
実例
シンタックス
rotate(angle)
rotate(v, angle, [target])
パラメーター
angle
Number:
回転角度。
v
p5.Vector:
target
p5.Vector:
結果を受け取るベクトル
This page is generated from the comments in src/math/p5.Vector.js . Please feel free to edit it and submit a pull request!