AnyCAD Rapid API 2024
Help you to create a better world!
|
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.GVec | ( | ) |
Creates a zero vector.
GVec.GVec | ( | GDir | theV | ) |
Creates a unitary vector from a direction theV.
GVec.GVec | ( | GXYZ | theCoord | ) |
Creates a vector with a triplet of coordinates.
GVec.GVec | ( | double | theXv, |
double | theYv, | ||
double | theZv ) |
Creates a point with its three cartesian coordinates.
Creates a vector from two points. The length of the vector is the distance between theP1 and theP2
void GVec.Add | ( | GVec | theOther | ) |
Adds two vectors
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.
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.
void GVec.Coord | ( | double[] | theXv, |
double[] | theYv, | ||
double[] | theZv ) |
For this vector returns its three coordinates theXv, theYv, and theZv inline
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}.
void GVec.Cross | ( | GVec | theRight | ) |
computes the cross product between two vectors
Computes the triple vector product. <me> ^= (theV1 ^ theV2)
Computes the triple vector product. <me> ^ (theV1 ^ theV2)
double GVec.CrossMagnitude | ( | GVec | theRight | ) |
Computes the magnitude of the cross product between <me> and theRight. Returns || <me> ^ theRight ||
double GVec.CrossSquareMagnitude | ( | GVec | theRight | ) |
Computes the square magnitude of the cross product between <me> and theRight. Returns || <me> ^ theRight ||**2
void GVec.Divide | ( | double | theScalar | ) |
Divides a vector by a scalar
GVec GVec.Divided | ( | double | theScalar | ) |
Divides a vector by a scalar
double GVec.Dot | ( | GVec | theOther | ) |
computes the scalar product
Computes the triple scalar product <me> * (theV1 ^ theV2).
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.
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
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
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
double GVec.Magnitude | ( | ) |
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 a plane. The axis placement theA2 locates the plane of the symmetry : (Location, XDirection, YDirection).
Performs the symmetrical transformation of a vector with respect to the vector theV which is the center of the symmetry.
GVec GVec.Multiplied | ( | double | theScalar | ) |
Multiplies a vector by a scalar
void GVec.Multiply | ( | double | theScalar | ) |
Multiplies a vector by a scalar
void GVec.Normalize | ( | ) |
normalizes a vector Raises an exception if the magnitude of the vector is lower or equal to Resolution from gp.
GVec GVec.Normalized | ( | ) |
normalizes a vector Raises an exception if the magnitude of the vector is lower or equal to Resolution from gp.
void GVec.Reverse | ( | ) |
Reverses the direction of a vector
GVec GVec.Reversed | ( | ) |
Reverses the direction of a vector
Rotates a vector. theA1 is the axis of the rotation. theAng is the angular value of the rotation in radians.
GVec GVec.Scaled | ( | double | theS | ) |
Scales a vector. theS is the scaling value.
void GVec.SetCoord | ( | double | theXv, |
double | theYv, | ||
double | theZv ) |
For this vector, assigns - the values theXv, theYv and theZv to its three coordinates.
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}.
<me> is set to the following linear form : theA1 * theV1 + theA2 * theV2
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
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
<me> is set to the following linear form : theA1 * theV1 + theA2 * theV2 + theV3
<me> is set to the following linear form : theA1 * theV1 + theV2
<me> is set to the following linear form : theV1 + theV2
void GVec.SetX | ( | double | theX | ) |
Assigns the given value to the X coordinate of this vector.
void GVec.SetXYZ | ( | GXYZ | theCoord | ) |
Assigns the three coordinates of theCoord to this vector.
void GVec.SetY | ( | double | theY | ) |
Assigns the given value to the X coordinate of this vector.
void GVec.SetZ | ( | double | theZ | ) |
Assigns the given value to the X coordinate of this vector.
double GVec.SquareMagnitude | ( | ) |
Computes the square magnitude of this vector.
void GVec.Subtract | ( | GVec | theRight | ) |
Subtracts two vectors
void GVec.Transform | ( | GTrsf | theT | ) |
Transforms a vector with the transformation theT.
double GVec.X | ( | ) |
For this vector, returns its X coordinate.
GXYZ GVec.XYZ | ( | ) |
For this vector, returns - its three coordinates as a number triple
double GVec.Y | ( | ) |
For this vector, returns its Y coordinate.
double GVec.Z | ( | ) |
For this vector, returns its Z coordinate.