limit()

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

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

実例

シンタックス

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

パラメーター

max
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!

関連するリファレンス