- 
    
    
        
        staticYS.MathEngine.arrayCartesian3ToXYZ(array) → Array.<XYZ>
        
    
 
- 
    
    
        Cartesian3数组转经纬度坐标数组
     
    
    
        
        | Name | Type | Description |  
            
                | array | Array.<Cartesian3> | Cartesian3数组 |  
 Returns:
    array 经纬度坐标数组,单位度
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.arrayCartesianToDegree(array) → Array.<XYZ>
        
    
 
- 
    
    
        世界坐标数组转经纬度数组
     
    
    
        
        | Name | Type | Description |  
            
                | array | Array.<Cesium.Cartesian3> | WGS84世界坐标数组 |  
 Returns:
    经纬度高程 Object = {x:114,y:30,z:0}
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.arrayCartographicToXYZ(array) → Array.<XYZ>
        
    
 
- 
    
    
        Cartographic数组转经纬度坐标数组
     
    
    
        
        | Name | Type | Description |  
            
                | array | Array.<Cartographic> | Cartographic数组 |  
 Returns:
    array 经纬度坐标数组,单位度
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.arrayColorToArray(array) → Array.<Cesium.Color>
        
    
 
- 
    
    
        Color数组转成一维的Cesium.Color数组,即pack
     
    
    
        
        | Name | Type | Description |  
            
                | array | Array.<Color>
|
Array.<RGBA> | Color类型数组 |  
 Returns:
    Color类型一维数组,用于shader
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.arrayColorToArrayFloat(array) → Array.<float>
        
    
 
- 
    
    
        Color数组转成一维的float数组,即pack
     
    
    
        
        | Name | Type | Description |  
            
                | array | Array.<Color>
|
Array.<RGBA> | Color类型数组 |  
 Returns:
    float类型一维数组,r,g,b,a,r,g,b,a...的形式
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.arrayDegreeToCartesian(array) → Array.<Cesium.Cartesian3>
        
    
 
- 
    
    
        经纬度数组转世界坐标数组
     
    
    
        
        | Name | Type | Description |  
            
                | array | Array.<XYZ> | 经纬度高程 |  
 Returns:
    WGS84世界坐标数组
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.arrayRemove(array, deleteItem) → Array
        
    
 
- 
    
    
        删除数组中的第一个匹配元素
 只删除一次
 
    
    
        
        | Name | Type | Description |  
            
                | array | Array | 要删除的数组 |  
            
                | deleteItem | * | 要删除的数组元素 |  
 Returns:
    返回删除后的数组,等于输入的array本身
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.arrayXYToArrayFloat(array) → Array.<float>
        
    
 
- 
    
    
        XY数组转成一维的float数组,即pack
     
    
    
        
        | Name | Type | Description |  
            
                | array | Array.<XY> | XY类型数组 |  
 Returns:
    float类型一维数组,x,y,x,y...的形式
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.arrayXYZToArrayFloat(array) → Array.<float>
        
    
 
- 
    
    
        XYZ数组转成一维的float数组,即pack
     
    
    
        
        | Name | Type | Description |  
            
                | array | Array.<XYZ> | XYZ类型数组 |  
 Returns:
    float类型一维数组,x,y,z,x,y,z...的形式
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.arrayXYZToCartesian(array) → Array.<Cesium.Cartesian3>
        
    
 
- 
    
    
        经纬度数组转世界坐标数组
     
    
    
        
        | Name | Type | Description |  
            
                | array | Array.<XYZ> | 经纬度高程 |  
 Returns:
    WGS84世界坐标数组
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.arrayXYZToCartographic(array) → Array.<Cartographic>
        
    
 
- 
    
    
        经纬度坐标数组转Cartographic数组
     
    
    
        
        | Name | Type | Description |  
            
                | array | Array.<XYZ> | 经纬度坐标数组,单位度 |  
 Returns:
    Cartographic数组
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.azimuth(pA, pB) → Number
        
    
 
- 
    
    
        计算由球面点A 到 B的方位角
     
    
    
        
        | Name | Type | Description |  
            
                | pA | XYZ
|
XY | 点A,单位度 |  
            
                | pB | XYZ
|
XY | 点B,单位度 |  
 Returns:
    返回两点间方位角,单位弧度
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.calculate2PDistance(point1, point2) → Number
        
    
 
