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

Public 成员函数

 GVec2d ()
 
 GVec2d (GDir2d theV)
 
 GVec2d (GXY theCoord)
 
 GVec2d (double theXv, double theYv)
 
 GVec2d (GPnt2d theP1, GPnt2d theP2)
 
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 (GVec2d theOther, double theLinearTolerance, double theAngularTolerance)
 
boolean IsNormal (GVec2d theOther, double theAngularTolerance)
 
boolean IsOpposite (GVec2d theOther, double theAngularTolerance)
 
boolean IsParallel (GVec2d theOther, double theAngularTolerance)
 
double Angle (GVec2d theOther)
 
double Magnitude ()
 
double SquareMagnitude ()
 
void Add (GVec2d theOther)
 
GVec2d Added (GVec2d theOther)
 
double Crossed (GVec2d theRight)
 
double CrossMagnitude (GVec2d theRight)
 
double CrossSquareMagnitude (GVec2d theRight)
 
void Divide (double theScalar)
 
GVec2d Divided (double theScalar)
 
double Dot (GVec2d theOther)
 
GVec2d GetNormal ()
 
void Multiply (double theScalar)
 
GVec2d Multiplied (double theScalar)
 
void Normalize ()
 
GVec2d Normalized ()
 
void Reverse ()
 
GVec2d Reversed ()
 
void Subtract (GVec2d theRight)
 
GVec2d Subtracted (GVec2d theRight)
 
void SetLinearForm (double theA1, GVec2d theV1, double theA2, GVec2d theV2, GVec2d theV3)
 
void SetLinearForm (double theA1, GVec2d theV1, double theA2, GVec2d theV2)
 
void SetLinearForm (double theA1, GVec2d theV1, GVec2d theV2)
 
void SetLinearForm (GVec2d theV1, GVec2d theV2)
 
void Mirror (GVec2d theV)
 
GVec2d Mirrored (GVec2d theV)
 
void Mirror (GAx2d theA1)
 
GVec2d Mirrored (GAx2d theA1)
 
void Rotate (double theAng)
 
GVec2d Rotated (double theAng)
 
void Scale (double theS)
 
GVec2d Scaled (double theS)
 
void Transform (GTrsf2d theT)
 
GVec2d Transformed (GTrsf2d theT)
 

详细描述

Defines a non-persistent vector in 2D space.

构造及析构函数说明

◆ GVec2d() [1/5]

GVec2d.GVec2d ( )

Creates a zero vector.

◆ GVec2d() [2/5]

GVec2d.GVec2d ( GDir2d  theV)

Creates a unitary vector from a direction theV.

◆ GVec2d() [3/5]

GVec2d.GVec2d ( GXY  theCoord)

Creates a vector with a doublet of coordinates.

◆ GVec2d() [4/5]

GVec2d.GVec2d ( double  theXv,
double  theYv 
)

Creates a point with its two Cartesian coordinates.

◆ GVec2d() [5/5]

GVec2d.GVec2d ( GPnt2d  theP1,
GPnt2d  theP2 
)

Creates a vector from two points. The length of the vector is the distance between theP1 and theP2

成员函数说明

◆ Added()

GVec2d GVec2d.Added ( GVec2d  theOther)

Adds two vectors

◆ Angle()

double GVec2d.Angle ( GVec2d  theOther)

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.

◆ Coord() [1/2]

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

For this vector, returns its two coordinates theXv and theYv

◆ Coord() [2/2]

double GVec2d.Coord ( int  theIndex)

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

◆ Crossed()

double GVec2d.Crossed ( GVec2d  theRight)

Computes the crossing product between two vectors

◆ CrossMagnitude()

double GVec2d.CrossMagnitude ( GVec2d  theRight)

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

◆ CrossSquareMagnitude()

double GVec2d.CrossSquareMagnitude ( GVec2d  theRight)

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

◆ Divided()

GVec2d GVec2d.Divided ( double  theScalar)

divides a vector by a scalar

◆ Dot()

double GVec2d.Dot ( GVec2d  theOther)

Computes the scalar product

◆ IsEqual()

boolean GVec2d.IsEqual ( GVec2d  theOther,
double  theLinearTolerance,
double  theAngularTolerance 
)

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.

◆ IsNormal()

boolean GVec2d.IsNormal ( GVec2d  theOther,
double  theAngularTolerance 
)

