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

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 doubleChangeCoord (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]

constexpr gp_XY::gp_XY ( )
inlineconstexprnoexcept

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

◆ gp_XY() [2/2]

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

a number pair defined by the XY coordinates

Member Function Documentation

◆ Add()

constexpr 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()
STL input iterator that wraps an OCCT More()/Next() iterator.
Definition NCollection_ForwardRange.hxx:142

◆ Added()

constexpr gp_XY gp_XY::Added ( const gp_XY & theOther) const
inlineconstexprnoexcept

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

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

◆ ChangeCoord()

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

◆ Coord() [1/2]

constexpr 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]

constexpr void gp_XY::Coord ( double & theX,
double & theY ) const
inlineconstexprnoexcept

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

◆ Crossed()

constexpr double gp_XY::Crossed ( const gp_XY & theOther) const
inlineconstexprnoexcept
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()

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

constexpr void gp_XY::Divide ( const double theScalar)
inlineconstexpr

divides <me> by a real.

◆ Divided()

constexpr gp_XY gp_XY::Divided ( const double theScalar) const
inlineconstexpr

Divides <me> by a real.

◆ Dot()

constexpr 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]

constexpr gp_XY gp_XY::Multiplied ( const double theScalar) const
inlineconstexprnoexcept
New.X() = <me>.X() * theScalar;
New.Y() = <me>.Y() * theScalar;

◆ Multiplied() [2/3]

constexpr gp_XY gp_XY::Multiplied ( const gp_Mat2d & theMatrix) const
inlineconstexprnoexcept

New = theMatrix * <me>

◆ Multiplied() [3/3]

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

◆ Multiply() [1/3]

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

◆ Multiply() [2/3]

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

<me> = theMatrix * <me>

◆ Multiply() [3/3]

constexpr 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
inline
New.X() = <me>.X()/ <me>.Modulus()
New.Y() = <me>.Y()/ <me>.Modulus()

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

◆ operator*() [1/3]

constexpr gp_XY gp_XY::operator* ( const double theScalar) const
inlineconstexprnoexcept

◆ operator*() [2/3]

constexpr gp_XY gp_XY::operator* ( const gp_Mat2d & theMatrix) const
inlineconstexprnoexcept

◆ operator*() [3/3]

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

◆ operator*=() [1/3]

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

◆ operator*=() [2/3]

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

◆ operator*=() [3/3]

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

◆ operator+()

constexpr gp_XY gp_XY::operator+ ( const gp_XY & theOther) const
inlineconstexprnoexcept

◆ operator+=()

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

◆ operator-() [1/2]

constexpr gp_XY gp_XY::operator- ( ) const
inlineconstexprnoexcept

◆ operator-() [2/2]

constexpr gp_XY gp_XY::operator- ( const gp_XY & theOther) const
inlineconstexprnoexcept

◆ operator-=()

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

◆ operator/()

constexpr gp_XY gp_XY::operator/ ( const double theScalar) const
inlineconstexpr

◆ operator/=()

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

◆ operator^()

constexpr double gp_XY::operator^ ( const gp_XY & theOther) const
inlineconstexprnoexcept

◆ Reverse()

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

◆ Reversed()

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

◆ SetCoord() [1/2]

constexpr 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]

constexpr 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]

constexpr 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:

◆ SetLinearForm() [2/4]

constexpr 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:

◆ SetLinearForm() [3/4]

constexpr 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:

◆ SetLinearForm() [4/4]

constexpr 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:

◆ SetX()

constexpr void gp_XY::SetX ( const double theX)
inlineconstexprnoexcept

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

◆ SetY()

constexpr void gp_XY::SetY ( const double theY)
inlineconstexprnoexcept

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

◆ SquareModulus()

constexpr double gp_XY::SquareModulus ( ) const
inlineconstexprnoexcept

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

◆ Subtract()

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

◆ Subtracted()

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

◆ X()

constexpr double gp_XY::X ( ) const
inlineconstexprnoexcept

Returns the X coordinate of this number pair.

◆ Y()

constexpr 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: