AnyCAD Rapid SDK  2020
The Rapid CAD SDK
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
GVec2d Class Reference

Public Member Functions

synchronized void delete ()
 
 GVec2d ()
 
 GVec2d (GDir2d V)
 
 GVec2d (GXY Coord)
 
 GVec2d (double Xv, double Yv)
 
 GVec2d (GPnt2d P1, GPnt2d P2)
 
void SetCoord (int Index, double Xi)
 
void SetCoord (double Xv, double Yv)
 
void SetX (double X)
 
void SetY (double Y)
 
void SetXY (GXY Coord)
 
double Coord (int Index)
 
void Coord (double[] Xv, double[] Yv)
 
double X ()
 
double Y ()
 
GXY XY ()
 
boolean IsEqual (GVec2d Other, double LinearTolerance, double AngularTolerance)
 
boolean IsNormal (GVec2d Other, double AngularTolerance)
 
boolean IsOpposite (GVec2d Other, double AngularTolerance)
 
boolean IsParallel (GVec2d Other, double AngularTolerance)
 
double Angle (GVec2d Other)
 
double Magnitude ()
 
double SquareMagnitude ()
 
void Add (GVec2d Other)
 
GVec2d Added (GVec2d Other)
 
double Crossed (GVec2d Right)
 
double CrossMagnitude (GVec2d Right)
 
double CrossSquareMagnitude (GVec2d Right)
 
void Divide (double Scalar)
 
GVec2d Divided (double Scalar)
 
double Dot (GVec2d Other)
 
GVec2d GetNormal ()
 
void Multiply (double Scalar)
 
GVec2d Multiplied (double Scalar)
 
void Normalize ()
 
GVec2d Normalized ()
 
void Reverse ()
 
GVec2d Reversed ()
 
void Subtract (GVec2d Right)
 
GVec2d Subtracted (GVec2d Right)
 
void SetLinearForm (double A1, GVec2d V1, double A2, GVec2d V2, GVec2d V3)
 
void SetLinearForm (double A1, GVec2d V1, double A2, GVec2d V2)
 
void SetLinearForm (double A1, GVec2d V1, GVec2d V2)
 
void SetLinearForm (GVec2d Left, GVec2d Right)
 
void Mirror (GVec2d V)
 
GVec2d Mirrored (GVec2d V)
 
void Mirror (GAx2d A1)
 
GVec2d Mirrored (GAx2d A1)
 
void Rotate (double Ang)
 
GVec2d Rotated (double Ang)
 
void Scale (double S)
 
GVec2d Scaled (double S)
 
void Transform (GTrsf2d T)
 
GVec2d Transformed (GTrsf2d T)
 

Protected Member Functions

 GVec2d (long cPtr, boolean cMemoryOwn)
 
void finalize ()
 

Static Protected Member Functions

static long getCPtr (GVec2d obj)
 

Protected Attributes

transient boolean swigCMemOwn
 

Detailed Description

Defines a non-persistent vector in 2D space.

Constructor & Destructor Documentation

GVec2d.GVec2d ( )

Creates a zero vector.

GVec2d.GVec2d ( GDir2d  V)

Creates a unitary vector from a direction V.

GVec2d.GVec2d ( GXY  Coord)

Creates a vector with a doublet of coordinates.

GVec2d.GVec2d ( double  Xv,
double  Yv 
)

Creates a point with its two Cartesian coordinates.

GVec2d.GVec2d ( GPnt2d  P1,
GPnt2d  P2 
)

Creates a vector from two points. The length of the vector is the distance between P1 and P2

Member Function Documentation

GVec2d GVec2d.Added ( GVec2d  Other)

Adds two vectors

double GVec2d.Angle ( GVec2d  Other)

Computes the angular value between <me> and <Other> returns the angle value between -PI and PI in radian. The orientation is from <me> to Other. The positive sense is the trigonometric sense. Raises VectorWithNullMagnitude if <me>.Magnitude() <= Resolution from gp or Other.Magnitude() <= Resolution because the angular value is indefinite if one of the vectors has a null magnitude.

double GVec2d.Coord ( int  Index)

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

void GVec2d.Coord ( double[]  Xv,
double[]  Yv 
)

For this vector, returns its two coordinates Xv and Yv

double GVec2d.Crossed ( GVec2d  Right)

Computes the crossing product between two vectors

double GVec2d.CrossMagnitude ( GVec2d  Right)

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

double GVec2d.CrossSquareMagnitude ( GVec2d  Right)

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

GVec2d GVec2d.Divided ( double  Scalar)

divides a vector by a scalar

double GVec2d.Dot ( GVec2d  Other)

Computes the scalar product

boolean GVec2d.IsEqual ( GVec2d  Other,
double  LinearTolerance,
double  AngularTolerance 
)

Returns True if the two vectors have the same magnitude value and the same direction. The precision values are LinearTolerance for the magnitude and AngularTolerance for the direction.

boolean GVec2d.IsNormal ( GVec2d  Other,
double  AngularTolerance 
)

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

boolean GVec2d.IsOpposite ( GVec2d  Other,
double  AngularTolerance 
)

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

boolean GVec2d.IsParallel ( GVec2d  Other,
double  AngularTolerance 
)

Returns true if Abs(Angle(<me>, Other)) <= AngularTolerance or PI - Abs(Angle(<me>, Other)) <= AngularTolerance Two vectors with opposite directions are considered as parallel. Raises VectorWithNullMagnitude if <me>.Magnitude() <= Resolution or Other.Magnitude() <= Resolution from gp

double GVec2d.Magnitude ( )

Computes the magnitude of this vector.

void GVec2d.Mirror ( GVec2d  V)

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

void GVec2d.Mirror ( GAx2d  A1)

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

GVec2d GVec2d.Mirrored ( GVec2d  V)

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

GVec2d GVec2d.Mirrored ( GAx2d  A1)

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

GVec2d GVec2d.Multiplied ( double  Scalar)

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  Ang)

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

GVec2d GVec2d.Scaled ( double  S)

Scales a vector. S is the scaling value.

void GVec2d.SetCoord ( int  Index,
double  Xi 
)

Changes the coordinate of range Index Index = 1 => X is modified Index = 2 => Y is modified Raises OutOfRange if Index != {1, 2}.

void GVec2d.SetCoord ( double  Xv,
double  Yv 
)

For this vector, assigns the values Xv and Yv to its two coordinates

void GVec2d.SetLinearForm ( double  A1,
GVec2d  V1,
double  A2,
GVec2d  V2,
GVec2d  V3 
)

<me> is set to the following linear form : A1 * V1 + A2 * V2 + V3

void GVec2d.SetLinearForm ( double  A1,
GVec2d  V1,
double  A2,
GVec2d  V2 
)

<me> is set to the following linear form : A1 * V1 + A2 * V2

void GVec2d.SetLinearForm ( double  A1,
GVec2d  V1,
GVec2d  V2 
)

<me> is set to the following linear form : A1 * V1 + V2

void GVec2d.SetLinearForm ( GVec2d  Left,
GVec2d  Right 
)

<me> is set to the following linear form : Left + Right

void GVec2d.SetX ( double  X)

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

void GVec2d.SetXY ( GXY  Coord)

Assigns the two coordinates of Coord to this vector.

void GVec2d.SetY ( double  Y)

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  Right)

Subtracts two vectors

GVec2d GVec2d.Subtracted ( GVec2d  Right)

Subtracts two vectors

GVec2d GVec2d.Transformed ( GTrsf2d  T)

Transforms a vector with a Trsf from gp.

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.