三维直角坐标系
球坐标系
球坐标(r,θ,φ)
θ与φ均为弧度,弧度 = 角度 * Math.PI/ 180
坐标间关系
坐标转换
直角坐标转球坐标
function lglt2xyz(lng, lat, radius) {const phi = (180 + lng) * (Math.PI / 180)const theta = (90 - lat) * (Math.PI / 180)return {x: -radius * Math.sin(theta) * Math.cos(phi),y: radius * Math.cos(theta),z: radius * Math.sin(theta) * Math.sin(phi),}}
three.js
lglt2xyz(lng, lat, radius) {const theta = (90 + lng) * (Math.PI / 180)const phi = (90 - lat) * (Math.PI / 180)return (new THREE.Vector3()).setFromSpherical(new THREE.Spherical(radius, phi, theta))},
球坐标转直角坐标





