limit()

ベクトルの大きさを最大値に制限します。

limit()の静的バージョン(例:p5.Vector.limit(v, 5))は、 新しいp5.Vectorオブジェクトを返し、 元のオブジェクトは変更しません。

実例

シンタックス

limit(max)
limit(v, max, [target])

パラメーター

max
Number:

ベクトルの最大の大きさ。

v
p5.Vector:

制限するベクトル

target
p5.Vector:

結果を受け取るベクトル(オプション)

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

関連するリファレンス