开源三维GIS之Cesium的Cartesian3(三)

最近正好要学习cesium的坐标系,于是学习了Cartesian3相关函数。这是部分结合自己的理解和cesium的源代码资料,翻译了过来。估计会存在一定错误,后面会根据实践做相应补充。也希望大家一起来共同学习。

函数

返回类型

说明

clone(result)

Cartesian3

复制坐标点

equals(right)

Boolean

判断与坐标点rigtht是否相等

equalsEpsilon(right,relativeEpsilon,

absoluteEpsilon)

Boolean

在容差范围内是否相等

toString()

String

将坐标点返回形如'(x, y, z)’

abs(cartesian, result)

Cartesian3

返回坐标值x、y、z的绝对值新坐标点。

add(left, right, result)

Cartesian3

返回由坐标点left、right的x、y、z分别相加组合的坐标点。

angleBetween(left, right)

Number

返回两个坐标点的角度

clone(cartesian, result)

Cartesian3

复制坐标点

cross(left, right, result)

Cartesian3

计算两个坐标点的交叉乘积

distance(left, right)

Number

计算两个坐标点的距离

distanceSquared(left, right)

Number

返回距离的平方

divideByScalar(cartesian, scalar, result)

Cartesian3

返回坐标值x、y,z除以scalar后重新组合的坐标。

divideComponents(left, right, result)

Cartesian3

返回left坐标x、y、z分别除以right坐标x、y、z后的重新组合的坐标

dot(left, right)

Number

返回left坐标x、y、z分别乘以right坐标x、y、z后的重新组合的坐标

equals(left, right)

Cartesian3

判断坐标点left、right是否相等。

fromArray(array, startingIndex, result)

Cartesian3

从数组中返回重新组合的坐标点

fromCartesian4(cartesian, result)

Cartesian3

从Cartesian4中转为Cartesian3坐标点

fromDegrees(longitude,latitude,

height,ellipsoid,result)

Cartesian3

从角度值组合坐标值,其中前三个参数分别为经度、纬度、高程。Ellipsoid为椭球类型,默认为wgs84

fromDegreesArray(coordinates,

ellipsoid,result)

Cartesian3

从给定的角度单位数组数组中组合坐标点

fromDegreesArrayHeights(coordinates,

ellipsoid,result)

 Array.<Cartesian3>

 

fromElements(x, y, z, result)

Cartesian3

指定x、y、z组合新的坐标点

fromRadians(longitude,latitude,

height,ellipsoid,result)

Cartesian3

从弧度值来创建坐标点

fromRadiansArray(coordinates,ellipsoid,

result)

Array.<Cartesian3>

由指定的弧度单位的经纬度组成坐标点并返回。

fromRadiansArrayHeights(coordinates,

ellipsoid,result)

 

 

fromSpherical(spherical, result)

 

 

lerp(start, end, t, result)

Cartesian3

用于坐标点start、end间的插值。

magnitude(cartesian)

Number

计算坐标点x、y、z平方之和计算坐标点x、y、z平方之和

magnitudeSquared(cartesian)

Number

计算坐标点x、y、z平方之和

maximumByComponent(first,second,

result)

Cartesian3

返回坐标first,second中最大的x、y、z组成的坐标result

maximumComponent(cartesian)

Number

返回坐标值最大值,要么是x、要么是y、要么是z

midpoint(left, right, result)

Cartesian3

返回坐标点left、right的中点。

minimumByComponent(first,second,result)

Cartesian3

返回坐标first,second中最小的x、y、z组成的坐标result

minimumComponent(cartesian)

Number

返回坐标值最小值,要么是x、要么是y、要么是z

mostOrthogonalAxis(cartesian, result)

Cartesian3

返回与cartesian最正交的坐标轴

multiplyByScalar(cartesian,scalar,result)

Cartesian3

坐标点按某一个比例值缩放、即乘以scalar值,返回新的坐标点result。

multiplyComponents(left,right,result)

Cartesian3

返回x=left.x*right.x、y=left.y*right.y、

z=left.z*right.z、

组成的坐标点、

negate(cartesian, result)

Cartesian3

返回cartesian坐标值取反的新坐标

normalize(cartesian, result)

Cartesian3

坐标点归一化,返回结果保存在result中。

projectVector(a, b, result)

Cartesian3

返回投影向量

subtract(left,right,result)

Cartesian3

返回坐标点相减后的点,其中x=left.x-rigt.x,y=left.x-right.y,

z=left.z-right.z

pack(value, array, startingIndex)

Array.<Number>

将坐标值置于数组中,返回数组。

packArray(array, result)

Array.<Number>

将坐标数据array转为一维数组。

 

 

 

 

 

 

 

 

 

 

 

 


                                                                      更多内容,微信扫二维码关注公众号

                                                                                


 

转载自:https://blog.csdn.net/u010608964/article/details/82120206

You may also like...