Reference×
Reference
- [] (array access)
- = (assign)
- catch
- class
- , (comma)
- // (comment)
- {} (curly braces)
- /** */ (doc comment)
- . (dot)
- draw()
- exit()
- extends
- false
- final
- implements
- import
- loop()
- /* */ (multiline comment)
- new
- noLoop()
- null
- () (parentheses)
- popStyle()
- pop()
- public
- private
- pushStyle()
- push()
- return
- redraw()
- ; (semicolon)
- setResizable()
- setLocation()
- setTitle()
- setup()
- static
- super
- this
- true
- thread()
- void
- try
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.