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

Public 成员函数

 GVec ()
 
 GVec (GDir theV)
 
 GVec (GXYZ theCoord)
 
 GVec (double theXv, double theYv, double theZv)
 
 GVec (GPnt theP1, GPnt theP2)
 
void SetCoord (int theIndex, double theXi)
 
void SetCoord (double theXv, double theYv, double theZv)
 
void SetX (double theX)
 
void SetY (double theY)
 
void SetZ (double theZ)
 
void SetXYZ (GXYZ theCoord)
 
double Coord (int theIndex)
 
void Coord (double[] theXv, double[] theYv, double[] theZv)
 
double X ()
 
double Y ()
 
double Z ()
 
GXYZ XYZ ()
 
boolean IsEqual (GVec theOther, double theLinearTolerance, double theAngularTolerance)
 
boolean IsNormal (GVec theOther, double theAngularTolerance)
 
boolean IsOpposite (GVec theOther, double theAngularTolerance)
 
boolean IsParallel (GVec theOther, double theAngularTolerance)
 
double Angle (GVec theOther)
 
double AngleWithRef (GVec theOther, GVec theVRef)
 
double Magnitude ()
 
double SquareMagnitude ()
 
void Add (GVec theOther)
 
GVec Added (GVec theOther)
 
void Subtract (GVec theRight)
 
GVec Subtracted (GVec theRight)
 
void Multiply (double theScalar)
 
GVec Multiplied (double theScalar)
 
void Divide (double theScalar)
 
GVec Divided (double theScalar)
 
void Cross (GVec theRight)
 
GVec Crossed (GVec theRight)
 
double CrossMagnitude (GVec theRight)
 
double CrossSquareMagnitude (GVec theRight)
 
void CrossCross (GVec theV1, GVec theV2)
 
GVec CrossCrossed (GVec theV1, GVec theV2)
 
double Dot (GVec theOther)
 
double DotCross (GVec theV1, GVec theV2)
 
void Normalize ()
 
GVec Normalized ()
 
void Reverse ()
 
GVec Reversed ()
 
void SetLinearForm (double theA1, GVec theV1, double theA2, GVec theV2, double theA3, GVec theV3, GVec theV4)
 
void SetLinearForm (double theA1, GVec theV1, double theA2, GVec theV2, double theA3, GVec theV3)
 
void SetLinearForm (double theA1, GVec theV1, double theA2, GVec theV2, GVec theV3)
 
void SetLinearForm (double theA1, GVec theV1, double theA2, GVec theV2)
 
void SetLinearForm (double theA1, GVec theV1, GVec theV2)
 
void SetLinearForm (GVec theV1, GVec theV2)
 
void Mirror (GVec theV)
 
GVec Mirrored (GVec theV)
 
void Mirror (GAx1 theA1)
 
GVec Mirrored (GAx1 theA1)
 
void Mirror (GAx2 theA2)
 
GVec Mirrored (GAx2 theA2)
 
void Rotate (GAx1 theA1, double theAng)
 
GVec Rotated (GAx1 theA1, double theAng)
 
void Scale (double theS)
 
GVec Scaled (double theS)
 
void Transform (GTrsf theT)
 
GVec Transformed (GTrsf theT)
 

详细描述

Defines a non-persistent vector in 3D space.

构造及析构函数说明

◆ GVec() [1/5]

GVec.GVec ( )

Creates a zero vector.

◆ GVec() [2/5]

GVec.GVec ( GDir  theV)

Creates a unitary vector from a direction theV.

◆ GVec() [3/5]

GVec.GVec ( GXYZ  theCoord)

Creates a vector with a triplet of coordinates.

◆ GVec() [4/5]

GVec.GVec ( double  theXv,
double  theYv,
double  theZv 
)

Creates a point with its three cartesian coordinates.

◆ GVec() [5/5]

GVec.GVec ( GPnt  theP1,
GPnt  theP2 
)

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

成员函数说明

◆ Add()

void GVec.Add ( GVec  theOther)

Adds two vectors

◆ Added()

GVec GVec.Added ( GVec  theOther)

Adds two vectors

◆ Angle()

double GVec.Angle ( GVec  theOther)

Computes the angular value between <me> and <theOther> Returns the angle value between 0 and PI in radian. 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.

◆ AngleWithRef()

double GVec.AngleWithRef ( GVec  theOther,
GVec  theVRef 
)

Computes the angle, in radians, between this vector and vector theOther. The result is a value between -Pi and Pi. For this, theVRef defines the positive sense of rotation: the angular value is positive, if the cross product this ^ theOther has the same orientation as theVRef relative to the plane defined by the vectors this and theOther. Otherwise, the angular value is negative. Exceptions gp_VectorWithNullMagnitude if the magnitude of this vector, the vector theOther, or the vector theVRef is less than or equal to gp::Resolution(). Standard_DomainError if this vector, the vector theOther, and the vector theVRef are coplanar, unless this vector and the vector theOther are parallel.

◆ Coord() [1/2]

void GVec.Coord ( double[]  theXv,
double[]  theYv,
double[]  theZv 
)

For this vector returns its three coordinates theXv, theYv, and theZv inline

◆ Coord() [2/2]

double GVec.Coord ( int  theIndex)

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

◆ Cross()

void GVec.Cross ( GVec  theRight)

computes the cross product between two vectors

◆ CrossCross()

void GVec.CrossCross ( GVec  theV1,
GVec  theV2 
)

Computes the triple vector product. <me> ^= (theV1 ^ theV2)