- 
    
    
        通过世界坐标计算两点间距离
     
    
    
        
        | Name | Type | Description |  
            
                | point1 | Cartesian3 | 第一点坐标(笛卡尔) |  
            
                | point2 | Cartesian3 | 第二点坐标(笛卡尔) |  
 Returns:
    两点间距离
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.calculateArea(positions) → Number
        
    
 
- 
    
    
        通过经纬度(弧度)坐标计算投影面积
     
    
    
        
        | Name | Type | Description |  
            
                | positions | Array.<Cesium.Cartographic> | 经纬度(弧度) |  
 Returns:
    任意多边形投影面积
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.calculateCenter(positions) → Cartesian2
        
    
 
- 
    
    
        通过经纬度(弧度)坐标计算多边形中心点坐标
     
    
    
        
        | Name | Type | Description |  
            
                | positions | Array.<Cesium.Cartographic> | 经纬度(弧度) |  
 Returns:
    中心点坐标
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.calculateCenterXYZ(positions) → XYZ
        
    
 
- 
    
    
        通过经纬度(度)坐标计算多边形中心点坐标
     
    
    
        
        | Name | Type | Description |  
            
                | positions | Array.<XYZ> | 经纬度(度) |  
 Returns:
    经纬度坐标(度)
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.cartesian3ToXYZ(cartesian3) → XYZ
        
    
 
- 
    
    
        世界坐标转xyz格式
     
    
    
        
        | Name | Type | Description |  
            
                | cartesian3 | Cartesian3 | 世界坐标 |  
 Returns:
    xyz格式的经纬度
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.cartesianToDegree(cartesian3) → Object
        
    
 
- 
    
    
        世界坐标转经纬度
     
    
    
        
        | Name | Type | Description |  
            
                | cartesian3 | Cartesian3 | 世界坐标(笛卡尔) |  
 Returns:
    经纬度坐标(角度)
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.clamp(value, v1, v2) → Number
        
    
 
- 
    
    
        将数字限制到值域内
     
    
    
        
        | Name | Type | Description |  
            
                | value | Number | 值 |  
            
                | v1 | Number | 值域范围 |  
            
                | v2 | Number | 值域范围 |  
 Returns:
    如果value小于v1、v2中的最小值, 将返回最小值, 大于最大值将返回最大值,在值域内直接返回
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.contour(pnts, options) → Object
        
    
 
- 
    
    
        根据规则格网的数据点生成等值线
     
    
    
        
        | Name | Type | Description |  
            
                | pnts | Array.<XYZ> | 要生成等值线的规则格网点,长度不能等于0 |  
            
                | options | Object | 参数 
    
    
        
        | Name | Type | Default | Description |  
            
                | numbers | Array.<Number> |  | 要生成等值线的值域数组 |  
            
                | smooth | Boolean | true | optional
                
                
                
            
                要不要用贝塞尔曲线平滑 |  |  
 Returns:
    GeoJson对象,包含多条等值线
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.degreeToCartesian(cartographic) → Cartesian3
        
    
 
- 
    
    
        经纬度转世界坐标
     
    
    
        
        | Name | Type | Description |  
            
                | cartographic | Cartographic | 经纬度(弧度) |  
 Returns:
    世界坐标
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.degreeToDMS(cartographic) → String
        
    
 
- 
    
    
        经纬度(度)转经纬度度分秒字符串
     
    
    
        
        | Name | Type | Description |  
            
                | cartographic | Cartographic | 经纬度(度) |  
 Returns:
    经纬度坐标
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.degreeToRadian(d) → Number
        
    
 
- 
    
    
        将度转成弧度
     
    
    
        
        | Name | Type | Description |  
            
                | d | Number | 度数 |  
 Returns:
    弧度数
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.degreeToXYZ(cartographic) → XYZ
        
    
 
- 
    
    
        经纬度转xyz格式
     
    
    
        
        | Name | Type | Description |  
            
                | cartographic | Cartographic | 经纬度(弧度或度) |  
 Returns:
    xyz格式的经纬度
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.distance(p1, p2) → Number
        
    
 
- 
    
    
        计算世界坐标两点间直线距离
     
    
    
        
        | Name | Type | Description |  
            
                | p1 | XYZ | 包含xyz的坐标点 |  
            
                | p2 | XYZ | 包含xyz的坐标点 |  
 Returns:
    输入单位是米则返回米
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.generateCartographicArc(positions, granularity, isSameLon) → Array.<Cesium.Cartographic>
        
    
 
