| Class | PVector | ||
|---|---|---|---|
| Name | mag() |
||
| Examples | PVector v;
void setup() {
size(100, 100);
v = new PVector(20.0, 30.0, 40.0);
float m = v.mag();
println(m); // Prints "53.851646"
}
|
||
| Description | Calculates the magnitude (length) of the vector and returns the result as a float (this is simply the equation sqrt(x*x + y*y + z*z).) |
||
| Syntax | vec.mag() |
||
| Parameters |
|
||
| Returns | float | ||
| Usage | Web & Application |