◆ CrossCrossed()

GVec GVec.CrossCrossed ( GVec  theV1,
GVec  theV2 
)

Computes the triple vector product. <me> ^ (theV1 ^ theV2)

◆ Crossed()

GVec GVec.Crossed ( GVec  theRight)

computes the cross product between two vectors

◆ CrossMagnitude()

double GVec.CrossMagnitude ( GVec  theRight)

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

◆ CrossSquareMagnitude()

double GVec.CrossSquareMagnitude ( GVec  theRight)

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

◆ Divide()

void GVec.Divide ( double  theScalar)

Divides a vector by a scalar

◆ Divided()

GVec GVec.Divided ( double  theScalar)

Divides a vector by a scalar

◆ Dot()

double GVec.Dot ( GVec  theOther)

computes the scalar product

◆ DotCross()

double GVec.DotCross ( GVec  theV1,
GVec  theV2 
)

Computes the triple scalar product <me> * (theV1 ^ theV2).

◆ IsEqual()

boolean GVec.IsEqual ( GVec  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 GVec.IsNormal ( GVec  theOther,
double  theAngularTolerance 
)

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

◆ IsOpposite()

boolean GVec.IsOpposite ( GVec  theOther,
double  theAngularTolerance 
)

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

◆ IsParallel()

boolean GVec.IsParallel ( GVec  theOther,
double  theAngularTolerance 
)

Returns True if Angle(<me>, theOther) <= theAngularTolerance or PI - Angle(<me>, theOther) <= theAngularTolerance This definition means that two parallel vectors cannot define a plane but two vectors with opposite directions are considered as parallel. Raises VectorWithNullMagnitude if <me>.Magnitude() <= Resolution or Other.Magnitude() <= Resolution from gp

◆ Magnitude()

double GVec.Magnitude ( )

Computes the magnitude of this vector.

◆ Mirrored() [1/3]

GVec GVec.Mirrored ( GAx1  theA1)

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

◆ Mirrored() [2/3]

GVec GVec.Mirrored ( GAx2  theA2)

Performs the symmetrical transformation of a vector with respect to a plane. The axis placement theA2 locates the plane of the symmetry : (Location, XDirection, YDirection).

◆ Mirrored() [3/3]

GVec GVec.Mirrored ( GVec  theV)

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

◆ Multiplied()

GVec GVec.Multiplied ( double  theScalar)

Multiplies a vector by a scalar

◆ Multiply()

void GVec.Multiply ( double  theScalar)

Multiplies a vector by a scalar

◆ Normalize()

void GVec.Normalize ( )

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

◆ Normalized()

GVec GVec.Normalized ( )

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

◆ Reverse()

void GVec.Reverse ( )

Reverses the direction of a vector

◆ Reversed()

GVec GVec.Reversed ( )

Reverses the direction of a vector

◆ Rotated()

GVec GVec.Rotated ( GAx1  theA1,
double  theAng 
)

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

◆ Scaled()

GVec GVec.Scaled ( double  theS)

Scales a vector. theS is the scaling value.

◆ SetCoord() [1/2]

void GVec.SetCoord ( double  theXv,
double  theYv,
double  theZv 
)

For this vector, assigns - the values theXv, theYv and theZv to its three coordinates.

◆ SetCoord() [2/2]

void GVec.SetCoord ( int  theIndex,
double  theXi 
)

Changes the coordinate of range theIndex theIndex = 1 => X is modified theIndex = 2 => Y is modified theIndex = 3 => Z is modified Raised if theIndex != {1, 2, 3}.

◆ SetLinearForm() [1/6]

void GVec.SetLinearForm ( double  theA1,
GVec  theV1,
double  theA2,
GVec  theV2 
)

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

◆ SetLinearForm() [2/6]

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

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

◆ SetLinearForm() [3/6]

void GVec.SetLinearForm ( double  theA1,
GVec  theV1,
double  theA2,
GVec  theV2,
double  theA3,
GVec  theV3,
GVec  theV4 
)

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

◆ SetLinearForm() [4/6]

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

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

◆ SetLinearForm() [5/6]

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

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

◆ SetLinearForm() [6/6]

void GVec.SetLinearForm ( GVec  theV1,
GVec  theV2 
)

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

◆ SetX()

void GVec.SetX ( double  theX)

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

◆ SetXYZ()

void GVec.SetXYZ ( GXYZ  theCoord)

Assigns the three coordinates of theCoord to this vector.

◆ SetY()

void GVec.SetY ( double  theY)

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

◆ SetZ()

void GVec.SetZ ( double  theZ)

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

◆ SquareMagnitude()

double GVec.SquareMagnitude ( )

Computes the square magnitude of this vector.

◆ Subtract()

void GVec.Subtract ( GVec  theRight)

Subtracts two vectors

◆ Subtracted()

GVec GVec.Subtracted ( GVec  theRight)

Subtracts two vectors

◆ Transform()

void GVec.Transform ( GTrsf  theT)

Transforms a vector with the transformation theT.

◆ Transformed()

GVec GVec.Transformed ( GTrsf  theT)

Transforms a vector with the transformation theT.

◆ X()

double GVec.X ( )

For this vector, returns its X coordinate.

◆ XYZ()

GXYZ GVec.XYZ ( )

For this vector, returns - its three coordinates as a number triple

◆ Y()

double GVec.Y ( )

For this vector, returns its Y coordinate.

◆ Z()

double GVec.Z ( )

For this vector, returns its Z coordinate.