AnyCAD Rapid API 2023
Help you to create a better world!
载入中...
搜索中...
未找到
GDir2d类 参考

Public 成员函数

 GDir2d ()
 
 GDir2d (GVec2d theV)
 
 GDir2d (GXY theCoord)
 
 GDir2d (double theXv, double theYv)
 
void SetCoord (int theIndex, double theXi)
 
void SetCoord (double theXv, double theYv)
 
void SetX (double theX)
 
void SetY (double theY)
 
void SetXY (GXY theCoord)
 
double Coord (int theIndex)
 
void Coord (double[] theXv, double[] theYv)
 
double X ()
 
double Y ()
 
GXY XY ()
 
boolean IsEqual (GDir2d theOther, double theAngularTolerance)
 
boolean IsNormal (GDir2d theOther, double theAngularTolerance)
 
boolean IsOpposite (GDir2d theOther, double theAngularTolerance)
 
boolean IsParallel (GDir2d theOther, double theAngularTolerance)
 
double Angle (GDir2d theOther)
 
double Crossed (GDir2d theRight)
 
double Dot (GDir2d theOther)
 
void Reverse ()
 
GDir2d Reversed ()
 
void Mirror (GDir2d theV)
 
GDir2d Mirrored (GDir2d theV)
 
void Mirror (GAx2d theA)
 
GDir2d Mirrored (GAx2d theA)
 
void Rotate (double Ang)
 
GDir2d Rotated (double theAng)
 
void Transform (GTrsf2d theT)
 
GDir2d Transformed (GTrsf2d theT)
 

详细描述

Describes a unit vector in the plane (2D space). This unit vector is also called "Direction". See Also gce_MakeDir2d which provides functions for more complex unit vector constructions Geom2d_Direction which provides additional functions for constructing unit vectors and works, in particular, with the parametric equations of unit vectors

构造及析构函数说明

◆ GDir2d() [1/4]

GDir2d.GDir2d ( )

Creates a direction corresponding to X axis.

◆ GDir2d() [2/4]

GDir2d.GDir2d ( GVec2d  theV)

Normalizes the vector theV and creates a Direction. Raises ConstructionError if theV.Magnitude() <= Resolution from gp.

◆ GDir2d() [3/4]

GDir2d.GDir2d ( GXY  theCoord)

Creates a Direction from a doublet of coordinates. Raises ConstructionError if theCoord.Modulus() <= Resolution from gp.

◆ GDir2d() [4/4]

GDir2d.GDir2d ( double  theXv,
double  theYv 
)

Creates a Direction with its 2 cartesian coordinates. Raises ConstructionError if Sqrt(theXv*theXv + theYv*theYv) <= Resolution from gp.

成员函数说明

◆ Angle()

double GDir2d.Angle ( GDir2d  theOther)

Computes the angular value in radians between <me> and <theOther>. Returns the angle in the range [-PI, PI].

◆ Coord() [1/2]

void GDir2d.Coord ( double[]  theXv,
double[]  theYv 
)

For this unit vector returns its two coordinates theXv and theYv. Raises OutOfRange if theIndex != {1, 2}.

◆ Coord() [2/2]

double GDir2d.Coord ( int  theIndex)

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

◆ Crossed()

double GDir2d.Crossed ( GDir2d  theRight)

Computes the cross product between two directions.

◆ Dot()

double GDir2d.Dot ( GDir2d  theOther)

Computes the scalar product

◆ IsEqual()

boolean GDir2d.IsEqual ( GDir2d  theOther,
double  theAngularTolerance 
)

Returns True if the two vectors have the same direction i.e. the angle between this unit vector and the unit vector theOther is less than or equal to theAngularTolerance.

◆ IsNormal()

boolean GDir2d.IsNormal ( GDir2d  theOther,
double  theAngularTolerance 
)

Returns True if the angle between this unit vector and the unit vector theOther is equal to Pi/2 or -Pi/2 (normal) i.e. Abs(Abs(<me>.Angle(theOther)) - PI/2.) <= theAngularTolerance

◆ IsOpposite()

boolean GDir2d.IsOpposite ( GDir2d  theOther,
double  theAngularTolerance 
)

Returns True if the angle between this unit vector and the unit vector theOther is equal to Pi or -Pi (opposite). i.e. PI - Abs(<me>.Angle(theOther)) <= theAngularTolerance

