mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
Match Cesium's fromDegrees exactly and keep toEcef in the stub
fromRadians divides by gamma as Cesium does, so geodetic to ECEF is now bit for bit Cesium's, and the test checks it exactly. Its tests also cover three height bands, points inside the Earth and NaN input. toEcef reads the renderer contract's Position, so it moves to the stub's maths. The ellipsoid docs pair each conversion with Cesium's.
This commit is contained in:
1 parent
52d82b453c
commit
e32988ae5e
4 files changed
+64
-12
No files matched your search
@@ -14,6 +14,8 @@ import {
|
||||
clamp,
|
||||
equalsEpsilon,
|
||||
negate,
|
||||
clone,
|
||||
fromDegrees,
|
||||
rotate,
|
||||
scale,
|
||||
vec,
|
||||
@@ -22,6 +24,13 @@ import {
|
||||
|
||||
export * from '../../geo/index.js';
|
||||
|
||||
/** A contract `Position` (`Ecef` or `LonLatH`, degrees), as ECEF. */
|
||||
export function toEcef(position) {
|
||||
if ('lon' in position && 'lat' in position)
|
||||
return fromDegrees(position.lon, position.lat, position.height ?? 0);
|
||||
return clone(position);
|
||||
}
|
||||
|
||||
const EPSILON3 = 1e-3;
|
||||
const EPSILON10 = 1e-10;
|
||||
|
||||
|
||||
Reference in new issue
Block a user