PVector class
Properties
hashCode
→ int
The hash code for this object.
no setter inherited
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
x
↔ double
getter/setter pair
y
↔ double
getter/setter pair
z
↔ double
getter/setter pair
Static Methods
add2 (PVector v1 , PVector v2 )
→ PVector
Add two vectors
@param v1 a vector
@param v2 another vector
add3 (PVector v1 , PVector v2 , PVector ? target )
→ PVector
Add two vectors into a target vector
@param target the target vector (if null, a new vector will be created)
dist2 (PVector v1 , PVector v2 )
→ double
@param v1 any variable of type PVector
@param v2 any variable of type PVector
@return the Euclidean distance between v1 and v2
div2 (PVector v , double n )
→ PVector ?
Divide a vector by a scalar and return the result in a new vector.
@param v the vector to divide by the scalar
@return a new vector that is v1 / n
div3 (PVector v , double n , PVector ? target )
→ PVector ?
Divide a vector by a scalar and store the result in another vector.
@param target PVector in which to store the result
fromAngle (double angle )
→ PVector
( begin auto-generated from PVector_sub.xml )
fromAngle_v2 (double angle , PVector ? target )
→ PVector
Make a new 2D unit vector from an angle
random2D ()
→ PVector
( begin auto-generated from PVector_random2D.xml )
random2D_v2 (PVector target )
→ PVector
Set a 2D vector to a random unit vector with a random direction
@param target the target vector (if null, a new vector will be created)
@return the random PVector
random2D_v3 (PVector ? target , PApplet ? parent )
→ PVector
Make a new 2D unit vector with a random direction. Pass in the parent
PApplet if you want randomSeed() to work (and be predictable). Or leave
it null and be... random.
@return the random PVector
sub2 (PVector v1 , PVector v2 )
→ PVector ?
Subtract one vector from another
@param v1 the x, y, and z components of a PVector object
@param v2 the x, y, and z components of a PVector object
sub3 (PVector v1 , PVector v2 , PVector ? target )
→ PVector ?
Subtract one vector from another and store in another vector
@param target PVector in which to store the result
zero ()
→ PVector