point2line
index
 
Name subtracted ( )
Description Subtracts and input vector from the vector and returns the result without changing the originals.
Syntax
subtracted(x, y);
subtracted(vector);
Parameters
x,y   components to subtract from the vector (float,float)
vector   to subtract from the vector (Vect2)
Returns new vector containing the result of the subtraction (Vect2)
Usage Web & Application
Related subtract ( )
added ( )
scaled ( )
divided ( )
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.subtracted( position1 );

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