[mxcad_3d API Document](../README. md)/Mx3dGeDir
Class: Mx3dGeDir
The vector representing direction always has a modulus of 1
Hierarchy
↳
Mx3dGeDir
Table of contents
Constructors
Methods
- Angle
- AngleWithRef
- Cross
- CrossCross
- CrossCrossed
- Crossed
- Dot
- DotCross
- IsEqual
- IsNormal
- IsOpposite
- IsParallel
- MirrorByAxis
- MirrorByCSYSR
- MirrorByVec
- MirroredByAxis
- MirroredByCSYSR
- MirroredByVec
- Reverse
- Reversed
- Rotate
- Rotated
- SetX
- SetXYZ
- SetY
- SetZ
- Transform
- Transformed
- X
- Y
- Z
Constructors
constructor
• new Mx3dGeDir()
Constructor function
Overrides
Mx3dGeObject.constructor
• new Mx3dGeDir(theXv, theYv, theZv)
Constructor function
Parameters
| Name | Type | Description |
|---|---|---|
| TheXv | number | X direction |
| TheYv | number | Y direction |
| TheZv | number | Z direction |
Overrides
Mx3dGeObject.constructor
Methods
Angle
▸ Angle(theOther): number
Obtain the angle with another direction, range [0, PI]
Parameters
| Name | Type | Description |
|---|---|---|
| TheOther | [Mx3dGeDir] (Mx3dGeDir. md) | Another direction |
Returns
number
included angle
AngleWithRef
▸ AngleWithRef(theOther, theVRef): number
Parameters
| Name | Type |
|---|---|
theOther | Mx3dGeDir |
theVRef | Mx3dGeDir |
Returns
number
Cross
▸ Cross(theRight): void
[me]=[me] ^ theRight, [me] represents self, ^ represents cross product
Parameters
| Name | Type | Description |
|---|---|---|
| TheRight | [Mx3dGeDir] (Mx3dGeDir. md) | Another direction vector |
Returns
void
CrossCross
▸ CrossCross(theV1, theV2): void
[me] ^ (theV1 ^ theV2), [me] represents self, ^ represents cross product
Parameters
| Name | Type | Description |
|---|---|---|
| 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
| Name | Type | Description |
|---|---|---|
| TheV1 | [Mx3dGeDir] (Mx3dGeDir. md) | Another direction vector |
| TheV2 | [Mx3dGeDir] (Mx3dGeDir. md) | Another direction vector |
Returns
Cross product result
Crossed
▸ Crossed(theRight): Mx3dGeDir
[res]=[me] ^ theRight, [me] represents self, [res] represents result, ^ represents cross product
Parameters
| Name | Type | Description |
|---|---|---|
| TheRight | [Mx3dGeDir] (Mx3dGeDir. md) | Another direction vector |
Returns
Cross product result
Dot
▸ Dot(theOther): number
[res]=[me] * theOther, [me] represents self, [res] represents result, * represents dot multiplication
Parameters
| Name | Type | Description |
|---|---|---|
| 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
| Name | Type | Description |
|---|---|---|
| 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
| Name | Type | Description |
|---|---|---|
| TheOther | [Mx3dGeDir] (Mx3dGeDir. md) | Another direction |
| The Angular Tolerance | Number | Angle Accuracy |
Returns
boolean
Is it in the same direction
IsNormal
▸ IsNormal(theOther, theAngularTolerance): boolean
Determine if it is perpendicular to another direction
Parameters
| Name | Type | Description |
|---|---|---|
| TheOther | [Mx3dGeDir] (Mx3dGeDir. md) | Another direction |
| The Angular Tolerance | Number | Angle Accuracy |
Returns
boolean
Is it vertical
IsOpposite
▸ IsOpposite(theOther, theAngularTolerance): boolean
Determine if it is in the opposite direction to another direction
Parameters
| Name | Type | Description |
|---|---|---|
| TheOther | [Mx3dGeDir] (Mx3dGeDir. md) | Another direction |
| The Angular Tolerance | Number | Angle 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
| Name | Type | Description |
|---|---|---|
| TheOther | [Mx3dGeDir] (Mx3dGeDir. md) | Another direction |
| The Angular Tolerance | Number | Angle Accuracy |
Returns
boolean
Is it parallel
MirrorByAxis
▸ MirrorByAxis(theA1): void
Parameters
| Name | Type |
|---|---|
theA1 | Mx3dGeAxis |
Returns
void
MirrorByCSYSR
▸ MirrorByCSYSR(theA2): void
Parameters
| Name | Type |
|---|---|
theA2 | Mx3dGeCSYSR |
Returns
void
MirrorByVec
▸ MirrorByVec(theV): void
Mirror according to a vector in the direction of the mirror center
Parameters
| Name | Type | Description |
|---|---|---|
| TheV | [Mx3dGeDir] (Mx3dGeDir. md) | Mirror center direction |
Returns
void
MirroredByAxis
▸ MirroredByAxis(theA1): Mx3dGeDir
Parameters
| Name | Type |
|---|---|
theA1 | Mx3dGeAxis |
Returns
MirroredByCSYSR
▸ MirroredByCSYSR(theA2): Mx3dGeDir
Parameters
| Name | Type |
|---|---|
theA2 | Mx3dGeCSYSR |
Returns
MirroredByVec
▸ MirroredByVec(theV): Mx3dGeDir
Parameters
| Name | Type |
|---|---|
theV | Mx3dGeDir |
Returns
Reverse
▸ Reverse(): void
Flip direction
Returns
void
Reversed
▸ Reversed(): Mx3dGeDir
Obtain the result after flipping direction
Returns
The result after flipping the direction
Rotate
▸ Rotate(theA1, theAng): void
Parameters
| Name | Type |
|---|---|
theA1 | Mx3dGeAxis |
theAng | number |
Returns
void
Rotated
▸ Rotated(theA1, theAng): Mx3dGeDir
Parameters
| Name | Type |
|---|---|
theA1 | Mx3dGeAxis |
theAng | number |
Returns
SetX
▸ SetX(theX): void
Set the size in the X direction
Parameters
| Name | Type | Description |
|---|---|---|
| TheX | Number | Size in the X direction |
Returns
void
SetXYZ
▸ SetXYZ(theXv, theYv, theZv): void
Set the size in the X, Y, Z directions
Parameters
| Name | Type | Description |
|---|---|---|
| TheXv | Number | Size in the X direction |
| TheYv | Number | Size in the Y direction |
| TheZv | Number | Size in the Z direction |
Returns
void
SetY
▸ SetY(theY): void
Set the size in the Y direction
Parameters
| Name | Type | Description |
|---|---|---|
| TheY | Number | Size in the Y direction |
Returns
void
SetZ
▸ SetZ(theZ): void
Set the size in the Z direction
Parameters
| Name | Type | Description |
|---|---|---|
| TheZ | Number | Size in the Z direction |
Returns
void
Transform
▸ Transform(theT): void
Parameters
| Name | Type |
|---|---|
theT | Mx3dGeTrsf |
Returns
void
Transformed
▸ Transformed(theT): Mx3dGeDir
Parameters
| Name | Type |
|---|---|
theT | Mx3dGeTrsf |
Returns
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