Mathematics 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(double[])
Constructs a CATMathVector from an array of three coordinates.
o CATMathVector(CATMathVector&)
Copy constructor.
o CATMathVector(double,double,double)
Constructs a CATMathVector from 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[])
Retrieves the coordinates of this CATMathVector in an array.
o GetCoord(double&,double&,double&)
Retrieves the coordinates of this CATMathVector.
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[])
Modifies the coordinates of this CATMathVector from an array of 3 doubles.
o SetCoord(double,double,double)
Modifies the coordinates of this CATMathVector from 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 *(double,CATMathVector&)
Defines the left scalar multiplication.
o operator *(CATMathVector&,double)
Defines the right scalar multiplication.
o operator *(CATMathVector&,CATMathVector&)
Defines the dot product of two CATMathVectors.
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 -(CATMathVector&)
Defines the opposite of 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&,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 CATMathVector()
Constructs a (0,0,0) vector.
o CATMathVector
public CATMathVector( const iCoord)
Constructs a CATMathVector from an array of three coordinates.
o CATMathVector
public CATMathVector( const iVectorToCopy)
Copy constructor.
o CATMathVector
public CATMathVector( const iX,
const iY,
const iZ)
Constructs a CATMathVector from three coordinates.

Methods


o Dump
public Dump( iStream=0L)
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 GetAngleTo( const iOtherVector)
Returns the angle (between 0 and CATPI radians) with another CATMathVector.
Returns 0 if the vector is null.
o GetAngleTo
public GetAngleTo( const iOtherVector,
const iRefVector)
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 GetCoord( iCoord)
Retrieves the coordinates of this CATMathVector in an array.
o GetCoord
public GetCoord( ioX,
ioY,
ioZ)
Retrieves the coordinates of this CATMathVector.
o GetCylindricalCoord
public GetCylindricalCoord( ioRadius,
ioAngle,
ioHeight)
Retrieves of this CATMathVector, expressed in its cylindrical coordinates.
oAngle is expressed in radians.
o GetSphericalCoord
public GetSphericalCoord( ioRadius,
ioLongitudeAngle,
ioLatitudeAngle)
Retrieves this CATMathVector, expressed in its spherical coordinates.
ioLongitudeAngle and ioLatitudeAngle are expressed in radians.
o GetX
public GetX()
Returns the X coordinate of this CATMathVector.
o GetY
public GetY()
Returns the Y coordinate of this CATMathVector.
o GetZ
public GetZ()
Returns the Z coordinate of this CATMathVector.
o IsOrthogonal
public IsOrthogonal( const iOtherVector)
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 IsParallel( const iOtherVector)
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 Norm()
Returns the euclidean norm of this CATMathVector.
o Normalize
public Normalize()
Normalizes this CATMathVector.
Simply returns if this is null.
o OrthoComponents
public OrthoComponents( const iRefVector,
ioParallelComponent,
ioNormalComponent)
Retrieves the orthogonal decomposition of a CATMathVector related to a reference vector.
o SetCoord
public SetCoord( const iCoord)
Modifies the coordinates of this CATMathVector from an array of 3 doubles.
o SetCoord
public SetCoord( const iX,
const iY,
const iZ)
Modifies the coordinates of this CATMathVector from 3 doubles.
o SetCylindricalCoord
public SetCylindricalCoord( const iRadius,
const iAngle,
const iHeight)
Modifies this CATMathVector with its cylindrical coordinates.
iAngle is expressed in radians.
o SetSphericalCoord
public SetSphericalCoord( const iRadius,
const iLongitudeAngle,
const iLatitudeAngle)
Modifies this CATMathVector with its spherical coordinates.
iLongitudeAngle and iLatitudeAngle are expressed in radians.
o SetX
public SetX( const iX)
Modifies the X coordinate of this CATMathVector.
o SetY
public SetY( const iY)
Modifies the Y coordinate of this CATMathVector.
o SetZ
public SetZ( const iZ)
Modifies the Z coordinate of this CATMathVector.
o SquareNorm
public SquareNorm()
Returns the square of the euclidean norm of this CATMathVector.
o operator *
public operator *( const iScalar,
const 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 operator *( const iVector,
const 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 operator *( const iVector1,
const 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 operator *=( iVector,
const 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 operator +( const iPoint,
const 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 operator +( const iVector1,
const 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 operator +=( iPoint,
const 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 operator -( const 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 operator -( const iPoint1,
const 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 operator -( const iPoint,
const 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 operator -( const iVector1,
const 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 operator -=( iPoint,
const 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 operator /( const iVector,
const 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 operator /=( iVector,
const 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 operator ^( const iVector1,
const 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 © 1999-2014, Dassault Systèmes. All rights reserved.