◆ IsParallel()

boolean GDir2d.IsParallel ( GDir2d  theOther,
double  theAngularTolerance 
)

returns true if the angle between this unit vector and unit vector theOther is equal to 0, Pi or -Pi. i.e. Abs(Angle(<me>, theOther)) <= theAngularTolerance or PI - Abs(Angle(<me>, theOther)) <= theAngularTolerance

◆ Mirrored() [1/2]

GDir2d GDir2d.Mirrored ( GAx2d  theA)

Performs the symmetrical transformation of a direction with respect to an axis placement which is the axis of the symmetry.

◆ Mirrored() [2/2]

GDir2d GDir2d.Mirrored ( GDir2d  theV)

Performs the symmetrical transformation of a direction with respect to the direction theV which is the center of the symmetry.

◆ Reversed()

GDir2d GDir2d.Reversed ( )

Reverses the orientation of a direction

◆ Rotated()

GDir2d GDir2d.Rotated ( double  theAng)

Rotates a direction. theAng is the angular value of the rotation in radians.

◆ SetCoord() [1/2]

void GDir2d.SetCoord ( double  theXv,
double  theYv 
)

For this unit vector, assigns: - the values theXv and theYv to its two coordinates, Warning Remember that all the coordinates of a unit vector are implicitly modified when any single one is changed directly. Exceptions Standard_OutOfRange if theIndex is not 1 or 2. Standard_ConstructionError if either of the following is less than or equal to gp::Resolution(): - Sqrt(theXv*theXv + theYv*theYv), or - the modulus of the number pair formed by the new value Xi and the other coordinate of this vector that was not directly modified. Raises OutOfRange if theIndex != {1, 2}.

◆ SetCoord() [2/2]

void GDir2d.SetCoord ( int  theIndex,
double  theXi 
)

For this unit vector, assigns: the value theXi to: - the X coordinate if theIndex is 1, or - the Y coordinate if theIndex is 2, and then normalizes it. Warning Remember that all the coordinates of a unit vector are implicitly modified when any single one is changed directly. Exceptions Standard_OutOfRange if theIndex is not 1 or 2. Standard_ConstructionError if either of the following is less than or equal to gp::Resolution(): - Sqrt(theXv*theXv + theYv*theYv), or - the modulus of the number pair formed by the new value theXi and the other coordinate of this vector that was not directly modified. Raises OutOfRange if theIndex != {1, 2}.

◆ SetX()

void GDir2d.SetX ( double  theX)

Assigns the given value to the X coordinate of this unit vector, and then normalizes it. Warning Remember that all the coordinates of a unit vector are implicitly modified when any single one is changed directly. Exceptions Standard_ConstructionError if either of the following is less than or equal to gp::Resolution(): - the modulus of Coord, or - the modulus of the number pair formed from the new X or Y coordinate and the other coordinate of this vector that was not directly modified.

◆ SetXY()

void GDir2d.SetXY ( GXY  theCoord)

Assigns: - the two coordinates of theCoord to this unit vector, and then normalizes it. Warning Remember that all the coordinates of a unit vector are implicitly modified when any single one is changed directly. Exceptions Standard_ConstructionError if either of the following is less than or equal to gp::Resolution(): - the modulus of theCoord, or - the modulus of the number pair formed from the new X or Y coordinate and the other coordinate of this vector that was not directly modified.

◆ SetY()

void GDir2d.SetY ( double  theY)

Assigns the given value to the Y coordinate of this unit vector, and then normalizes it. Warning Remember that all the coordinates of a unit vector are implicitly modified when any single one is changed directly. Exceptions Standard_ConstructionError if either of the following is less than or equal to gp::Resolution(): - the modulus of Coord, or - the modulus of the number pair formed from the new X or Y coordinate and the other coordinate of this vector that was not directly modified.

◆ Transformed()

GDir2d GDir2d.Transformed ( GTrsf2d  theT)

Transforms a direction with the "Trsf" theT. Warnings : If the scale factor of the "Trsf" theT is negative then the direction <me> is reversed.

◆ X()

double GDir2d.X ( )

For this unit vector, returns its X coordinate.

◆ XY()

GXY GDir2d.XY ( )

For this unit vector, returns its two coordinates as a number pair. Comparison between Directions The precision value is an input data.

◆ Y()

double GDir2d.Y ( )

For this unit vector, returns its Y coordinate.