Open CASCADE Technology  7.7.0
Public Member Functions

gp_XY Class Reference

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. More...

#include <gp_XY.hxx>

Public Member Functions

 gp_XY ()
 Creates XY object with zero coordinates (0,0). More...
 
 gp_XY (const Standard_Real theX, const Standard_Real theY)
 a number pair defined by the XY coordinates More...
 
void SetCoord (const Standard_Integer theIndex, const Standard_Real theXi)
 modifies the coordinate of range theIndex theIndex = 1 => X is modified theIndex = 2 => Y is modified Raises OutOfRange if theIndex != {1, 2}. More...
 
void SetCoord (const Standard_Real theX, const Standard_Real theY)
 For this number pair, assigns the values theX and theY to its coordinates. More...
 
void SetX (const Standard_Real theX)
 Assigns the given value to the X coordinate of this number pair. More...
 
void SetY (const Standard_Real theY)
 Assigns the given value to the Y coordinate of this number pair. More...
 
Standard_Real Coord (const Standard_Integer theIndex) const
 returns the coordinate of range theIndex : theIndex = 1 => X is returned theIndex = 2 => Y is returned Raises OutOfRange if theIndex != {1, 2}. More...
 
Standard_RealChangeCoord (const Standard_Integer theIndex)
 
void Coord (Standard_Real &theX, Standard_Real &theY) const
 For this number pair, returns its coordinates X and Y. More...
 
Standard_Real X () const
 Returns the X coordinate of this number pair. More...
 
Standard_Real Y () const
 Returns the Y coordinate of this number pair. More...
 
Standard_Real Modulus () const
 Computes Sqrt (X*X + Y*Y) where X and Y are the two coordinates of this number pair. More...
 
Standard_Real SquareModulus () const
 Computes X*X + Y*Y where X and Y are the two coordinates of this number pair. More...
 
Standard_Boolean IsEqual (const gp_XY &theOther, const Standard_Real theTolerance) const
 Returns true if the coordinates of this number pair are equal to the respective coordinates of the number pair theOther, within the specified tolerance theTolerance. I.e.: abs(<me>.X() - theOther.X()) <= theTolerance and abs(<me>.Y() - theOther.Y()) <= theTolerance and computations. More...
 
void Add (const gp_XY &theOther)
 Computes the sum of this number pair and number pair theOther. More...
 
void operator+= (const gp_XY &theOther)
 
gp_XY Added (const gp_XY &theOther) const
 Computes the sum of this number pair and number pair theOther. More...
 
gp_XY operator+ (const gp_XY &theOther) const
 
Standard_Real Crossed (const gp_XY &theOther) const
 
Standard_Real operator^ (const gp_XY &theOther) const
 
Standard_Real CrossMagnitude (const gp_XY &theRight) const
 computes the magnitude of the cross product between <me> and theRight. Returns || <me> ^ theRight || More...
 
Standard_Real CrossSquareMagnitude (const gp_XY &theRight) const
 computes the square magnitude of the cross product between <me> and theRight. Returns || <me> ^ theRight ||**2 More...
 
void Divide (const Standard_Real theScalar)
 divides <me> by a real. More...
 
void operator/= (const Standard_Real theScalar)
 
gp_XY Divided (const Standard_Real theScalar) const
 Divides <me> by a real. More...
 
gp_XY operator/ (const Standard_Real theScalar) const
 
Standard_Real Dot (const gp_XY &theOther) const
 Computes the scalar product between <me> and theOther. More...
 
Standard_Real operator* (const gp_XY &theOther) const
 
void Multiply (const Standard_Real theScalar)
 
void operator*= (const Standard_Real theScalar)
 
void Multiply (const gp_XY &theOther)
 
void operator*= (const gp_XY &theOther)
 
void Multiply (const gp_Mat2d &theMatrix)
 <me> = theMatrix * <me> More...
 
void operator*= (const gp_Mat2d &theMatrix)
 
gp_XY Multiplied (const Standard_Real theScalar) const
 
gp_XY operator* (const Standard_Real theScalar) const
 
gp_XY Multiplied (const gp_XY &theOther) const
 
gp_XY Multiplied (const gp_Mat2d &theMatrix) const
 New = theMatrix * <me> More...
 
gp_XY operator* (const gp_Mat2d &theMatrix) const
 
void Normalize ()
 
gp_XY Normalized () const
 
void Reverse ()
 
gp_XY Reversed () const
 
gp_XY operator- () const
 
void SetLinearForm (const Standard_Real theA1, const gp_XY &theXY1, const Standard_Real theA2, const gp_XY &theXY2)
 Computes the following linear combination and assigns the result to this number pair: More...
 
