KPoint3d 接口
export interface KPoint3d 
KPoint3d类代表一个三维点。 三维点有三个坐标。 三维点的坐标是不可变的。
The KPoint3d class represents a 3D point. A 3D point is an ordered triplet of numbers (labeled x, y, and z). NOTE: KPoint3d's x, y and z are immutable.
属性
x
readonly x: number;
获得x坐标。
Get point's x value.
y
readonly y: number;
获得y坐标。
Get point's y value.
z
readonly z: number;
获得z坐标。
Get point's z value.
方法
added
added(vector: KVector3d): KPoint3d;
对当前点应用一向量,实现对点的平移。
Return a new KPoint3d which is this point add the input vector.
参数:
- 
vector: KVector3d要平移的向量。 The vector to add. 
返回值: KPoint3d
新的点。
The new point.
appliedMatrix4
appliedMatrix4(matrix: KMatrix4): KPoint3d;
通过一个矩阵对当前点进行变换,获得一新点。
Return a new KPoint3d which is the result of this point transformed by the input matrix.
参数:
- 
matrix: KMatrix4传入变换矩阵。 the input transform matrix. 
返回值: KPoint3d
新点。
The new point.
clone
clone(): KPoint3d;
复制一个当前点。
Return the cloned point of this.
返回值: KPoint3d
复制点。
The cloned point.
distanceTo
distanceTo(other: KPoint3d): number;
求当前点到另一个点的距离。
Get the distance to another point.
参数:
- 
other: KPoint3d另外一个点。 The other point. 
返回值: number
两点之间距离。
The distance between the two points.
isEqual
isEqual(other: KPoint3d, tolerance?: number): boolean;
检查两个点在特定容差下是否相等。
Check whether two points are equal with specified tolerance.
参数:
- 
other: KPoint3d需要比较的点。 The point to compare this point with. 
- 
tolerance: number指定容差,默认值为1e-6。 The specified tolerance.The default value is 1e-6. 
返回值: boolean
如果相等则返回true。
Return true if equal, otherwise return false.
squaredDistanceTo
squaredDistanceTo(other: KPoint3d): number;
求当前点到另一个点的平方距离。
Get the distance to another point.
参数:
- 
other: KPoint3d另外一个点。 The other point. 
返回值: number
两 点之间平方距离。
The square distance between the two points.
subtracted
subtracted(point: KPoint3d): KVector3d;
获得由目标点指向当前点的向量。
Return a new KVector3d which is this point subtract another point.
参数:
- 
point: KPoint3d要减的点。 The point to subtract. 
返回值: KVector3d
新的向量。
The new vector.