Reference+
Name
setMag()
Class
PVector
Description
Set the magnitude of this vector to the value used for the len parameter.
Examples
PVector v = new PVector(3, 4, 0); v.setMag(10); println(v); // Prints "[ 6.0, 8.0, 0.0 ]"
Syntax
.setMag(len)
.setMag(target, len)
Parameters
len
(float)
the new length for this vectortarget
(PVector)
Set to null to create a new vectorlen
(float)
the new length for the new vector
Return
PVector
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.