OpenLexocad  27.1
Geom::XY Class Reference

#include <XY.h>

Public Member Functions

 XY ()
 Creates an indefinite XY number pair.
More...
 
 XY (const double X, const double Y)
 a number pair defined by the XY coordinates
More...
 
void add (const XY &Other)
 
XY added (const XY &Other) const
 
double coord (const int Index) const
 
void coord (double &X, double &Y) const
 For this number pair, returns its coordinates X and Y.
More...
 
double crossed (const XY &Right) const
 Real D = <me>.x() * Other.y() - <me>.y() * Other.x()
More...
 
double crossMagnitude (const XY &Right) const
 
double crossSquareMagnitude (const XY &Right) const
 
void divide (const double Scalar)
 divides <me> by a real.
More...
 
XY divided (const double Scalar) const
 Divides <me> by a real.
More...
 
double dot (const XY &Other) const
 Computes the scalar product between <me> and Other
More...
 
bool isEqual (const XY &Other, const double Tolerance) const
 
double modulus () const
 Computes Sqrt (x*x + y*y) where x and y are the two coordinates of this number pair.
More...
 
XY multiplied (const double Scalar) const
 
XY multiplied (const XY &Other) const
 
XY multiplied (const Mat2d &Matrix) const
 New = Matrix * <me>
More...
 
void multiply (const double Scalar)
 
void multiply (const XY &Other)
 
void multiply (const Mat2d &Matrix)
 <me> = Matrix * <me>
More...
 
void normalize ()
 
XY normalized () const
 
void operator+= (const XY &Other)
 
XY operator+ (const XY &Other) const
 
XY operator- () const
 
void operator-= (const XY &Right)
 
XY operator- (const XY &Right) const
 
XY operator * (const Mat2d &Matrix) const
 
double operator * (const XY &Other) const
 
void operator *= (const double Scalar)
 
void operator *= (const XY &Other)
 
void operator *= (const Mat2d &Matrix)
 
XY operator * (const double Scalar) const
 
void operator/= (const double Scalar)
 
XY operator/ (const double Scalar) const
 
double operator^ (const XY &Right) const
 
void reverse ()
 
XY reversed () const
 
void setCoord (const int Index, const double Xi)
 
void setCoord (const double X, const double Y)
 
void setLinearForm (const double A1, const XY &XY1, const double A2, const XY &XY2)
 
void setLinearForm (const double A1, const XY &XY1, const double A2, const XY &XY2, const XY &XY3)
 
void setLinearForm (const double A1, const XY &XY1, const XY &XY2)
 
void setLinearForm (const XY &XY1, const XY &XY2)
 
void setX (const double X)
 Assigns the given value to the X coordinate of this number pair.
More...
 
void setY (const double Y)
 Assigns the given value to the Y coordinate of this number pair.
More...
 
double squareModulus () const
 Computes x*x + y*y where x and y are the two coordinates of this number pair.
More...
 
void subtract (const XY &Right)
 
XY subtracted (const XY &Right) const
 
double x () const
 Returns the x coordinate of this number pair.
More...
 
double y () const
 Returns the y coordinate of this number pair.
More...
 

Detailed Description

This class describes a cartesian coordinate entity in 2D
space {X,Y}. This class is non persistent. This entity used
for algebraic calculation. An XY can be transformed with a
Trsf2d or a GTrsf2d from package gp.
It is used in vectorial computations or for holding this type
of information in data structures.

Constructor & Destructor Documentation

◆ XY() [1/2]

Geom::XY::XY ( )

Creates an indefinite XY number pair.

◆ XY() [2/2]

Geom::XY::XY ( const double  X,
const double  Y 
)

a number pair defined by the XY coordinates

Member Function Documentation

◆ add()

void Geom::XY::add ( const XY Other)

Computes the sum of this number pair and number pair Other
<me>.x() = <me>.x() + Other.x()
<me>.y() = <me>.y() + Other.y()

◆ added()

XY Geom::XY::added ( const XY Other) const

Computes the sum of this number pair and number pair Other
new.x() = <me>.x() + Other.x()
new.y() = <me>.y() + Other.y()

◆ coord() [1/2]

double Geom::XY::coord ( const int  Index) const

returns the coordinate of range Index :
Index = 1 => X is returned
Index = 2 => Y is returned
Raises OutOfRange if Index != {1, 2}.

◆ coord() [2/2]

void Geom::XY::coord ( double &  X,
double &  Y 
) const

For this number pair, returns its coordinates X and Y.

◆ crossed()

double Geom::XY::crossed ( const XY Right) const

Real D = <me>.x() * Other.y() - <me>.y() * Other.x()

◆ crossMagnitude()

double Geom::XY::crossMagnitude ( const XY Right) const

computes the magnitude of the cross product between <me> and
Right. Returns || <me> ^ Right ||

◆ crossSquareMagnitude()

double Geom::XY::crossSquareMagnitude ( const XY Right) const

computes the square magnitude of the cross product between <me> and
Right. Returns || <me> ^ Right ||**2

◆ divide()

void Geom::XY::divide ( const double  Scalar)

divides <me> by a real.

◆ divided()

XY Geom::XY::divided ( const double  Scalar) const

Divides <me> by a real.

◆ dot()

double Geom::XY::dot ( const XY Other) const

Computes the scalar product between <me> and Other

◆ isEqual()

bool Geom::XY::isEqual ( const XY Other,
const double  Tolerance 
) const

Returns true if the coordinates of this number pair are
equal to the respective coordinates of the number pair
Other, within the specified tolerance Tolerance. I.e.:
abs(<me>.x() - Other.x()) <= Tolerance and
abs(<me>.y() - Other.y()) <= Tolerance and
//! computations

