-
Notifications
You must be signed in to change notification settings - Fork 5
Fix documentation: It said radians, but code uses degrees! #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Fix documentation: It said radians, but code uses degrees! #62
Conversation
|
Please help, I somehow cannot run the scripts. I have installed the |
|
ocular-dev-tools is published as |
chrisgervang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for catching this. Tagged the others to sanity check this since using radians vs degrees incorrectly is usually noticeable.. I'm surprised it changed but didn't get documented
|
Thanks! :) |
|
I can't get it to run: I can see the Tried inside PowerShell and WSL Ubuntu. |
|
This integration test should prove it (I placed it inside geospatial/test/ellispoid.spec.ts) test('Ellipsoid WGS84 east north up matches expected distance between two known points', (t) => {
const berlinGateLocation = [13.377683495290393, 52.516333017115834, 93]; // this is the real degrees location
const berlinMuseum = [13.381635343814912, 52.51696824798868, 93]; // this is the real degrees location
const expectedEastMetersFromGateToMuseum = 263; // this is the real measured east difference (approximately)
const expectedNorthMetersFromGateToMuseum = 55; // this is the real measured north difference (approximately)
const originEcef = Ellipsoid.WGS84.cartographicToCartesian(berlinGateLocation);
const targetEcef = Ellipsoid.WGS84.cartographicToCartesian(berlinMuseum);
const enuToEcef = Ellipsoid.WGS84.eastNorthUpToFixedFrame(originEcef, new Matrix4());
const ecefToEnu = enuToEcef.invert();
const [east, north, up,] = targetEcef.clone().transformAsPoint(ecefToEnu);
tapeEqualsEpsilon(t, east, expectedEastMetersFromGateToMuseum, 10);
tapeEqualsEpsilon(t, north, expectedNorthMetersFromGateToMuseum, 10);
tapeEqualsEpsilon(t, up, 0, 1);
t.end();
});I did not run this one (so it might not pass first time due to inaccuracies in the measurements), but the same code works in my current project without problems |
This took me 1 day to find out. I assumed the toRadians() was needed, but it must be removed.