AnyCAD Rapid API 2023
Help you to create a better world!
|
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.GVec2d | ( | ) |
Creates a zero vector.
GVec2d.GVec2d | ( | GDir2d | theV | ) |
Creates a unitary vector from a direction theV.
GVec2d.GVec2d | ( | GXY | theCoord | ) |
Creates a vector with a doublet of coordinates.
GVec2d.GVec2d | ( | double | theXv, |
double | theYv | ||
) |
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
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.
void GVec2d.Coord | ( | double[] | theXv, |
double[] | theYv | ||
) |
For this vector, returns its two coordinates theXv and theYv
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}.
double GVec2d.Crossed | ( | GVec2d | theRight | ) |
Computes the crossing product between two vectors
double GVec2d.CrossMagnitude | ( | GVec2d | theRight | ) |
Computes the magnitude of the cross product between <me> and theRight. Returns || <me> ^ theRight ||
double GVec2d.CrossSquareMagnitude | ( | GVec2d | theRight | ) |
Computes the square magnitude of the cross product between <me> and theRight. Returns || <me> ^ theRight ||**2
GVec2d GVec2d.Divided | ( | double | theScalar | ) |
divides a vector by a scalar
double GVec2d.Dot | ( | GVec2d | theOther | ) |
Computes the scalar product
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.
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.
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.
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
double GVec2d.Magnitude | ( | ) |
Computes the magnitude of this vector.
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.
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.
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.
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.
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
GVec2d GVec2d.Reversed | ( | ) |
Reverses the direction of a vector
GVec2d GVec2d.Rotated | ( | double | theAng | ) |
Rotates a vector. theAng is the angular value of the rotation in radians.
GVec2d GVec2d.Scaled | ( | double | theS | ) |
Scales a vector. theS is the scaling value.
void GVec2d.SetCoord | ( | double | theXv, |
double | theYv | ||
) |
For this vector, assigns the values theXv and theYv to its two coordinates
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}.
<me> is set to the following linear form : theA1 * theV1 + theA2 * theV2
<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 GVec2d.SetX | ( | double | theX | ) |
Assigns the given value to the X coordinate of this vector.
void GVec2d.SetXY | ( | GXY | theCoord | ) |
Assigns the two coordinates of theCoord to this vector.
void GVec2d.SetY | ( | double | theY | ) |
Assigns the given value to the Y coordinate of this vector.
double GVec2d.SquareMagnitude | ( | ) |
Computes the square magnitude of this vector.
void GVec2d.Subtract | ( | GVec2d | theRight | ) |
Subtracts two vectors
double GVec2d.X | ( | ) |
For this vector, returns its X coordinate.
GXY GVec2d.XY | ( | ) |
For this vector, returns its two coordinates as a number pair
double GVec2d.Y | ( | ) |
For this vector, returns its Y coordinate.