point2line
index
 
Name clip ( )
Description Clips the magnitude of the vector. In other words, if the magnitude exceeds the input value, it is set to that value.
Syntax
clip(maximum);
Parameters
maximum   magnitude (float)
Returns None
Usage Web & Application
Related clipped ( )
setMagnitude ( )
Examples
import point2line.*;

Vect2 velocity = new Vect2( 10, 10 );

println( velocity.magnitude() ); // prints "14.142136"

velocity.clip( 20 );

println( velocity.magnitude() ); // prints "14.142136"

velocity.clip( 5 );

println( velocity.magnitude() ); // prints "5.0"