Open CASCADE Technology Reference Manual 8.0.2
Loading...
Searching...
No Matches
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

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

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 ( )
inlineconstexprnoexcept

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

◆ gp_XY() [2/2]

gp_XY::gp_XY ( const double theX,
const double theY )
inlineconstexprnoexcept

a number pair defined by the XY coordinates

Member Function Documentation

◆ Add()

void gp_XY::Add ( const gp_XY & theOther)
inlineconstexprnoexcept

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
inlinenodiscardconstexprnoexcept

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

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

◆ ChangeCoord()

double & gp_XY::ChangeCoord ( const int theIndex)
inlineconstexpr

◆ Coord() [1/2]

double gp_XY::Coord ( const int theIndex) const
inlineconstexpr

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 ( double & theX,
double & theY ) const
inlineconstexprnoexcept

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

◆ Crossed()

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

◆ CrossMagnitude()

double gp_XY::CrossMagnitude ( const gp_XY & theRight) const
inline

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

◆ CrossSquareMagnitude()

double gp_XY::CrossSquareMagnitude ( const gp_XY & theRight) const
inlineconstexprnoexcept

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

◆ Divide()

void gp_XY::Divide ( const double theScalar)
inlineconstexpr

divides <me> by a real.

◆ Divided()

gp_XY gp_XY::Divided ( const double theScalar) const
inlinenodiscardconstexpr

Divides <me> by a real.

◆ Dot()

double gp_XY::Dot ( const gp_XY & theOther) const
inlineconstexprnoexcept

Computes the scalar product between <me> and theOther.

◆ IsEqual()

bool gp_XY::IsEqual ( const gp_XY & theOther,
const double theTolerance ) const
inline

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.

◆ Modulus()

double gp_XY::Modulus ( ) const
inline

Computes std::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 double theScalar) const
inlinenodiscardconstexprnoexcept
New.X() = <me>.X() * theScalar;
New.Y() = <me>.Y() * theScalar;

◆ Multiplied() [2/3]

gp_XY gp_XY::Multiplied ( const gp_Mat2d & theMatrix) const
inlinenodiscardconstexprnoexcept

New = theMatrix * <me>

◆ Multiplied() [3/3]

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

◆ Multiply() [1/3]

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

◆ Multiply() [2/3]

void gp_XY::Multiply ( const gp_Mat2d & theMatrix)
inlineconstexprnoexcept

<me> = theMatrix * <me>

◆ Multiply() [3/3]

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

◆ 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
inlinenodiscard
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 double theScalar) const
inlinenodiscardconstexprnoexcept

◆ operator*() [2/3]

gp_XY gp_XY::operator* ( const gp_Mat2d & theMatrix) const
inlinenodiscardconstexprnoexcept

◆ operator*() [3/3]

double gp_XY::operator* ( const gp_XY & theOther) const
inlineconstexprnoexcept

◆ operator*=() [1/3]

void gp_XY::operator*= ( const double theScalar)
inlineconstexprnoexcept

◆ operator*=() [2/3]

void gp_XY::operator*= ( const gp_Mat2d & theMatrix)
inlineconstexprnoexcept

◆ operator*=() [3/3]

void gp_XY::operator*= ( const gp_XY & theOther)
inlineconstexprnoexcept

◆ operator+()

gp_XY gp_XY::operator+ ( const gp_XY & theOther) const
inlinenodiscardconstexprnoexcept

◆ operator+=()

void gp_XY::operator+= ( const gp_XY & theOther)
inlineconstexprnoexcept

◆ operator-() [1/2]

gp_XY gp_XY::operator- ( ) const
inlinenodiscardconstexprnoexcept

◆ operator-() [2/2]

gp_XY gp_XY::operator- ( const gp_XY & theOther) const
inlinenodiscardconstexprnoexcept

◆ operator-=()

void gp_XY::operator-= ( const gp_XY & theOther)
inlineconstexprnoexcept

◆ operator/()

gp_XY gp_XY::operator/ ( const double theScalar) const
inlinenodiscardconstexpr

◆ operator/=()

void gp_XY::operator/= ( const double theScalar)
inlineconstexpr

◆ operator^()

double gp_XY::operator^ ( const gp_XY & theOther) const
inlinenodiscardconstexprnoexcept

◆ Reverse()

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

◆ Reversed()

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

◆ SetCoord() [1/2]

void gp_XY::SetCoord ( const double theX,
const double theY )
inlineconstexprnoexcept

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

◆ SetCoord() [2/2]

void gp_XY::SetCoord ( const int theIndex,
const double theXi )
inlineconstexpr

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

◆ SetLinearForm() [1/4]

void gp_XY::SetLinearForm ( const double theA1,
const gp_XY & theXY1,
const double theA2,
const gp_XY & theXY2 )
inlineconstexprnoexcept

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

theA1 * theXY1 + theA2 * theXY2

◆ SetLinearForm() [2/4]

void gp_XY::SetLinearForm ( const double theA1,
const gp_XY & theXY1,
const double theA2,
const gp_XY & theXY2,
const gp_XY & theXY3 )
inlineconstexprnoexcept

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

theA1 * theXY1 + theA2 * theXY2 + theXY3

◆ SetLinearForm() [3/4]

void gp_XY::SetLinearForm ( const double theA1,
const gp_XY & theXY1,
const gp_XY & theXY2 )
inlineconstexprnoexcept

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

theA1 * theXY1 + theXY2

◆ SetLinearForm() [4/4]

void gp_XY::SetLinearForm ( const gp_XY & theXY1,
const gp_XY & theXY2 )
inlineconstexprnoexcept

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

theXY1 + theXY2

◆ SetX()

void gp_XY::SetX ( const double theX)
inlineconstexprnoexcept

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

◆ SetY()

void gp_XY::SetY ( const double theY)
inlineconstexprnoexcept

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

◆ SquareModulus()

double gp_XY::SquareModulus ( ) const
inlineconstexprnoexcept

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)
inlineconstexprnoexcept
<me>.X() = <me>.X() - theOther.X()
<me>.Y() = <me>.Y() - theOther.Y()

◆ Subtracted()

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

◆ X()

double gp_XY::X ( ) const
inlineconstexprnoexcept

Returns the X coordinate of this number pair.

◆ Y()

double gp_XY::Y ( ) const
inlineconstexprnoexcept

Returns the Y coordinate of this number pair.


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