limit()

Limits a vector's magnitude to a maximum value.

The static version of limit(), as in p5.Vector.limit(v, 5), returns a new p5.Vector object and doesn't change the original.

उदाहरण

सिंटैक्स

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

पैरामीटर्स

max
Number:

maximum magnitude for the vector.

v
p5.Vector:

the vector to limit

target
p5.Vector:

the vector to receive the result (Optional)

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

संबंधित संदर्भ