- 
    
    
        通过相同经纬度弧度点数组和弧度步长生成球面的内插加密点
     
    
    
        
        | Name | Type | Description |  
            
                | positions | Array.<Cesium.Cartographic> | 起始点经纬度(弧度) |  
            
                | granularity | Number | 步长(弧度) |  
            
                | isSameLon | Boolean | 经度是否相同 |  
 Returns:
    坐标集(弧度)
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.getBufferArea(positions, radius, units) → Array.<XY>
        
    
 
- 
    
    
        计算缓冲区域
     
    
    
        
        | Name | Type | Default | Description |  
            
                | positions | Array.<XY> |  | 点或线的经纬度坐标点集(如果是点的话,只传一个点;如果是线的话,传多个点) |  
            
                | radius | radius |  | 缓冲区半径 |  
            
                | units | units | 'meters' | optional
                
                
                
            
                单位('meters'米,'kilometers'千米,'miles'英里) |  
 Returns:
    缓冲区经纬度坐标点集
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.getFittingPlane(viewer, positions) → Object
        
    
 
- 
    
    
        计算多个点的拟合平面(不支持过坐标原点的平面)
     
    
    
        
        | Name | Type | Description |  
            
                | viewer | Viewer | YouScene.earth.viewer |  
            
                | positions | Array.<XYZ> | 世界坐标点数组 |  
 Returns:
    返回结果 {A:1, B:1, C:1, D:1} 平面为Ax + By + Cz + D = 0
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.getMatrix(targetPosition, heading, pitch, roll, scaleX, scaleY, scaleZ) → Matrix4
        
    
 
- 
    
    
        通过世界坐标,X,Y,Z各方向旋转角度获取矩阵
     
    
    
        
        | Name | Type | Default | Description |  
            
                | targetPosition | Cartesian3 |  | 世界坐标 |  
            
                | heading | Number | 0 | optional
                
                
                
            
                绕Z轴旋转角度 |  
            
                | pitch | Number | 0 | optional
                
                
                
            
                绕Y轴旋转角度 |  
            
                | roll | Number | 0 | optional
                
                
                
            
                绕X轴旋转角度 |  
            
                | scaleX | Number | 1 | optional
                
                
                
            
                X轴放大系数 |  
            
                | scaleY | Number | 1 | optional
                
                
                
            
                Y轴放大系数 |  
            
                | scaleZ | Number | 1 | optional
                
                
                
            
                Z轴放大系数 |  
 Returns:
    Matrix4
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.getMinMax(xyzArray, field) → Object
        
    
 
- 
    
    
        统计一系列数据中的最大值和最小值、平均值
     
    
    
        
        | Name | Type | Description |  
            
                | xyzArray | Array.<Object> | 要统计的对象数组 |  
            
                | field | String | 要统计数值的对象属性名 |  
 Returns:
    返回统计结果{min:0,max:2,average:1},空数组返回{}
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
        Example:console.log(YS.MathEngine.getMinMax([{x:1,y:2,z:3}, {x:3,y:2,z:1}], 'z') );
 //输出:{ min: 1, max: 3, average: 2 }
 
 
- 
    
    
        
        staticYS.MathEngine.getMinMaxVal(array) → Object
        
    
 
- 
    
    
        统计一系列数据中的最大值和最小值、平均值
     
    
    
        
        | Name | Type | Description |  
            
                | array | Array.<Number> | 要统计的数值数组 |  
 Returns:
    返回统计结果{min:0,max:2,average:1},空数组返回{}
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
        Example:console.log( YS.MathEngine.getMinMaxVal([3, 1, 2], 'z') );
 //输出:{ min: 1, max: 3, average: 2 }
 
 
- 
    
    
        
        staticYS.MathEngine.inPolygon(points, p) → Boolean
        
    
 
- 
    
    
        二维计算点是否在任意多边形内部
     
    
    
        
        | Name | Type | Description |  
            
                | points | Array.<Number> | 要统计的多边形数值数组 |  
            
                | p | Object | 要计算的点坐标{x:0,y:0} |  
 Returns:
    返回结果
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
        Example:console.log( YS.MathEngine.inPolygon([3, 1, 2, 2, 3, 5], {x:2.5, y:2}) );
 //输出:true
 
 
- 
    
    
        
        staticYS.MathEngine.isPolygoninPolygon(polygon1, polygon2) → Bool
        
    
 
- 
    
    
    
    
    
        
    
    
        
        | Name | Type | Description |  
            
                | polygon1 | Array.<XY> | 多边形点集合 |  
            
                | polygon2 | Array.<XY> | 多边形点集合 |  
 Returns:
    polygon1多边形是否完全包含在polygon2中
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.leftRightToCenterWithVerticalAngleBetween(left, right, center) → Number
        
    
 