void SetLinearForm (const Standard_Real theA1, const gp_XY &theXY1, const Standard_Real theA2, const gp_XY &theXY2, const gp_XY &theXY3)
 – Computes the following linear combination and assigns the result to this number pair: More...
 
void SetLinearForm (const Standard_Real theA1, const gp_XY &theXY1, const gp_XY &theXY2)
 Computes the following linear combination and assigns the result to this number pair: More...
 
void SetLinearForm (const gp_XY &theXY1, const gp_XY &theXY2)
 Computes the following linear combination and assigns the result to this number pair: More...
 
void Subtract (const gp_XY &theOther)
 
void operator-= (const gp_XY &theOther)
 
gp_XY Subtracted (const gp_XY &theOther) const
 
gp_XY operator- (const gp_XY &theOther) const
 

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

◆ gp_XY() [1/2]

gp_XY::gp_XY ( )
inline

Creates XY object with zero coordinates (0,0).

◆ gp_XY() [2/2]

gp_XY::gp_XY ( const Standard_Real  theX,
const Standard_Real  theY 
)
inline

a number pair defined by the XY coordinates

Member Function Documentation

◆ Add()

void gp_XY::Add ( const gp_XY theOther)
inline

Computes the sum of this number pair and number pair theOther.

<me>.X() = <me>.X() + theOther.X()
<me>.Y() = <me>.Y() + theOther.Y()

◆ Added()

gp_XY gp_XY::Added ( const gp_XY theOther) const
inline

Computes the sum of this number pair and number pair theOther.

new.X() = <me>.X() + theOther.X()
new.Y() = <me>.Y() + theOther.Y()

◆ ChangeCoord()

Standard_Real& gp_XY::ChangeCoord ( const Standard_Integer  theIndex)
inline

◆ Coord() [1/2]

Standard_Real gp_XY::Coord ( const Standard_Integer  theIndex) const
inline

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

◆ Coord() [2/2]

void gp_XY::Coord ( Standard_Real theX,
Standard_Real theY 
) const
inline

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

◆ Crossed()

Standard_Real gp_XY::Crossed ( const gp_XY theOther) const
inline
double D = <me>.X() * theOther.Y() - <me>.Y() * theOther.X()

◆ CrossMagnitude()

Standard_Real gp_XY::CrossMagnitude ( const gp_XY theRight) const
inline

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

◆ CrossSquareMagnitude()

Standard_Real gp_XY::CrossSquareMagnitude ( const gp_XY theRight) const
inline

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

◆ Divide()

void gp_XY::Divide ( const Standard_Real  theScalar)
inline

divides <me> by a real.

◆ Divided()

gp_XY gp_XY::Divided ( const Standard_Real  theScalar) const
inline

Divides <me> by a real.

◆ Dot()

Standard_Real gp_XY::Dot ( const gp_XY theOther) const
inline

Computes the scalar product between <me> and theOther.

◆ IsEqual()

Standard_Boolean gp_XY::IsEqual ( const gp_XY theOther,
const Standard_Real  theTolerance 
) const

Returns true if the coordinates of this number pair are equal to the respective coordinates of the number pair theOther, within the specified tolerance theTolerance. I.e.: abs(<me>.X() - theOther.X()) <= theTolerance and abs(<me>.Y() - theOther.Y()) <= theTolerance and computations.

◆ Modulus()

Standard_Real gp_XY::Modulus ( ) const
inline

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

◆ Multiplied() [1/3]

gp_XY gp_XY::Multiplied ( const gp_Mat2d theMatrix) const
inline

New = theMatrix * <me>

◆ Multiplied() [2/3]

gp_XY gp_XY::Multiplied ( const gp_XY theOther) const
inline
new.X() = <me>.X() * theOther.X();
new.Y() = <me>.Y() * theOther.Y();

◆ Multiplied() [3/3]

gp_XY gp_XY::Multiplied ( const Standard_Real  theScalar) const
inline
New.X() = <me>.X() * theScalar;
New.Y() = <me>.Y() * theScalar;

◆ Multiply() [1/3]

void gp_XY::Multiply ( const gp_Mat2d theMatrix)
inline

<me> = theMatrix * <me>

◆ Multiply() [2/3]

void gp_XY::Multiply ( const gp_XY theOther)
inline
<me>.X() = <me>.X() * theOther.X();
<me>.Y() = <me>.Y() * theOther.Y();

◆ Multiply() [3/3]

void gp_XY::Multiply ( const Standard_Real  theScalar)
inline
<me>.X() = <me>.X() * theScalar;
<me>.Y() = <me>.Y() * theScalar;

