All Frameworks  Class Hierarchy  This Framework  Previous  Next  Indexes

Mathematics Class CATMathVector

CATMathVector
 

Usage: you must use this class as is. You should never derive it.


public class CATMathVector

Class representing a mathematical vector in dimension 3.


Constructor and Destructor Index


o CATMathVector()
Constructs a (0,0,0) vector.
o CATMathVector(CATMathVector&)
Copy constructor.
o CATMathVector(double,double,double)
Constructs a CATMathVector from three coordinates.
o CATMathVector(double[])
Constructs a CATMathVector from an array of three coordinates.

Method Index


o Dump(ostream*)
Dumps the coordinates of a CATMathVector.
o GetAngleTo(CATMathVector&)
Returns the angle (between 0 and CATPI radians) with another CATMathVector.
o GetAngleTo(CATMathVector&,CATMathVector&)
Returns the signed angle (between 0 and CAT2PI radians), with another CATMathVector, oriented by a reference vector.
o GetCoord(double&,double&,double&)
Retrieves the coordinates of this CATMathVector.
o GetCoord(double[])
Retrieves the coordinates of this CATMathVector in an array.
o GetCylindricalCoord(double&,CATAngle&,double&)
Retrieves of this CATMathVector, expressed in its cylindrical coordinates.
o GetSphericalCoord(double&,CATAngle&,CATAngle&)
Retrieves this CATMathVector, expressed in its spherical coordinates.
o GetX()
Returns the X coordinate of this CATMathVector.
o GetY()
Returns the Y coordinate of this CATMathVector.
o GetZ()
Returns the Z coordinate of this CATMathVector.
o IsOrthogonal(CATMathVector&)
Returns the diagnosis of orthogonality.
o IsParallel(CATMathVector&)
Returns the diagnosis of parallelism.
o Norm()
Returns the euclidean norm of this CATMathVector.
o Normalize()
Normalizes this CATMathVector.
o OrthoComponents(CATMathVector&,CATMathVector&,CATMathVector&)
Retrieves the orthogonal decomposition of a CATMathVector related to a reference vector.
o SetCoord(double,double,double)
Modifies the coordinates of this CATMathVector from 3 doubles.
o SetCoord(double[])
Modifies the coordinates of this CATMathVector from an array of 3 doubles.
o SetCylindricalCoord(double,CATAngle,double)
Modifies this CATMathVector with its cylindrical coordinates.
o SetSphericalCoord(double,CATAngle,CATAngle)
Modifies this CATMathVector with its spherical coordinates.
o SetX(double)
Modifies the X coordinate of this CATMathVector.
o SetY(double)
Modifies the Y coordinate of this CATMathVector.
o SetZ(double)
Modifies the Z coordinate of this CATMathVector.
o SquareNorm()
Returns the square of the euclidean norm of this CATMathVector.
o operator *(CATMathVector&,CATMathVector&)
Defines the dot product of two CATMathVectors.
o operator *(CATMathVector&,double)
Defines the right scalar multiplication.
o operator *(double,CATMathVector&)
Defines the left scalar multiplication.
o operator *=(CATMathVector&,double)
Modifies a CATMathPoint by using the right scalar multiplication.
o operator +(CATMathPoint&,CATMathVector&)
Translates a CATMathPoint by a CATMathVector.
o operator +(CATMathVector&,CATMathVector&)
Defines the addition of two CATMAthVectors.
o operator +=(CATMathPoint&,CATMathVector&)
Modifies a CATMathPoint by using a tranlation by a CATMathVector.
o operator -(CATMathPoint&,CATMathPoint&)
Builds a CATMathVector as the difference of two CATMathPoints.
o operator -(CATMathPoint&,CATMathVector&)
Translates a CATMathPoint by a CATMathVector.
o operator -(CATMathVector&)
Defines the opposite of a CATMathVector.
o operator -(CATMathVector&,CATMathVector&)
Defines the substraction of two CATMAthVectors.
o operator -=(CATMathPoint&,CATMathVector&)
Modifies a CATMathPoint by using a tranlation by a CATMathVector.
o operator /(CATMathVector&,double)
Defines the scalar division.
o operator /=(CATMathVector&,double)
Modifies a CATMathPoint by using the scalar division.
o operator ^(CATMathVector&,CATMathVector&)
Defines the cross product of two CATMathVectors.