- 
    
    
        根据左右两点和模型中心点,获取模型倾斜角度
     
    
    
        
        | Name | Type | Description |  
            
                | left | XYZ | 左边点坐标 |  
            
                | right | XYZ | 右边点坐标 |  
            
                | center | XYZ | 模型中心点坐标 |  
 Returns:
    倾斜角度
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.lerp(point1, point2, ys) → Array
        
    
 
- 
    
    
        计算两点间离散点的坐标集合, 请在俯视视角计算(计算结果不包括传入的两点坐标)
     
    
    
        
        | Name | Type | Description |  
            
                | point1 | XYZ | 经纬度(度) |  
            
                | point2 | XYZ | 经纬度(度) |  
            
                | ys | Object | YouScene对象 |  
 Returns:
    xyz坐标数组
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
        Example:例,在模型上画线时,需要将线贴在模型上可以用此方法
   var layer = youScene.layers.addLinesLayer({
        id:'123',
        name:'213',
    });
 var points = [];
 function polylineTool(ys) {
     ys.viewTool = YS.ViewTool.POLYLINE;
     var onViewToolTagAdded = function (global, viewTool, trackObject) {
         var point = trackObject.json.tag;
         if (points.length === 0) {
             points.push(point);
         } else {
             var arr = YS.MathEngine.lerp(points[points.length - 1], point, youScene);
             points.push.apply(points, arr);
             points.push(point);
         }
     };
     var onViewToolUsed = function (global, viewTool, trackObject) {
         var point = trackObject.json.pointArray[trackObject.json.pointArray.length - 1];
         var arr = YS.MathEngine.lerp(points[points.length - 1], point, youScene);
         points.push.apply(points, arr);
         points.push(point);
         var line = new YS.Line({
             points: points,
             width: 3,
             color: {r: 1, g: 0, b: 0, a: 1}
         });
         layer.add(line)
     }
     ys.events.viewToolUsed.addEventListener(onViewToolUsed);
     ys.events.viewToolTagAdded.addEventListener(onViewToolTagAdded);
 }
 polylineTool(youScene);
 
 
- 
    
    
        
        staticYS.MathEngine.modelToWorld(modelMatrix, model) → Cartesian3
        
    
 
- 
    
    
        模型坐标转世界坐标
     
    
    
        
        | Name | Type | Description |  
            
                | modelMatrix | Matrix4 | 模型矩阵 |  
            
                | model | Cartesian3 | 模型坐标,xyz |  
 Returns:
    世界坐标
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.pointWithinPolygon(position, polygonPositions) → Boolean
        
    
 
- 
    
    
        判断点是否在区域内
     
    
    
        
        | Name | Type | Description |  
            
                | position | Cartographic | 点坐标(弧度) |  
            
                | polygonPositions | Array.<Cesium.Cartographic> | 区域坐标集(弧度) |  
 Returns:
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.radiansToDMS(cartographic) → String
        
    
 
- 
    
    
        经纬度(弧度)转经纬度度分秒
     
    
    
        
        | Name | Type | Description |  
            
                | cartographic | Cartographic | 经纬度(弧度) |  
 Returns:
    经纬度坐标
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.radianToDegree(r) → Number
        
    
 
- 
    
    
        将弧度转成度
     
    
    
        
        | Name | Type | Description |  
            
                | r | Number | 弧度数 |  
 Returns:
    度数
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.rotateOffsetPoint(center, point, options) → XYZ
        
    
 
- 
    
    
        根据中心点与选点方向计算偏移距离和高度上的点
     
    
    
        
        | Name | Type | Description |  
            
                | center | XYZ | 中心点 |  
            
                | point | XYZ | 选点的坐标 |  
            
                | options | Object | options有下面这些属性 
    
    
        
        | Name | Type | Description |  
            
                | dis | Number | 偏移距离 |  
            
                | height | Number | 偏移高度 |  |  
 Returns:
    偏移后的坐标
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.sampleTerrainMostDetailed2(terrainProvider, positions, level) → Promise
        
    
 
