Skip to content

[mxcad_3d API Document](../README. md)/Mx3dGeDir

Class: Mx3dGeDir ​

The vector representing direction always has a modulus of 1

Hierarchy ​

Table of contents ​

Constructors ​

Methods ​

Constructors ​

constructor ​

• new Mx3dGeDir()

Constructor function

Overrides ​

Mx3dGeObject.constructor

• new Mx3dGeDir(theXv, theYv, theZv)

Constructor function

Parameters ​

NameTypeDescription
TheXvnumberX direction
TheYvnumberY direction
TheZvnumberZ direction

Overrides ​

Mx3dGeObject.constructor

Methods ​

Angle ​

▸ Angle(theOther): number

Obtain the angle with another direction, range [0, PI]

Parameters ​

NameTypeDescription
TheOther[Mx3dGeDir] (Mx3dGeDir. md)Another direction

Returns ​

number

included angle


AngleWithRef ​

▸ AngleWithRef(theOther, theVRef): number

Parameters ​

NameType
theOtherMx3dGeDir
theVRefMx3dGeDir

Returns ​

number


Cross ​

▸ Cross(theRight): void

[me]=[me] ^ theRight, [me] represents self, ^ represents cross product

Parameters ​

NameTypeDescription
TheRight[Mx3dGeDir] (Mx3dGeDir. md)Another direction vector

Returns ​

void


CrossCross ​

▸ CrossCross(theV1, theV2): void

[me] ^ (theV1 ^ theV2), [me] represents self, ^ represents cross product

Parameters ​

NameTypeDescription
TheV1[Mx3dGeDir] (Mx3dGeDir. md)Another direction vector
TheV2[Mx3dGeDir] (Mx3dGeDir. md)Another direction vector

Returns ​

void


CrossCrossed ​

▸ CrossCrossed(theV1, theV2): Mx3dGeDir

[res] ^ (theV1 ^ theV2), [me] represents self, [res] represents result, ^ represents cross product

Parameters ​

NameTypeDescription
TheV1[Mx3dGeDir] (Mx3dGeDir. md)Another direction vector
TheV2[Mx3dGeDir] (Mx3dGeDir. md)Another direction vector

Returns ​

Mx3dGeDir

Cross product result


Crossed ​

▸ Crossed(theRight): Mx3dGeDir

[res]=[me] ^ theRight, [me] represents self, [res] represents result, ^ represents cross product

Parameters ​

NameTypeDescription
TheRight[Mx3dGeDir] (Mx3dGeDir. md)Another direction vector

Returns ​

Mx3dGeDir

Cross product result


Dot ​

▸ Dot(theOther): number

[res]=[me] * theOther, [me] represents self, [res] represents result, * represents dot multiplication

Parameters ​

NameTypeDescription
TheOther[Mx3dGeDir] (Mx3dGeDir. md)Another direction vector

Returns ​

number

Point multiplication result


DotCross ​

▸ DotCross(theV1, theV2): number

[res]=[me] * (theV1 ^ theV2), [me] represents self, [res] represents result, ^ represents cross product, * represents dot product

Parameters ​

NameTypeDescription
TheV1[Mx3dGeDir] (Mx3dGeDir. md)Another direction vector
TheV2[Mx3dGeDir] (Mx3dGeDir. md)Another direction vector

Returns ​

number

Final multiplication result


IsEqual ​

▸ IsEqual(theOther, theAngularTolerance): boolean

Determine if it is equal to another direction

Parameters ​

NameTypeDescription
TheOther[Mx3dGeDir] (Mx3dGeDir. md)Another direction
The Angular ToleranceNumberAngle Accuracy

Returns ​

boolean

Is it in the same direction


IsNormal ​

▸ IsNormal(theOther, theAngularTolerance): boolean

Determine if it is perpendicular to another direction

Parameters ​

NameTypeDescription
TheOther[Mx3dGeDir] (Mx3dGeDir. md)Another direction
The Angular ToleranceNumberAngle Accuracy

Returns ​

