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

Defines a non-persistent vector in 2D space. 更多...

类 AnyCAD.Foundation.GVec2d 继承关系图:

Public 成员函数

 GVec2d (global::System.IntPtr cPtr, bool cMemoryOwn)
 仅供内部使用
 
void Dispose ()
 
 GVec2d ()
 Creates a zero vector.
 
 GVec2d (GDir2d theV)
 Creates a unitary vector from a direction theV.
 
 GVec2d (GXY theCoord)
 Creates a vector with a doublet of coordinates.
 
 GVec2d (double theXv, double theYv)
 Creates a point with its two Cartesian coordinates.
 
 GVec2d (GPnt2d theP1, GPnt2d theP2)
 Creates a vector from two points. The length of the vector is the distance between theP1 and theP2
 
void 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}.
 
void SetCoord (double theXv, double theYv)
 For this vector, assigns the values theXv and theYv to its two coordinates
 
void SetX (double theX)
 Assigns the given value to the X coordinate of this vector.
 
void SetY (double theY)
 Assigns the given value to the Y coordinate of this vector.
 
void SetXY (GXY theCoord)
 Assigns the two coordinates of theCoord to this vector.
 
double Coord (int theIndex)
 Returns the coordinate of range theIndex : theIndex = 1 => X is returned theIndex = 2 => Y is returned Raised if theIndex != {1, 2}.
 
void Coord (ref double theXv, ref double theYv)
 For this vector, returns its two coordinates theXv and theYv
 
double X ()
 For this vector, returns its X coordinate.
 
double Y ()
 For this vector, returns its Y coordinate.
 
GXY XY ()
 For this vector, returns its two coordinates as a number pair
 
bool 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.
 
bool 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.
 
bool 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.
 
bool 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 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.
 
double Magnitude ()
 Computes the magnitude of this vector.
 
double SquareMagnitude ()
 Computes the square magnitude of this vector.
 
void Add (GVec2d theOther)
 
GVec2d Added (GVec2d theOther)
 Adds two vectors
 
double Crossed (GVec2d theRight)
 Computes the crossing product between two vectors
 
double CrossMagnitude (GVec2d theRight)
 Computes the magnitude of the cross product between <me> and theRight. Returns || <me> ^ theRight ||
 
double CrossSquareMagnitude (GVec2d theRight)
 Computes the square magnitude of the cross product between <me> and theRight. Returns || <me> ^ theRight ||**2
 
void Divide (double theScalar)
 
GVec2d Divided (double theScalar)
 divides a vector by a scalar
 
double Dot (GVec2d theOther)
 Computes the scalar product
 
GVec2d GetNormal ()
 
void Multiply (double theScalar)
 
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.
 
void Normalize ()
 
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
 
void Reverse ()
 
GVec2d Reversed ()
 Reverses the direction of a vector
 
void Subtract (GVec2d theRight)
 Subtracts two vectors
 
GVec2d Subtracted (GVec2d theRight)
 Subtracts two vectors
 
void SetLinearForm (double theA1, GVec2d theV1, double theA2, GVec2d theV2, GVec2d theV3)
 <me> is set to the following linear form : theA1 * theV1 + theA2 * theV2 + theV3
 
void SetLinearForm (double theA1, GVec2d theV1, double theA2, GVec2d theV2)
 <me> is set to the following linear form : theA1 * theV1 + theA2 * theV2
 
void SetLinearForm (double theA1, GVec2d theV1, GVec2d theV2)
 <me> is set to the following linear form : theA1 * theV1 + theV2
 
void SetLinearForm (GVec2d theV1, GVec2d theV2)
 <me> is set to the following linear form : theV1 + theV2
 
void Mirror (GVec2d theV)
 Performs the symmetrical transformation of a vector with respect to the vector theV which is the center of the symmetry.
 
GVec2d Mirrored (GVec2d theV)
 Performs the symmetrical transformation of a vector with respect to the vector theV which is the center of the symmetry.
 
void Mirror (GAx2d theA1)
 Performs the symmetrical transformation of a vector with respect to an axis placement which is the axis of the symmetry.
 
GVec2d Mirrored (GAx2d theA1)
 Performs the symmetrical transformation of a vector with respect to an axis placement which is the axis of the symmetry.
 
void Rotate (double theAng)
 
GVec2d Rotated (double theAng)
 Rotates a vector. theAng is the angular value of the rotation in radians.
 
void Scale (double theS)
 
GVec2d Scaled (double theS)
 Scales a vector. theS is the scaling value.
 
void Transform (GTrsf2d theT)
 
GVec2d Transformed (GTrsf2d theT)
 Transforms a vector with a Trsf from gp.
 
override bool Equals (object obj)
 判断是否相等
 
override int GetHashCode ()
 返回对象的哈希值
 
override string ToString ()
 转换成字符串
 

属性

double x [get, set]
 
double y [get, set]
 

详细描述

Defines a non-persistent vector in 2D space.

2D向量

成员函数说明

◆ Equals()

override bool AnyCAD.Foundation.GVec2d.Equals ( object obj)

判断是否相等

参数
obj比较的对象
返回
true相等

◆ GetHashCode()

override int AnyCAD.Foundation.GVec2d.GetHashCode ( )

返回对象的哈希值

返回
哈希值

◆ ToString()

override string AnyCAD.Foundation.GVec2d.ToString ( )

转换成字符串

返回
字符串