- 
    
    
        根据坐标和级别计算当前坐标处的贴地坐标,如果请求级别大于当前位置处的最大级别,则采用最大级别。反之则采用请求级别
     
    
    
        
        | Name | Type | Description |  
            
                | terrainProvider | Object | viewer.terrainProvider对象 |  
            
                | positions | Array.<Cesium.Cartographic> | Cesium.Cartographic坐标数组(经纬度弧度) |  
            
                | level | Number | 当前请求的地形级别 |  
 Returns:
    返回Promise, Promise.then方法里面的参数为请求到的贴地坐标数组
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.screenToRadians(viewer, screenPosition) → Cartographic
        
    
 
- 
    
    
        屏幕坐标转经纬度(弧度)
     
    
    
        
        | Name | Type | Description |  
            
                | viewer | Viewer | YouScene.earth.viewer |  
            
                | screenPosition | XY | 屏幕坐标{x:200,y:700} |  
 Returns:
    经纬度坐标(弧度)
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.screenToWorld(viewer, screenPosition) → XYZ
        
    
 
- 
    
    
        获取屏幕坐标下对应的世界坐标
     
    
    
        
        | Name | Type | Description |  
            
                | viewer | Viewer | YouScene.earth.viewer |  
            
                | screenPosition | XY | 屏幕坐标{x:200,y:700} |  
 Returns:
    }} 世界坐标
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.screenToWorld2(viewer, screenPosition) → XYZ
        
    
 
- 
    
    
        获取当前屏幕坐标下对应的地形上的坐标
     
    
    
        
        | Name | Type | Description |  
            
                | viewer | Viewer | YouScene.earth.viewer |  
            
                | screenPosition | XY | 屏幕坐标{x:200,y:700} |  
 Returns:
    }} 世界坐标
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.sphericalDistance(p1, p2) → Number
        
    
 
- 
    
    
        计算两点间球面大圆距离,单位度
     
    
    
        
        | Name | Type | Description |  
            
                | p1 | XYZ
|
XY | 球面一个点 |  
            
                | p2 | XYZ
|
XY | 球面另一个点 |  
 Returns:
    返回两点间的球面距离,单位度
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    - To Do:
- 
        
    
 
- 
    
    
        
        staticYS.MathEngine.sphericalDistanceM(p1, p2) → Number
        
    
 
- 
    
    
        计算两点间球面大圆距离,单位米
     
    
    
        
        | Name | Type | Description |  
            
                | p1 | XYZ
|
XY | 球面一个点 |  
            
                | p2 | XYZ
|
XY | 球面另一个点 |  
 Returns:
    返回两点间的球面距离,单位米
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    - To Do:
- 
        
            - 已实现,现在使用的相同半径,后续需要根据长短轴半径分别计算
 
 
- 
    
    
        
        staticYS.MathEngine.sphericalToModel(modelMatrix, cartographic) → Cartesian3
        
    
 
- 
    
    
        经纬度点转模型坐标
     
    
    
        
        | Name | Type | Description |  
            
                | modelMatrix | Matrix4 | 模型矩阵 |  
            
                | cartographic | Cartographic | 经纬度点坐标(弧度) |  
 Returns:
    模型坐标
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.sphericalToModelD(modelMatrix, longitude, latitude, altitude) → Cartesian3
        
    
 
- 
    
    
        经纬度转模型坐标
     
    
    
        
        | Name | Type | Description |  
            
                | modelMatrix | Matrix4 | 模型矩阵 |  
            
                | longitude | var | 经度(度) |  
            
                | latitude | var | 纬度(度) |  
            
                | altitude | var | 海拔高程(米) |  
 Returns:
    模型坐标
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.sphericalToModelR(modelMatrix, longitude, latitude, altitude) → Cartesian3
        
    
 
- 
    
    
        经纬度(弧度)转模型坐标
     
    
    
        
        | Name | Type | Description |  
            
                | modelMatrix | Matrix4 | 模型矩阵 |  
            
                | longitude | var | 经度(弧度) |  
            
                | latitude | var | 纬度(弧度) |  
            
                | altitude | var | 海拔高程(米) |  
 Returns:
    模型坐标
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.sphericalToScreen(ys, Cartesian3) → ScreenCoordinates
        
    
 
- 
    
    
        球面坐标转屏幕坐标
     
    
    
        
        | Name | Type | Description |  
            
                | ys | Object | YouScene对象 |  
            
                | Cartesian3 | Cartesian3 | 世界坐标 |  
 Returns:
    屏幕坐标
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.toDegreeRect(rectangle) → Rectangle
        
    
 
- 
    
    
        将弧度单位的Rectange转成以度为单位
     
    
    
        
        | Name | Type | Description |  
            
                | rectangle | Rectangle | 任意类型的rectangle,弧度单位 |  
 Returns:
    返回度为单位的Rectangle
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.toRadiansRect(rectangle) → Rectangle
        
    
 
