All Frameworks Class Hierarchy This Framework Previous Next Indexes
Mathematics Class CATMathVector2D
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(CATMathVector2D&)
- Copy constructor.
- o
CATMathVector2D(double,double)
- Constructs a CATMathVector2D from coordinates.
- o
CATMathVector2D(double[])
- Constructs a CATMathVector2D from an array of two coordinates.
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&,double&)
- Retrieves the coordinates of this CATMathVector2D.
- o
GetCoord(double[])
- Retrieves the coordinates of this CATMathVector2D in an array of 2 doubles.
- 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,double)
- Modifies the coordinates of this CATMathVector2D from 2 doubles.
- o
SetCoord(double[])
- Modifies the coordinates of this CATMathVector2D from an array of 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 *(CATMathVector2D&)
- Defines the dot product.
- o
operator *(double)
- Defines the left side scalar muliplication.
- 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 INLINE CATMathVector2D( | ) |
-
Constructs a (0,0) vector.
o CATMathVector2D
-
Copy constructor.
o CATMathVector2D
public INLINE CATMathVector2D( | double | iX, |
| double | iY) |
-
Constructs a CATMathVector2D from coordinates.
o CATMathVector2D
public CATMathVector2D( | const double[] | Coord) |
-
Constructs a CATMathVector2D from an array of two coordinates.
Methods
o Dump
public void Dump( | ostream* | iStream | =0L) const |
-
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
-
Returns the angle (between - CATPI and CATPI radians) with another CATMathVector2D.
Returns 0 if one vector is null.
o GetCoord
public INLINE void GetCoord( | double& | ioX, |
| double& | ioY) const |
-
Retrieves the coordinates of this CATMathVector2D.
o GetCoord
public void GetCoord( | double[] | iCoord) const |
-
Retrieves the coordinates of this CATMathVector2D in an array of 2 doubles.
o GetX
-
Retrieves the X coordinate of this CATMathVector2D.
o GetY
-
Retrieves the Y coordinate of this CATMathVector2D.
o IsOrthogonal
-
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
-
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
-
Returns the euclidean norm of this CATMathVector2D.
o Normalize
-
Normalizes this CATMathVector2D.
Simply returns if the vector is null.
o SetCoord
public INLINE void SetCoord( | double | iX, |
| double | iY) |
-
Modifies the coordinates of this CATMathVector2D from 2 doubles.
o SetCoord
public void SetCoord( | const double[] | iCoord) |
-
Modifies the coordinates of this CATMathVector2D from an array of 2 doubles.
o SetX
public INLINE void SetX( | double | iX) |
-
Modifies the X coordinate of this CATMathVector2D.
o SetY
public INLINE void SetY( | double | iY) |
-
Modifies the Y coordinate of this CATMathVector2D.
o SquareNorm
public double SquareNorm( | )const |
-
Returns the square of the euclidean norm of this CATMathVector2D.
o operator *
-
Defines the dot product.
o operator *
-
Defines the left side scalar muliplication.
o operator +
-
Defines the addition of two CATMathVector2D.
o operator -
-
Defines the opposite of a CATMathVector2D.
o operator -
-
Defines the subtraction of two CATMathVector2D.
o operator /
-
Defines the scalar division.
o operator ^
-
Defines the determinant.
This object is included in the file: CATMathVector2D.h
If needed, your Imakefile.mk should include the module: CATMathematics