boolean

Is it vertical


IsOpposite ​

▸ IsOpposite(theOther, theAngularTolerance): boolean

Determine if it is in the opposite direction to another direction

Parameters ​

NameTypeDescription
TheOther[Mx3dGeDir] (Mx3dGeDir. md)Another direction
The Angular ToleranceNumberAngle Accuracy

Returns ​

boolean

Is it the opposite


IsParallel ​

▸ IsParallel(theOther, theAngularTolerance): boolean

Determine whether it is parallel to another direction (parallel in either the same or opposite direction)

Parameters ​

NameTypeDescription
TheOther[Mx3dGeDir] (Mx3dGeDir. md)Another direction
The Angular ToleranceNumberAngle Accuracy

Returns ​

boolean

Is it parallel


MirrorByAxis ​

▸ MirrorByAxis(theA1): void

Parameters ​

NameType
theA1Mx3dGeAxis

Returns ​

void


MirrorByCSYSR ​

▸ MirrorByCSYSR(theA2): void

Parameters ​

NameType
theA2Mx3dGeCSYSR

Returns ​

void


MirrorByVec ​

▸ MirrorByVec(theV): void

Mirror according to a vector in the direction of the mirror center

Parameters ​

NameTypeDescription
TheV[Mx3dGeDir] (Mx3dGeDir. md)Mirror center direction

Returns ​

void


MirroredByAxis ​

▸ MirroredByAxis(theA1): Mx3dGeDir

Parameters ​

NameType
theA1Mx3dGeAxis

Returns ​

Mx3dGeDir


MirroredByCSYSR ​

▸ MirroredByCSYSR(theA2): Mx3dGeDir

Parameters ​

NameType
theA2Mx3dGeCSYSR

Returns ​

Mx3dGeDir


MirroredByVec ​

▸ MirroredByVec(theV): Mx3dGeDir

Parameters ​

NameType
theVMx3dGeDir

Returns ​

Mx3dGeDir


Reverse ​

▸ Reverse(): void

Flip direction

Returns ​

void


Reversed ​

▸ Reversed(): Mx3dGeDir

Obtain the result after flipping direction

Returns ​

Mx3dGeDir

The result after flipping the direction


Rotate ​

▸ Rotate(theA1, theAng): void

Parameters ​

NameType
theA1Mx3dGeAxis
theAngnumber

Returns ​

void


Rotated ​

▸ Rotated(theA1, theAng): Mx3dGeDir

Parameters ​

NameType
theA1Mx3dGeAxis
theAngnumber

Returns ​

Mx3dGeDir


SetX ​

▸ SetX(theX): void

Set the size in the X direction

Parameters ​

NameTypeDescription
TheXNumberSize in the X direction

Returns ​

void


SetXYZ ​

▸ SetXYZ(theXv, theYv, theZv): void

Set the size in the X, Y, Z directions

Parameters ​

NameTypeDescription
TheXvNumberSize in the X direction
TheYvNumberSize in the Y direction
TheZvNumberSize in the Z direction

Returns ​

void


SetY ​

▸ SetY(theY): void

Set the size in the Y direction

Parameters ​

NameTypeDescription
TheYNumberSize in the Y direction

Returns ​

void


SetZ ​

▸ SetZ(theZ): void

Set the size in the Z direction

Parameters ​

NameTypeDescription
TheZNumberSize in the Z direction

Returns ​

void


Transform ​

▸ Transform(theT): void

Parameters ​

NameType
theTMx3dGeTrsf

Returns ​

void


Transformed ​

▸ Transformed(theT): Mx3dGeDir

Parameters ​

NameType
theTMx3dGeTrsf

Returns ​

Mx3dGeDir


X ​

▸ X(): number

Obtain the size in the X direction

Returns ​

number

The size in the X direction


Y ​

▸ Y(): number

Obtain the size in the Y direction

Returns ​

number

The size in the Y direction


Z ​

▸ Z(): number

Obtain the size in the Z direction

Returns ​

number

The size in the Z direction