- 
    
    
        将度单位的Rectange转成以弧度为单位
     
    
    
        
        | Name | Type | Description |  
            
                | rectangle | Rectangle | 任意类型的rectangle,度单位 |  
 Returns:
    返回弧度为单位的Rectangle
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.translateRotateScaleFromMatrix(matrix) → Object
        
    
 
- 
    
    
        通过矩阵获取当前的位置,旋转角,放大系数
     
    
    
        
        | Name | Type | Description |  
            
                | matrix | Matrix4 | 矩阵,通过MathEngine.getMatrix生成的矩阵 |  
 Returns:
            - 
    options
 
- 
    options.longitude 经度
 
- 
    options.latitude 纬度
 
- 
    options.altitude 高度
 
- 
    options.heading 绕Z轴旋转角度
 
- 
    options.pitch 绕Y轴旋转角度
 
- 
    options.roll 绕X轴旋转角度
 
- 
    options.scaleX X轴放大系数
 
- 
    options.scaleY Y轴放大系数
 
- 
    options.scaleZ Z轴放大系数
 
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.twoBezierPoints(p1, p2, h, n) → Array.<XYZ>
        
    
 
- 
    
    
        根据两点生成以两点中心点贝赛尔曲线点
     
    
    
        
        | Name | Type | Description |  
            
                | p1 | XYZ | 第一点 |  
            
                | p2 | XYZ | 第二点 |  
            
                | h | Number | 贝赛尔曲线的高度 |  
            
                | n | Number | 生成贝赛尔曲线点的个数(越多越平滑) |  
 Returns:
    返回贝赛尔曲线点的坐标数组
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.worldToModel(modelMatrix, cartesian3) → Cartesian3
        
    
 
- 
    
    
        世界坐标转模型坐标
     
    
    
        
        | Name | Type | Description |  
            
                | modelMatrix | Matrix4 | 模型矩阵 |  
            
                | cartesian3 | Cartesian3 | 世界坐标,xyz |  
 Returns:
    模型坐标
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.xyzDegreeToRadian(xyz) → XYZ
        
    
 
- 
    
    
        经纬度(度)转经纬度弧度
     
    
    
        
        | Name | Type | Description |  
            
                | xyz | XYZ | 经纬度(度) |  
 Returns:
    经纬度坐标(弧度)
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.xyzDegreeToRadians(xyz) → XYZ
        
    
 
- 
    
    
        经纬度(弧度)转经纬度度分秒
     
    
    
        
        | Name | Type | Description |  
            
                | xyz | Cartographic | 经纬度(弧度) |  
 Returns:
    经纬度坐标
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.xyzRadianToDegree(xyz) → XYZ
        
    
 
- 
    
    
        经纬度(弧度)转经纬度度
     
    
    
        
        | Name | Type | Description |  
            
                | xyz | XYZ | 经纬度(弧度) |  
 Returns:
    经纬度坐标(度)
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.xyzsToModel(modelMatrix, positions) → Array.<Cartesian3>
        
    
 
- 
    
    
        xyz经纬度数组坐标转模型坐标
     
    
    
        
        | Name | Type | Description |  
            
                | modelMatrix | Matrix4 | 模型矩阵 |  
            
                | positions | Array.<XYZ> | 经纬度坐标数组 |  
 Returns:
    模型坐标数组
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.xyzToCartesian3(xyz) → Cartesian3
        
    
 
- 
    
    
        xyz格式转Cartesian3世界坐标
     
    
    
        
        | Name | Type | Description |  
            
                | xyz | XYZ | 经纬度(度) |  
 Returns:
    世界坐标
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.xyzToCartographic(xyz) → Cesium.Cartographic
        
    
 
- 
    
    
        经纬度坐标转Cartographic
     
    
    
        
        | Name | Type | Description |  
            
                | xyz | XYZ | 经纬度坐标,单位度 |  
 Returns:
    Cartographic
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
- 
    
    
        
        staticYS.MathEngine.xyzToModel(modelMatrix, xyz) → Cartesian3
        
    
 
- 
    
    
        xyz经纬度坐标转模型坐标
     
    
    
        
        | Name | Type | Description |  
            
                | modelMatrix | Matrix4 | 模型矩阵 |  
            
                | xyz | XYZ | 经纬度坐标 |  
 Returns:
    模型坐标