![]() |
Open CASCADE Technology Reference Manual 8.0.0
|
Defines a non-persistent vector in 2D space. More...
#include <gp_Vec2d.hxx>
Public Member Functions | |
| constexpr | gp_Vec2d () noexcept=default |
| Creates a zero vector. | |
| constexpr | gp_Vec2d (const gp_Dir2d &theV) |
| Creates a unitary vector from a direction theV. | |
| constexpr | gp_Vec2d (const gp_XY &theCoord) noexcept |
| Creates a vector with a doublet of coordinates. | |
| constexpr | gp_Vec2d (const double theXv, const double theYv) noexcept |
| Creates a point with its two Cartesian coordinates. | |
| constexpr | gp_Vec2d (const gp_Pnt2d &theP1, const gp_Pnt2d &theP2) |
| Creates a vector from two points. The length of the vector is the distance between theP1 and theP2. | |
| constexpr void | SetCoord (const int theIndex, const double theXi) |
| Changes 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 theXv, const double theYv) noexcept |
| For this vector, assigns the values theXv and theYv to its two coordinates. | |
| constexpr void | SetX (const double theX) noexcept |
| Assigns the given value to the X coordinate of this vector. | |
| constexpr void | SetY (const double theY) noexcept |
| Assigns the given value to the Y coordinate of this vector. | |
| constexpr void | SetXY (const gp_XY &theCoord) noexcept |
| Assigns the two coordinates of theCoord to this vector. | |
| constexpr double | Coord (const int theIndex) const |
| Returns the coordinate of range theIndex : theIndex = 1 => X is returned theIndex = 2 => Y is returned Raised if theIndex != {1, 2}. | |
| constexpr void | Coord (double &theXv, double &theYv) const noexcept |
| For this vector, returns its two coordinates theXv and theYv. | |
| constexpr double | X () const noexcept |
| For this vector, returns its X coordinate. | |
| constexpr double | Y () const noexcept |
| For this vector, returns its Y coordinate. | |
| constexpr const gp_XY & | XY () const noexcept |
| For this vector, returns its two coordinates as a number pair. | |
| bool | IsEqual (const gp_Vec2d &theOther, const double theLinearTolerance, const double theAngularTolerance) const |
| Returns True if the two vectors have the same magnitude value and the same direction. The precision values are theLinearTolerance for the magnitude and theAngularTolerance for the direction. | |
| bool | IsNormal (const gp_Vec2d &theOther, const double theAngularTolerance) const |
| Returns True if abs(std::abs(<me>.Angle(theOther)) - PI/2.) <= theAngularTolerance Raises VectorWithNullMagnitude if <me>.Magnitude() <= Resolution or theOther.Magnitude() <= Resolution from gp. | |
| bool | IsOpposite (const gp_Vec2d &theOther, const double theAngularTolerance) const |
| Returns True if PI - std::abs(<me>.Angle(theOther)) <= theAngularTolerance Raises VectorWithNullMagnitude if <me>.Magnitude() <= Resolution or theOther.Magnitude() <= Resolution from gp. | |
| bool | IsParallel (const gp_Vec2d &theOther, const double theAngularTolerance) const |
| Returns true if std::abs(Angle(<me>, theOther)) <= theAngularTolerance or PI - std::abs(Angle(<me>, theOther)) <= theAngularTolerance Two vectors with opposite directions are considered as parallel. Raises VectorWithNullMagnitude if <me>.Magnitude() <= Resolution or theOther.Magnitude() <= Resolution from gp. | |
| double | Angle (const gp_Vec2d &theOther) const |
| Computes the angular value between <me> and <theOther> returns the angle value between -PI and PI in radian. The orientation is from <me> to theOther. The positive sense is the trigonometric sense. Raises VectorWithNullMagnitude if <me>.Magnitude() <= Resolution from gp or theOther.Magnitude() <= Resolution because the angular value is indefinite if one of the vectors has a null magnitude. | |
| double | Magnitude () const |
| Computes the magnitude of this vector. | |
| double | SquareMagnitude () const |
| Computes the square magnitude of this vector. | |
| void | Add (const gp_Vec2d &theOther) |
| void | operator+= (const gp_Vec2d &theOther) |
| gp_Vec2d | Added (const gp_Vec2d &theOther) const |
| Adds two vectors. | |
| gp_Vec2d | operator+ (const gp_Vec2d &theOther) const |
| double | Crossed (const gp_Vec2d &theRight) const |
| Computes the crossing product between two vectors. | |
| double | operator^ (const gp_Vec2d &theRight) const |
| double | CrossMagnitude (const gp_Vec2d &theRight) const |
| Computes the magnitude of the cross product between <me> and theRight. Returns || <me> ^ theRight ||. | |
| double | CrossSquareMagnitude (const gp_Vec2d &theRight) const |
| Computes the square magnitude of the cross product between <me> and theRight. Returns || <me> ^ theRight ||**2. | |
| void | Divide (const double theScalar) |
| void | operator/= (const double theScalar) |
| gp_Vec2d | Divided (const double theScalar) const |
| divides a vector by a scalar | |
| gp_Vec2d | operator/ (const double theScalar) const |
| double | Dot (const gp_Vec2d &theOther) const |
| Computes the scalar product. | |
| double | operator* (const gp_Vec2d &theOther) const |
| gp_Vec2d | GetNormal () const |
| void | Multiply (const double theScalar) |
| void | operator*= (const double theScalar) |
| gp_Vec2d | Multiplied (const double theScalar) const |
| Normalizes a vector Raises an exception if the magnitude of the vector is lower or equal to Resolution from package gp. | |
| gp_Vec2d | operator* (const double theScalar) const |
| void | Normalize () |
| gp_Vec2d | Normalized () const |
| Normalizes a vector Raises an exception if the magnitude of the vector is lower or equal to Resolution from package gp. Reverses the direction of a vector. | |
| void | Reverse () |
| gp_Vec2d | Reversed () const |
| Reverses the direction of a vector. | |
| gp_Vec2d | operator- () const |
| void | Subtract (const gp_Vec2d &theRight) |
| Subtracts two vectors. | |
| void | operator-= (const gp_Vec2d &theRight) |
| gp_Vec2d | Subtracted (const gp_Vec2d &theRight) const |
| Subtracts two vectors. | |
| gp_Vec2d | operator- (const gp_Vec2d &theRight) const |
| void | SetLinearForm (const double theA1, const gp_Vec2d &theV1, const double theA2, const gp_Vec2d &theV2, const gp_Vec2d &theV3) |
| <me> is set to the following linear form : theA1 * theV1 + theA2 * theV2 + theV3 | |
| void | SetLinearForm (const double theA1, const gp_Vec2d &theV1, const double theA2, const gp_Vec2d &theV2) |
| <me> is set to the following linear form : theA1 * theV1 + theA2 * theV2 | |
| void | SetLinearForm (const double theA1, const gp_Vec2d &theV1, const gp_Vec2d &theV2) |
| <me> is set to the following linear form : theA1 * theV1 + theV2 | |
| void | SetLinearForm (const gp_Vec2d &theV1, const gp_Vec2d &theV2) |
| <me> is set to the following linear form : theV1 + theV2 | |
| void | Mirror (const gp_Vec2d &theV) |
| Performs the symmetrical transformation of a vector with respect to the vector theV which is the center of the symmetry. | |
| gp_Vec2d | Mirrored (const gp_Vec2d &theV) const |
| Performs the symmetrical transformation of a vector with respect to the vector theV which is the center of the symmetry. | |
| void | Mirror (const gp_Ax2d &theA1) |
| Performs the symmetrical transformation of a vector with respect to an axis placement which is the axis of the symmetry. | |
| gp_Vec2d | Mirrored (const gp_Ax2d &theA1) const |
| Performs the symmetrical transformation of a vector with respect to an axis placement which is the axis of the symmetry. | |
| void | Rotate (const double theAng) |
| gp_Vec2d | Rotated (const double theAng) const |
| Rotates a vector. theAng is the angular value of the rotation in radians. | |
| void | Scale (const double theS) |
| gp_Vec2d | Scaled (const double theS) const |
| Scales a vector. theS is the scaling value. | |
| void | Transform (const gp_Trsf2d &theT) noexcept |
| gp_Vec2d | Transformed (const gp_Trsf2d &theT) const |
| Transforms a vector with a Trsf from gp. | |
Defines a non-persistent vector in 2D space.
|
constexprdefaultnoexcept |
Creates a zero vector.
Creates a unitary vector from a direction theV.
Creates a vector with a doublet of coordinates.
Creates a point with its two Cartesian coordinates.
Creates a vector from two points. The length of the vector is the distance between theP1 and theP2.
Computes the angular value between <me> and <theOther> returns the angle value between -PI and PI in radian. The orientation is from <me> to theOther. The positive sense is the trigonometric sense. Raises VectorWithNullMagnitude if <me>.Magnitude() <= Resolution from gp or theOther.Magnitude() <= Resolution because the angular value is indefinite if one of the vectors has a null magnitude.
Returns the coordinate of range theIndex : theIndex = 1 => X is returned theIndex = 2 => Y is returned Raised if theIndex != {1, 2}.
For this vector, returns its two coordinates theXv and theYv.
Computes the crossing product between two vectors.
Computes the magnitude of the cross product between <me> and theRight. Returns || <me> ^ theRight ||.
Computes the square magnitude of the cross product between <me> and theRight. Returns || <me> ^ theRight ||**2.
|
inline |
| bool gp_Vec2d::IsEqual | ( | const gp_Vec2d & | theOther, |
| const double | theLinearTolerance, | ||
| const double | theAngularTolerance ) const |
Returns True if the two vectors have the same magnitude value and the same direction. The precision values are theLinearTolerance for the magnitude and theAngularTolerance for the direction.
|
inline |
Returns True if abs(std::abs(<me>.Angle(theOther)) - PI/2.) <= theAngularTolerance Raises VectorWithNullMagnitude if <me>.Magnitude() <= Resolution or theOther.Magnitude() <= Resolution from gp.
|
inline |
Returns True if PI - std::abs(<me>.Angle(theOther)) <= theAngularTolerance Raises VectorWithNullMagnitude if <me>.Magnitude() <= Resolution or theOther.Magnitude() <= Resolution from gp.
|
inline |
Returns true if std::abs(Angle(<me>, theOther)) <= theAngularTolerance or PI - std::abs(Angle(<me>, theOther)) <= theAngularTolerance Two vectors with opposite directions are considered as parallel. Raises VectorWithNullMagnitude if <me>.Magnitude() <= Resolution or theOther.Magnitude() <= Resolution from gp.
|
inline |
Computes the magnitude of this vector.
Performs the symmetrical transformation of a vector with respect to an axis placement which is the axis of the symmetry.
Performs the symmetrical transformation of a vector with respect to the vector theV which is the center of the symmetry.
Performs the symmetrical transformation of a vector with respect to an axis placement which is the axis of the symmetry.
Performs the symmetrical transformation of a vector with respect to the vector theV which is the center of the symmetry.
Normalizes a vector Raises an exception if the magnitude of the vector is lower or equal to Resolution from package gp.
|
inline |
|
inline |
Normalizes a vector Raises an exception if the magnitude of the vector is lower or equal to Resolution from package gp. Reverses the direction of a vector.
|
inline |
|
inline |
|
inline |
Reverses the direction of a vector.
Rotates a vector. theAng is the angular value of the rotation in radians.
Scales a vector. theS is the scaling value.
|
inlineconstexprnoexcept |
For this vector, assigns the values theXv and theYv to its two coordinates.
Changes the coordinate of range theIndex theIndex = 1 => X is modified theIndex = 2 => Y is modified Raises OutOfRange if theIndex != {1, 2}.
|
inline |
<me> is set to the following linear form : theA1 * theV1 + theA2 * theV2
|
inline |
<me> is set to the following linear form : theA1 * theV1 + theA2 * theV2 + theV3
|
inline |
<me> is set to the following linear form : theA1 * theV1 + theV2
<me> is set to the following linear form : theV1 + theV2
Assigns the given value to the X coordinate of this vector.
Assigns the two coordinates of theCoord to this vector.
Assigns the given value to the Y coordinate of this vector.
|
inline |
Computes the square magnitude of this vector.
Transforms a vector with a Trsf from gp.
For this vector, returns its X coordinate.
For this vector, returns its two coordinates as a number pair.
For this vector, returns its Y coordinate.