point2line
index
 
Name subtract ( )
Description Subtracts an input from the vector and stores the result.
Syntax
subtract(x, y);
subtract(vector);
Parameters
x,y   components to subtract from the vector (float,float)
vector   to subtract from the vector (Vect2)
Returns None
Usage Web & Application
Related subtracted ( )
add ( )
scale ( )
divide ( )
Examples
import point2line.*;

Vect2 position1 = new Vect2( 50, 50 );
Vect2 position2 = new Vect2( 200, 200 );

// calculate a vector pointing from position1 towards position2 //
Vect2 direction = position2.copy();
direction.subtract( position1 );

println( direction ); // prints "Vect2( 150.0, 150.0 )"