Cesium 椭球大地测量EllipsoidGeodesic(十二)
首先发现一个问题,这段代码会报错,原因是"DeveloperError: Expected value to be greater than or equal to0.0125, actual value was 0,不知道为什么经度不能为0
new Cesium.Cartographic.fromDegrees(0,0)
使用椭球大地测量可以计算一些椭球上的问题

-
GEODESIC(测地线):最准确地表示地球表面任意两点之间的最短曲线。
-
GREAT_CIRCLE(大圆):表示地球表面与通过地心的平面的相交线上任意两点之间的路径。
-
RHUMB_LINE(等角航线):表示通过以极点为起点的等方位角所定义的椭球体表面上的任意两点之间的路径。等角航线在墨卡托投影中显示为直线。
-
NORMAL_SECTION(法截弧):表示由椭球体表面与通过椭球体表面上两点并垂直于两点起点处椭球面的平面相交而定义的椭球面上任意两点之间的路径。因此,从 A 点到 B 点与从 B 点到 A 点的法向截面线不同。法截弧是测地线的简版,容易构建,但不是两点间的最短距离。当研究较小时,GEODESIC,显示的也是直线。
interpolateUsingFraction方法计算两点间中间点的位置
var a = new Cesium.EllipsoidGeodesic( new Cesium.Cartographic.fromDegrees(10,0), new Cesium.Cartographic.fromDegrees(10,60) ) console.log(a); console.log(a.interpolateUsingFraction(0.5));
单位是弧度

interpolateUsingSurfaceDistance提供测地线上指定距离处的点的位置。
var a = new Cesium.EllipsoidGeodesic( new Cesium.Cartographic.fromDegrees(10,90), new Cesium.Cartographic.fromDegrees(10,60) ) console.log(a.interpolateUsingSurfaceDistance(1000000));

浙公网安备 33010602011771号