◆ modulus()

double Geom::XY::modulus ( ) const

Computes Sqrt (x*x + y*y) where x and y are the two coordinates of this number pair.

◆ multiplied() [1/3]

XY Geom::XY::multiplied ( const double  Scalar) const

New.x() = <me>.x() * Scalar;
New.y() = <me>.y() * Scalar;

◆ multiplied() [2/3]

XY Geom::XY::multiplied ( const XY Other) const

new.x() = <me>.x() * Other.x();
new.y() = <me>.y() * Other.y();

◆ multiplied() [3/3]

XY Geom::XY::multiplied ( const Mat2d Matrix) const

New = Matrix * <me>

◆ multiply() [1/3]

void Geom::XY::multiply ( const double  Scalar)

<me>.x() = <me>.x() * Scalar;
<me>.y() = <me>.y() * Scalar;

◆ multiply() [2/3]

void Geom::XY::multiply ( const XY Other)

<me>.x() = <me>.x() * Other.x();
<me>.y() = <me>.y() * Other.y();

◆ multiply() [3/3]

void Geom::XY::multiply ( const Mat2d Matrix)

<me> = Matrix * <me>

◆ normalize()

void Geom::XY::normalize ( )

<me>.x() = <me>.x()/ <me>.Modulus()
<me>.y() = <me>.y()/ <me>.Modulus()
Raises ConstructionError if <me>.Modulus() <= Resolution from gp

◆ normalized()

XY Geom::XY::normalized ( ) const

New.x() = <me>.x()/ <me>.Modulus()
New.y() = <me>.y()/ <me>.Modulus()
Raises ConstructionError if <me>.Modulus() <= Resolution from gp

◆ operator *() [1/3]

XY Geom::XY::operator * ( const Mat2d Matrix) const
inline

◆ operator *() [2/3]

double Geom::XY::operator * ( const XY Other) const
inline

◆ operator *() [3/3]

XY Geom::XY::operator * ( const double  Scalar) const
inline

◆ operator *=() [1/3]

void Geom::XY::operator *= ( const double  Scalar)
inline

◆ operator *=() [2/3]

void Geom::XY::operator *= ( const XY Other)
inline

◆ operator *=() [3/3]

void Geom::XY::operator *= ( const Mat2d Matrix)
inline

◆ operator+()

XY Geom::XY::operator+ ( const XY Other) const
inline

◆ operator+=()

void Geom::XY::operator+= ( const XY Other)
inline

◆ operator-() [1/2]

XY Geom::XY::operator- ( void  ) const
inline

◆ operator-() [2/2]

XY Geom::XY::operator- ( const XY Right) const
inline

◆ operator-=()

void Geom::XY::operator-= ( const XY Right)
inline

◆ operator/()

XY Geom::XY::operator/ ( const double  Scalar) const
inline

◆ operator/=()

void Geom::XY::operator/= ( const double  Scalar)
inline

◆ operator^()

double Geom::XY::operator^ ( const XY Right) const
inline

◆ reverse()

void Geom::XY::reverse ( )

<me>.x() = -<me>.x()
<me>.y() = -<me>.y()

◆ reversed()

XY Geom::XY::reversed ( ) const

New.x() = -<me>.x()
New.y() = -<me>.y()

◆ setCoord() [1/2]

void Geom::XY::setCoord ( const int  Index,
const double  Xi 
)

modifies the coordinate of range Index
Index = 1 => X is modified
Index = 2 => Y is modified
Raises OutOfRange if Index != {1, 2}.

◆ setCoord() [2/2]

void Geom::XY::setCoord ( const double  X,
const double  Y 
)

For this number pair, assigns
the values X and Y to its coordinates

◆ setLinearForm() [1/4]

void Geom::XY::setLinearForm ( const double  A1,
const XY XY1,
const double  A2,
const XY XY2 
)

Computes the following linear combination and
assigns the result to this number pair:
A1 * XY1 + A2 * XY2

◆ setLinearForm() [2/4]

void Geom::XY::setLinearForm ( const double  A1,
const XY XY1,
const double  A2,
const XY XY2,
const XY XY3 
)

– Computes the following linear combination and
assigns the result to this number pair:
A1 * XY1 + A2 * XY2 + XY3

◆ setLinearForm() [3/4]

void Geom::XY::setLinearForm ( const double  A1,
const XY XY1,
const XY XY2 
)

Computes the following linear combination and
assigns the result to this number pair:
A1 * XY1 + XY2

◆ setLinearForm() [4/4]

void Geom::XY::setLinearForm ( const XY XY1,
const XY XY2 
)

Computes the following linear combination and
assigns the result to this number pair:
XY1 + XY2

◆ setX()

void Geom::XY::setX ( const double  X)

Assigns the given value to the X coordinate of this number pair.

◆ setY()

void Geom::XY::setY ( const double  Y)

Assigns the given value to the Y coordinate of this number pair.

◆ squareModulus()

double Geom::XY::squareModulus ( ) const

Computes x*x + y*y where x and y are the two coordinates of this number pair.

◆ subtract()

void Geom::XY::subtract ( const XY Right)

<me>.x() = <me>.x() - Other.x()
<me>.y() = <me>.y() - Other.y()

◆ subtracted()

XY Geom::XY::subtracted ( const XY Right) const

new.x() = <me>.x() - Other.x()
new.y() = <me>.y() - Other.y()

◆ x()

double Geom::XY::x ( ) const

Returns the x coordinate of this number pair.

◆ y()

double Geom::XY::y ( ) const

Returns the y coordinate of this number pair.


The documentation for this class was generated from the following file: