| 123456789101112131415161718192021222324252627282930 |
- import * as c from '../../../src/modules/cockpit/domain/camera.js'
- const mpp = 31598 // 全球视角下的一像素米数(约 31.6km/px,40px 就是 1264km,最坏情况)
- const show = (name, start, dyPx) => {
- process.stdout.write('== ' + name + ' ==\n')
- let p = start
- for (let i = 1; i <= 6; i += 1) {
- const off = c.pivotOffsetMeters({ headingDeg: 0, dxPx: 0, dyPx, metersPerPx: mpp })
- const n = c.shiftPivot(p, off)
- process.stdout.write(
- ' ' + i + ': north=' + Math.round(off.north) + ' → ' + n.lon.toFixed(4) + ',' + n.lat.toFixed(4) + '\n',
- )
- p = n
- }
- }
- // dy>0 → north>0 → 向北(朝北极方向)
- show('北极界上 85°,继续向北(应钉在 85)', { lon: 0, lat: 85, height: 0 }, 60)
- show('赤道附近向北(应正常推进)', { lon: 0, lat: 10, height: 0 }, 60)
- show('南极界上 -85°,继续向南(应钉在 -85)', { lon: 0, lat: -85, height: 0 }, -60)
- show('界内侧 82°,向北(应停在 85)', { lon: -170, lat: 82, height: 0 }, 60)
- process.stdout.write('== 界上东西向(应绕极轴有界移动,纬度不变) ==\n')
- let p = { lon: 0, lat: 85, height: 0 }
- for (let i = 1; i <= 4; i += 1) {
- const off = c.pivotOffsetMeters({ headingDeg: 0, dxPx: 200, dyPx: 0, metersPerPx: mpp })
- const n = c.shiftPivot(p, off)
- process.stdout.write(' ' + i + ': east=' + Math.round(off.east) + ' → ' + n.lon.toFixed(4) + ',' + n.lat.toFixed(4) + '\n')
- p = n
- }
|