SPAunit_vector
List of: Classes
Subjects: Mathematics
Contents: Base

Purpose: Provides a direction in 3D Cartesian space that has unit length.

Derivation: SPAunit_vector : SPAvector : -

Filename: base/baseutil/vector/unitvec.hxx

Description: This class provides a direction in 3D Cartesian space that has unit length. Because it is a derived class of vector, it inherits the functionality of vectors. There are a few operations that are peculiar to unit vectors.

Constructor: public: SPAunit_vector::SPAunit_vector ();


C++ allocation constructor requests memory for this object but does not populate it.






public: SPAunit_vector::SPAunit_vector (


double, // x-coordinate


double, // y-coordinate


double // z-coordinate


);


C++ initialize constructor requests memory for this object and populates it with the data supplied as arguments.


Creates a SPAunit_vector using the specified parameters. The result is normalized.






public: SPAunit_vector::SPAunit_vector (


double u[ 3 ] // x,y, & z values


);


C++ initialize constructor requests memory for this object and populates it with the data supplied as arguments.


Creates a SPAunit_vector using the specified parameters. The result is normalized.



Methods: public: SPAunit_vector const& SPAunit_vector::operator*= (


SPAtransf const& // transform


);


Transforms a unit vector by the rotation matrix in a transformation. This method returns an error if the transformation contains a shear component.






friend: double operator% (


SPAposition const&, // position


SPAunit_vector const& // unit vector


);


Returns the scalar product of a position and a SPAunit_vector. It is declared explicitly to avoid an ambiguity.






friend: double operator% (


SPAunit_vector const&, // unit vector


SPAposition const& // position


);


Returns the scalar product of a position and a SPAunit_vector. It is declared explicitly to avoid an ambiguity.






friend: SPAposition operator* (


SPAposition const&, // position


SPAunit_vector const& // unit vector


);


Returns a position as a cross-product of a unit vector with a position.






friend: SPAposition operator* (


SPAunit_vector const&, // unit vector


SPAposition const& // position


);


Returns a position as a cross-product of a position with a unit vector.






friend: SPAunit_vector operator* (


SPAunit_vector const&, // unit vector


SPAtransf const& // transformation


);


Transforms a unit vector by the rotation matrix in a transformation. This method returns an error if the transformation contains a shear component.






friend: SPAunit_vector operator* (


SPAunit_vector const&, // unit vector


SPAtransf const* // transformation


);


Transforms a unit vector by the rotation matrix in a transformation. This method returns an error if the transformation contains a shear component.






friend: SPAunit_vector operator- (


SPAunit_vector const& // unit vector


);


Performs a unary minus operation.




Related Fncs: normalise
PDF/BASE/03CL.PDF
HTM/DATA/BASE/BASE/03CL/0026.HTM