Constructor and Destructor


o CATMathVector
public INLINE CATMathVector()
Constructs a (0,0,0) vector.
o CATMathVector
public INLINE CATMathVector( const CATMathVector& iVectorToCopy)
Copy constructor.
o CATMathVector
public INLINE CATMathVector( const double iX,
const double iY,
const double iZ)
Constructs a CATMathVector from three coordinates.
o CATMathVector
public INLINE CATMathVector( const double[] iCoord)
Constructs a CATMathVector from an array of three coordinates.

Methods


o Dump
public void Dump(ostream* iStream=0L) const
Dumps the coordinates of a CATMathVector.
This writes the following line on the ostream:
( FirstCoord , SecondCoord , ThirdCoord )
Parameters:
iStream
A pointer to the output. If 0L, the method dumps the coordinates on the cout output.
o GetAngleTo
public CATAngle GetAngleTo( const CATMathVector& iOtherVector) const
Returns the angle (between 0 and CATPI radians) with another CATMathVector.
Returns 0 if the vector is null.
o GetAngleTo
public CATAngle GetAngleTo( const CATMathVector& iOtherVector,
const CATMathVector& iRefVector) const
Returns the signed angle (between 0 and CAT2PI radians), with another CATMathVector, oriented by a reference vector.
Returns 0 if the vector is null.
o GetCoord
public INLINE void GetCoord(double& ioX,
double& ioY,
double& ioZ) const
Retrieves the coordinates of this CATMathVector.
o GetCoord
public INLINE void GetCoord(double[] iCoord) const
Retrieves the coordinates of this CATMathVector in an array.
o GetCylindricalCoord
public void GetCylindricalCoord(double& ioRadius,
CATAngle& ioAngle,
double& ioHeight) const
Retrieves of this CATMathVector, expressed in its cylindrical coordinates.
oAngle is expressed in radians.
o GetSphericalCoord
public void GetSphericalCoord(double& ioRadius,
CATAngle& ioLongitudeAngle,
CATAngle& ioLatitudeAngle) const
Retrieves this CATMathVector, expressed in its spherical coordinates.
ioLongitudeAngle and ioLatitudeAngle are expressed in radians.
o GetX
public INLINE double GetX()const
Returns the X coordinate of this CATMathVector.
o GetY
public INLINE double GetY()const
Returns the Y coordinate of this CATMathVector.
o GetZ
public INLINE double GetZ()const
Returns the Z coordinate of this CATMathVector.
o IsOrthogonal
public CATBoolean IsOrthogonal( const CATMathVector& iOtherVector) const
Returns the diagnosis of orthogonality.
The method uses the numerical tolerance. For a user tolerance, use the GetAngleTo method.
Returns:
TRUE
if they are orthogonal or one vector is null.
FALSE
otherwise.
o IsParallel
public CATBoolean IsParallel( const CATMathVector& iOtherVector) const
Returns the diagnosis of parallelism.
The method uses the numerical tolerance. For a user tolerance, use the GetAngleTo method.
Returns:
TRUE
if they are parallel or one vector is null.
FALSE
otherwise.
o Norm
public double Norm()const
Returns the euclidean norm of this CATMathVector.
o Normalize
public void Normalize()
Normalizes this CATMathVector.
Simply returns if this is null.
o OrthoComponents
public void OrthoComponents( const CATMathVector& iRefVector,
CATMathVector& ioParallelComponent,
CATMathVector& ioNormalComponent) const
Retrieves the orthogonal decomposition of a CATMathVector related to a reference vector.
o SetCoord
public INLINE void SetCoord( const double iX,
const double iY,
const double iZ)
Modifies the coordinates of this CATMathVector from 3 doubles.
o SetCoord
public INLINE void SetCoord( const double[] iCoord)
Modifies the coordinates of this CATMathVector from an array of 3 doubles.
o SetCylindricalCoord
public void SetCylindricalCoord( const double iRadius,
const CATAngle iAngle,
const double iHeight)
Modifies this CATMathVector with its cylindrical coordinates.
iAngle is expressed in radians.
o SetSphericalCoord
public void SetSphericalCoord( const double iRadius,
const CATAngle iLongitudeAngle,
const CATAngle iLatitudeAngle)
Modifies this CATMathVector with its spherical coordinates.
iLongitudeAngle and iLatitudeAngle are expressed in radians.
o SetX
public INLINE void SetX( const double iX)
Modifies the X coordinate of this CATMathVector.
o SetY
public INLINE void SetY( const double iY)
Modifies the Y coordinate of this CATMathVector.
o SetZ
public INLINE void SetZ( const double iZ)
Modifies the Z coordinate of this CATMathVector.
o SquareNorm
public double SquareNorm()const
Returns the square of the euclidean norm of this CATMathVector.
o operator *
public INLINE friend double operator *( const CATMathVector& iVector1,
const CATMathVector& iVector2)
Defines the dot product of two CATMathVectors.
Parameters:
iVector1
The CATMathVector of (u1,u2,u3) coordinates.
iVector2
The CATMathVector of (v1,v2,v3) coordinates.
Returns:
u1*v1 + u2*v2 + u3*v3.
o operator *
public INLINE friend CATMathVector operator *( const CATMathVector& iVector,
const double iScalar)
Defines the right scalar multiplication.
Parameters:
iVector
The CATMathVector of (u1,u2,u3) coordinates.
iScalar
The scalar.
Returns:
The CATMathVector of (u1*iScalar,u2*iScalar,u3*iScalar) coordinates.
o operator *
public INLINE friend CATMathVector operator *( const double iScalar,
const CATMathVector& iVector)
Defines the left scalar multiplication.
Parameters:
iScalar
The scalar.
iVector
The CATMathVector of (u1,u2,u3) coordinates.
Returns:
The CATMathVector of (iScalar*u1,iScalar*u2,iScalar*u3) coordinates.
o operator *=
public INLINE friend void operator *=(CATMathVector& iVector,
const double iScalar)
Modifies a CATMathPoint by using the right scalar multiplication.
Parameters:
iVector
The CATMathVector of (u1,u2,u3) coordinates.
iScalar
The scalar.
Returns:
The CATMathVector of (u1=u1*iScalar,u2=u2*iScalar,u3=u3*iScalar) coordinates.
o operator +
public INLINE friend CATMathPoint operator +( const CATMathPoint& iPoint,
const CATMathVector& iVector)
Translates a CATMathPoint by a CATMathVector.
Parameters:
iPoint
The CATMathPoint of (p1,p2,p3) coordinates.
iVector
The CATMathVector of (u1,u2,u3) coordinates.
Returns:
The CATMathPoint of (p1+u1,p2+u2,p3+u3) coordinates.
o operator +
public INLINE friend CATMathVector operator +( const CATMathVector& iVector1,
const CATMathVector& iVector2)
Defines the addition of two CATMAthVectors.
Parameters:
iVector1
The CATMathVector of (u1,u2,u3) coordinates.
iVector2
The CATMathVector of (v1,v2,v3) coordinates.
Returns:
The CATMathVector of (u1+v1,u2+v2,u3+v3) coordinates.
o operator +=
public INLINE friend void operator +=(CATMathPoint& iPoint,
const CATMathVector& iVector)
Modifies a CATMathPoint by using a tranlation by a CATMathVector.
Parameters:
iPoint
The CATMathPoint of (p1,p2,p3) coordinates.
iVector
The CATMathVector of (u1,u2,u3) coordinates.
Returns:
The CATMathPoint of (p1=p1+u1,p2=p2+u2,p3=p3+u3) coordinates.
o operator -
public INLINE friend CATMathVector operator -( const CATMathPoint& iPoint1,
const CATMathPoint& iPoint2)
Builds a CATMathVector as the difference of two CATMathPoints.
Note that the iPoint1iPoint2 vector is given by iPoint2-iPoint1.
Parameters:
iPoint1
The CATMathPoint of (p1,p2,p3) coordinates.
iPoint2
The CATMathPoint of (q1,q2,q3) coordinates.
Returns:
The CATMathVector of (p1-q1,p2-q2,p3-q3) coordinates.
o operator -
public INLINE friend CATMathPoint operator -( const CATMathPoint& iPoint,
const CATMathVector& iVector)
Translates a CATMathPoint by a CATMathVector.
Parameters:
iPoint
The CATMathPoint of (p1,p2,p3) coordinates.
iVector
The CATMathVector of (u1,u2,u3) coordinates.
Returns:
The CATMathPoint of (p1-u1,p2-u2,p3-u3) coordinates.
o operator -
public INLINE friend CATMathVector operator -( const CATMathVector& iVector)
Defines the opposite of a CATMathVector.
Parameters:
iVector
The CATMathVector of (u1,u2,u3) coordinates.
Returns:
The CATMathVector of (-u1,-u2,-u3) coordinates.
o operator -
public INLINE friend CATMathVector operator -( const CATMathVector& iVector1,
const CATMathVector& iVector2)
Defines the substraction of two CATMAthVectors.
Parameters:
iVector1
The CATMathVector of (u1,u2,u3) coordinates.
iVector2
The CATMathVector of (v1,v2,v3) coordinates.
Returns:
The CATMathVector of (u1-v1,u2-v2,u3-v3) coordinates.
o operator -=
public INLINE friend void operator -=(CATMathPoint& iPoint,
const CATMathVector& iVector)
Modifies a CATMathPoint by using a tranlation by a CATMathVector.
Parameters:
iPoint
The CATMathPoint of (p1,p2,p3) coordinates.
iVector
The CATMathVector of (u1,u2,u3) coordinates.
Returns:
The CATMathPoint of (p1=p1-u1,p2=p2-u2,p3=p3-u3) coordinates.
o operator /
public INLINE friend CATMathVector operator /( const CATMathVector& iVector,
const double iScalar)
Defines the scalar division.
Parameters:
iVector
The CATMathVector of (u1,u2,u3) coordinates.
iScalar
The (not null) scalar.
Returns:
The CATMathVector of (u1/iScalar,u2/iScalar,u3/iScalar) coordinates.
o operator /=
public INLINE friend void operator /=(CATMathVector& iVector,
const double iScalar)
Modifies a CATMathPoint by using the scalar division.
Parameters:
iVector
The CATMathVector of (u1,u2,u3) coordinates.
iScalar
The (not null) scalar.
Returns:
The CATMathVector of (u1=u1/iScalar,u2=u2/iScalar,u3=u3/iScalar) coordinates.
o operator ^
public INLINE friend CATMathVector operator ^( const CATMathVector& iVector1,
const CATMathVector& iVector2)
Defines the cross product of two CATMathVectors.
Parameters:
iVector1
The CATMathVector of (u1,u2,u3) coordinates.
iVector2
The CATMathVector of (v1,v2,v3) coordinates.
Returns:
The CATMathVector (u2*iv3-u3*v2, u3*iv1-u1*v3, u1*v2-u2*v1).

This object is included in the file: CATMathVector.h
If needed, your Imakefile.mk should include the module: CATMathematics

Copyright © 2003, Dassault Systèmes. All rights reserved.