Provides simple 3d vector functionality including, addition, subtraction, scalar multiplication, cross product, norm, plot(print) and converting to a perl list.
1.00 (23 October 2002)
Constructor to create a new Vector object. Takes an array of 3 numbers to populate the vector coordinates.
$v1 = new CmUtils::Vector( @array ); $v2 = new CmUtils::Vector( (1,2,3) );
Returns the vector components as an array
@array = $v1->list();
Evaluates the vector in a string context;
@v1->myprint();
Implementation of vector addition for overloaded operator +
Implementation of vector scalar multiplication for overloaded operator *
Implementation of vector scalar division for overloaded operator /
Implementation of vector subtraction for overloaded operator -
Returns the vector cross product of two vectors
$v3 = crossp($v1,$v2);
Returns the vector dot product of two vectors
$v3 = dotp($v1,$v2);
Returns the norm of a vector
$norm = norm($v1);
Returns the length of a vector
$length = $v1->length;
Prints out the vector components, useful in debugging
@v1->plot();