◆ Normalize()

void gp_XY::Normalize ( )
inline
<me>.X() = <me>.X()/ <me>.Modulus()
<me>.Y() = <me>.Y()/ <me>.Modulus()

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

◆ Normalized()

gp_XY gp_XY::Normalized ( ) const
inline
New.X() = <me>.X()/ <me>.Modulus()
New.Y() = <me>.Y()/ <me>.Modulus()

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

◆ operator*() [1/3]

gp_XY gp_XY::operator* ( const gp_Mat2d theMatrix) const
inline

◆ operator*() [2/3]

Standard_Real gp_XY::operator* ( const gp_XY theOther) const
inline

◆ operator*() [3/3]

gp_XY gp_XY::operator* ( const Standard_Real  theScalar) const
inline

◆ operator*=() [1/3]

void gp_XY::operator*= ( const gp_Mat2d theMatrix)
inline

◆ operator*=() [2/3]

void gp_XY::operator*= ( const gp_XY theOther)
inline

◆ operator*=() [3/3]

void gp_XY::operator*= ( const Standard_Real  theScalar)
inline

◆ operator+()

gp_XY gp_XY::operator+ ( const gp_XY theOther) const
inline

◆ operator+=()

void gp_XY::operator+= ( const gp_XY theOther)
inline

◆ operator-() [1/2]

gp_XY gp_XY::operator- ( ) const
inline

◆ operator-() [2/2]

gp_XY gp_XY::operator- ( const gp_XY theOther) const
inline

◆ operator-=()

void gp_XY::operator-= ( const gp_XY theOther)
inline

◆ operator/()

gp_XY gp_XY::operator/ ( const Standard_Real  theScalar) const
inline

◆ operator/=()

void gp_XY::operator/= ( const Standard_Real  theScalar)
inline

◆ operator^()

Standard_Real gp_XY::operator^ ( const gp_XY theOther) const
inline

◆ Reverse()

void gp_XY::Reverse ( )
inline
<me>.X() = -<me>.X()
<me>.Y() = -<me>.Y()

◆ Reversed()

gp_XY gp_XY::Reversed ( ) const
inline
New.X() = -<me>.X()
New.Y() = -<me>.Y()

◆ SetCoord() [1/2]

void gp_XY::SetCoord ( const Standard_Integer  theIndex,
const Standard_Real  theXi 
)
inline

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

◆ SetCoord() [2/2]

void gp_XY::SetCoord ( const Standard_Real  theX,
const Standard_Real  theY 
)
inline

For this number pair, assigns the values theX and theY to its coordinates.

◆ SetLinearForm() [1/4]

void gp_XY::SetLinearForm ( const gp_XY theXY1,
const gp_XY theXY2 
)
inline

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

theXY1 + theXY2

◆ SetLinearForm() [2/4]

void gp_XY::SetLinearForm ( const Standard_Real  theA1,
const gp_XY theXY1,
const gp_XY theXY2 
)
inline

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

theA1 * theXY1 + theXY2

◆ SetLinearForm() [3/4]

void gp_XY::SetLinearForm ( const Standard_Real  theA1,
const gp_XY theXY1,
const Standard_Real  theA2,
const gp_XY theXY2 
)
inline

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

theA1 * theXY1 + theA2 * theXY2

◆ SetLinearForm() [4/4]

void gp_XY::SetLinearForm ( const Standard_Real  theA1,
const gp_XY theXY1,
const Standard_Real  theA2,
const gp_XY theXY2,
const gp_XY theXY3 
)
inline

– Computes the following linear combination and assigns the result to this number pair:

theA1 * theXY1 + theA2 * theXY2 + theXY3

◆ SetX()

void gp_XY::SetX ( const Standard_Real  theX)
inline

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

◆ SetY()

void gp_XY::SetY ( const Standard_Real  theY)
inline

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

◆ SquareModulus()

Standard_Real gp_XY::SquareModulus ( ) const
inline

Computes X*X + Y*Y where X and Y are the two coordinates of this number pair.

◆ Subtract()

void gp_XY::Subtract ( const gp_XY theOther)
inline
<me>.X() = <me>.X() - theOther.X()
<me>.Y() = <me>.Y() - theOther.Y()

◆ Subtracted()

gp_XY gp_XY::Subtracted ( const gp_XY theOther) const
inline
new.X() = <me>.X() - theOther.X()
new.Y() = <me>.Y() - theOther.Y()

◆ X()

Standard_Real gp_XY::X ( ) const
inline

Returns the X coordinate of this number pair.

◆ Y()

Standard_Real gp_XY::Y ( ) const
inline

Returns the Y coordinate of this number pair.


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