| 123456789101112131415161718192021222324 |
- /** 南极平移动向的定点诊断:直接调 shiftPivot,看每一步落点。 */
- import * as camera from '../../../src/modules/cockpit/domain/camera.js'
- const mpp = camera.metersPerPixel({ range: 25996782, fovYRad: (60 * Math.PI) / 180, viewportHeight: 950 })
- console.log(`米/像素 = ${Math.round(mpp)};40px = ${(40 * mpp / 1000).toFixed(0)} km`)
- for (const [name, start, dyPx] of [
- ['北极上空向南拖', { lon: 0, lat: 89.5, height: 0 }, -40],
- ['南极上空向南拖', { lon: 0, lat: -89.5, height: 0 }, -40],
- ['南极上空向北拖', { lon: 0, lat: -89.5, height: 0 }, +40],
- ]) {
- console.log(`\n== ${name}(起始 ${start.lon},${start.lat})==`)
- let pivot = start
- for (let i = 1; i <= 6; i += 1) {
- const offset = camera.pivotOffsetMeters({ headingDeg: 0, dxPx: 0, dyPx, metersPerPx: mpp })
- const next = camera.shiftPivot(pivot, offset)
- console.log(
- ` ${i}: east=${Math.round(offset.east)} north=${Math.round(offset.north)}` +
- ` → ${next.lon.toFixed(4)},${next.lat.toFixed(4)}` +
- ` |Δlat|=${Math.abs(next.lat - pivot.lat).toFixed(4)}`,
- )
- pivot = next
- }
- }
|