Returns True if abs(Abs(<me>.Angle(theOther)) - PI/2.) <= theAngularTolerance Raises VectorWithNullMagnitude if <me>.Magnitude() <= Resolution or theOther.Magnitude() <= Resolution from gp.

◆ IsOpposite()

boolean GVec2d.IsOpposite ( GVec2d  theOther,
double  theAngularTolerance 
)

Returns True if PI - Abs(<me>.Angle(theOther)) <= theAngularTolerance Raises VectorWithNullMagnitude if <me>.Magnitude() <= Resolution or theOther.Magnitude() <= Resolution from gp.

◆ IsParallel()

boolean GVec2d.IsParallel ( GVec2d  theOther,
double  theAngularTolerance 
)

Returns true if Abs(Angle(<me>, theOther)) <= theAngularTolerance or PI - 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

◆ Magnitude()

double GVec2d.Magnitude ( )

Computes the magnitude of this vector.

◆ Mirror() [1/2]

void GVec2d.Mirror ( GAx2d  theA1)

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

◆ Mirror() [2/2]

void GVec2d.Mirror ( GVec2d  theV)

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

◆ Mirrored() [1/2]

GVec2d GVec2d.Mirrored ( GAx2d  theA1)

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

◆ Mirrored() [2/2]

GVec2d GVec2d.Mirrored ( GVec2d  theV)

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

◆ Multiplied()

GVec2d GVec2d.Multiplied ( double  theScalar)

Normalizes a vector Raises an exception if the magnitude of the vector is lower or equal to Resolution from package gp.

◆ Normalized()

GVec2d GVec2d.Normalized ( )

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

◆ Reversed()

GVec2d GVec2d.Reversed ( )

Reverses the direction of a vector

◆ Rotated()

GVec2d GVec2d.Rotated ( double  theAng)

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

◆ Scaled()

GVec2d GVec2d.Scaled ( double  theS)

Scales a vector. theS is the scaling value.

◆ SetCoord() [1/2]

void GVec2d.SetCoord ( double  theXv,
double  theYv 
)

For this vector, assigns the values theXv and theYv to its two coordinates

◆ SetCoord() [2/2]

void GVec2d.SetCoord ( int  theIndex,
double  theXi 
)

Changes 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 GVec2d.SetLinearForm ( double  theA1,
GVec2d  theV1,
double  theA2,
GVec2d  theV2 
)

<me> is set to the following linear form : theA1 * theV1 + theA2 * theV2

◆ SetLinearForm() [2/4]

void GVec2d.SetLinearForm ( double  theA1,
GVec2d  theV1,
double  theA2,
GVec2d  theV2,
GVec2d  theV3 
)

<me> is set to the following linear form : theA1 * theV1 + theA2 * theV2 + theV3

◆ SetLinearForm() [3/4]

void GVec2d.SetLinearForm ( double  theA1,
GVec2d  theV1,
GVec2d  theV2 
)

<me> is set to the following linear form : theA1 * theV1 + theV2

◆ SetLinearForm() [4/4]

void GVec2d.SetLinearForm ( GVec2d  theV1,
GVec2d  theV2 
)

<me> is set to the following linear form : theV1 + theV2

◆ SetX()

void GVec2d.SetX ( double  theX)

Assigns the given value to the X coordinate of this vector.

◆ SetXY()

void GVec2d.SetXY ( GXY  theCoord)

Assigns the two coordinates of theCoord to this vector.

◆ SetY()

void GVec2d.SetY ( double  theY)

Assigns the given value to the Y coordinate of this vector.

◆ SquareMagnitude()

double GVec2d.SquareMagnitude ( )

Computes the square magnitude of this vector.

◆ Subtract()

void GVec2d.Subtract ( GVec2d  theRight)

Subtracts two vectors

◆ Subtracted()

GVec2d GVec2d.Subtracted ( GVec2d  theRight)

Subtracts two vectors

◆ Transformed()

GVec2d GVec2d.Transformed ( GTrsf2d  theT)

Transforms a vector with a Trsf from gp.

◆ X()

double GVec2d.X ( )

For this vector, returns its X coordinate.

◆ XY()

GXY GVec2d.XY ( )

For this vector, returns its two coordinates as a number pair

◆ Y()

double GVec2d.Y ( )

For this vector, returns its Y coordinate.