Compute ALPR bearings and wedge corners without Cesium

The ALPR model's great-circle destination and the direction wedge's
corners now come from src/geo: the same numbers, the corners plain ECEF
rather than Cesium objects, which the overlay projects as before. Both
files leave the Cesium allow-list.
This commit is contained in:
Sameh Khamis committed 2026-11-06 20:39:41 -08:00
1 parent df1143485a
commit f6ed35a887
5 files changed
+33 -20

No files matched your search

+6 -6
View File
@@ -1,4 +1,4 @@
import * as Cesium from 'cesium';
import { toDegrees, toRadians } from '../../geo/index.js';
import { EARTH_MEAN_RADIUS_M } from './policy.js';
export * from './records.js';
@@ -12,9 +12,9 @@ export * from './records.js';
*/
export function destinationPointDeg(latDeg, lonDeg, bearingDeg, distanceM) {
const angularDistance = distanceM / EARTH_MEAN_RADIUS_M;
const bearing = Cesium.Math.toRadians(bearingDeg);
const lat1 = Cesium.Math.toRadians(latDeg);
const lon1 = Cesium.Math.toRadians(lonDeg);
const bearing = toRadians(bearingDeg);
const lat1 = toRadians(latDeg);
const lon1 = toRadians(lonDeg);
const lat2 = Math.asin(
Math.sin(lat1) * Math.cos(angularDistance) +
Math.cos(lat1) * Math.sin(angularDistance) * Math.cos(bearing),
@@ -26,8 +26,8 @@ export function destinationPointDeg(latDeg, lonDeg, bearingDeg, distanceM) {
Math.cos(angularDistance) - Math.sin(lat1) * Math.sin(lat2),
);
return {
latitude: Cesium.Math.toDegrees(lat2),
longitude: Cesium.Math.toDegrees(lon2),
latitude: toDegrees(lat2),
longitude: toDegrees(lon2),
};
}