Mathematics CATMathVector2D

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


public class CATMathVector2D

Class representing a mathematical vector in dimension 2.


Constructor and Destructor Index


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

Method Index


o Dump(ostream*)
Dumps the coordinates of this CATMathVector2D.
o GetAngleTo(CATMathVector2D&)
Returns the angle (between - CATPI and CATPI radians) with another CATMathVector2D.
o GetCoord(double[])
Retrieves the coordinates of this CATMathVector2D in an array of 2 doubles.
o GetCoord(double&,double&)
Retrieves the coordinates of this CATMathVector2D.
o GetX()
Retrieves the X coordinate of this CATMathVector2D.
o GetY()
Retrieves the Y coordinate of this CATMathVector2D.
o IsOrthogonal(CATMathVector2D&)
Returns the diagnosis of orthogonalism with another CATMathVector2D.
o IsParallel(CATMathVector2D&)
Returns the diagnosis of parallelism with another CATMathVector2D.
o Norm()
Returns the euclidean norm of this CATMathVector2D.
o Normalize()
Normalizes this CATMathVector2D.
o SetCoord(double[])
Modifies the coordinates of this CATMathVector2D from an array of 2 doubles.
o SetCoord(double,double)
Modifies the coordinates of this CATMathVector2D from 2 doubles.
o SetX(double)
Modifies the X coordinate of this CATMathVector2D.
o SetY(double)
Modifies the Y coordinate of this CATMathVector2D.
o SquareNorm()
Returns the square of the euclidean norm of this CATMathVector2D.
o operator *(double)
Defines the left side scalar muliplication.
o operator *(CATMathVector2D&)
Defines the dot product.
o operator +(CATMathVector2D&)
Defines the addition of two CATMathVector2D.
o operator -()
Defines the opposite of a CATMathVector2D.
o operator -(CATMathVector2D&)
Defines the subtraction of two CATMathVector2D.
o operator /(double)
Defines the scalar division.
o operator ^(CATMathVector2D&)
Defines the determinant.

Constructor and Destructor


o CATMathVector2D
public CATMathVector2D()
Constructs a (0,0) vector.
o CATMathVector2D
public CATMathVector2D( const Coord)
Constructs a CATMathVector2D from an array of two coordinates.
o CATMathVector2D
public CATMathVector2D( iX,
iY)
Constructs a CATMathVector2D from coordinates.
o CATMathVector2D
public CATMathVector2D( const iVectorToCopy)
Copy constructor.

Methods


o Dump
public Dump( iStream=0L)
Dumps the coordinates of this CATMathVector2D.
This writes the following line on the ostream:
( FirstCoord , SecondCoord )
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 - CATPI and CATPI radians) with another CATMathVector2D.
Returns 0 if one vector is null.
o GetCoord
public GetCoord( iCoord)
Retrieves the coordinates of this CATMathVector2D in an array of 2 doubles.
o GetCoord
public GetCoord( ioX,
ioY)
Retrieves the coordinates of this CATMathVector2D.
o GetX
public GetX()
Retrieves the X coordinate of this CATMathVector2D.
o GetY
public GetY()
Retrieves the Y coordinate of this CATMathVector2D.
o IsOrthogonal
public IsOrthogonal( const iOtherVector)
Returns the diagnosis of orthogonalism with another CATMathVector2D.
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 with another CATMathVector2D.
The method uses the numerical tolerance. For a user tolerance, use the GetAngleTo method.
Returns:
TRUE
if they are parallel.
FALSE
otherwise.
o Norm
public Norm()
Returns the euclidean norm of this CATMathVector2D.
o Normalize
public Normalize()
Normalizes this CATMathVector2D.
Simply returns if the vector is null.
o SetCoord
public SetCoord( const iCoord)
Modifies the coordinates of this CATMathVector2D from an array of 2 doubles.
o SetCoord
public SetCoord( iX,
iY)
Modifies the coordinates of this CATMathVector2D from 2 doubles.
o SetX
public SetX( iX)
Modifies the X coordinate of this CATMathVector2D.
o SetY
public SetY( iY)
Modifies the Y coordinate of this CATMathVector2D.
o SquareNorm
public SquareNorm()
Returns the square of the euclidean norm of this CATMathVector2D.
o operator *
public operator *( iScalar)
Defines the left side scalar muliplication.
o operator *
public operator *( const iVector)
Defines the dot product.
o operator +
public operator +( const iAddedVector)
Defines the addition of two CATMathVector2D.
o operator -
public operator -()
Defines the opposite of a CATMathVector2D.
o operator -
public operator -( const iVector)
Defines the subtraction of two CATMathVector2D.
o operator /
public operator /( iScalar)
Defines the scalar division.
o operator ^
public operator ^( const iVector)
Defines the determinant.

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

Copyright © 1999-2014, Dassault Systèmes. All rights reserved.