Skip to content
On this page

mxcad API 文档 / McGeVector3d

Class: McGeVector3d

表示三维向量的对象。

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new McGeVector3d(dX?, dY?, dZ?)

构造函数。

Parameters

NameTypeDescription
dX?number | objectX 坐标。
dY?numberY 坐标。
dZ?numberZ 坐标。

Properties

imp

imp: any


kNegateZAxis

Static kNegateZAxis: McGeVector3d

取反z轴


kXAxis

Static kXAxis: McGeVector3d

X轴


kYAxis

Static kYAxis: McGeVector3d

Y轴


kZAxis

Static kZAxis: McGeVector3d

Z轴

Accessors

x

get x(): number

X 坐标。

Returns

number

set x(val): void

Parameters

NameType
valnumber

Returns

void


y

get y(): number

Y 坐标。

Returns

number

set y(val): void

Parameters

NameType
valnumber

Returns

void


z

get z(): number

Z 坐标。

Returns

number

set z(val): void

Parameters

NameType
valnumber

Returns

void

Methods

angleTo1

angleTo1(vec): number

计算角度

Parameters

NameType
vecMcGeVector3d

Returns

number


angleTo2

angleTo2(vec, refVec?): number

计算角度

Parameters

NameType
vecMcGeVector3d
refVec?McGeVector3d

Returns

number


c

c(): McGeVector3d

Returns

McGeVector3d


clone

clone(): McGeVector3d

刻隆一个对对象

Returns

McGeVector3d


copy

copy(val): McGeVector3d

复制对象的值

Parameters

NameType
valMcGeVector3d

Returns

McGeVector3d


crossProduct

crossProduct(vec): McGeVector3d

交叉积

Parameters

NameType
vecMcGeVector3d

Returns

McGeVector3d


dotProduct

dotProduct(vec): number

点积

Parameters

NameType
vecMcGeVector3d

Returns

number


isEqualTo

isEqualTo(vec): boolean

判断比较向量是否相等

Parameters

NameType
vecMcGeVector3d

Returns

boolean


isUnitLength

isUnitLength(): boolean

是否为单位向量

Returns

boolean


isZeroLength

isZeroLength(): boolean

是否为零向量

Returns

boolean


length

length(): number

向量长度

Returns

number


mult

mult(val): McGeVector3d

向量与某个值相乘

Parameters

NameType
valnumber

Returns

McGeVector3d


negate

negate(): McGeVector3d

向量取反

Returns

McGeVector3d


normalize

normalize(): McGeVector3d

归一化操作

Returns

McGeVector3d


perpVector

perpVector(): McGeVector3d

垂直的向量

Returns

McGeVector3d


rotateBy

rotateBy(ang, axis?): McGeVector3d

旋转

Parameters

NameTypeDescription
angnumber旋转角度。
axis?McGeVector3d旋转轴向量

Returns

McGeVector3d


toVector3

toVector3(): Vector3

转换为THREE.Vector3

Returns

Vector3