-
Notifications
You must be signed in to change notification settings - Fork 67
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
Compute distance between points on a general celestial body #434
Conversation
Codecov Report
@@ Coverage Diff @@
## main #434 +/- ##
==========================================
- Coverage 99.69% 99.65% -0.05%
==========================================
Files 73 73
Lines 6567 6641 +74
==========================================
+ Hits 6547 6618 +71
- Misses 20 23 +3
Continue to review full report at Codecov.
|
Signed-off-by: Aditya <[email protected]>
Signed-off-by: Aditya <[email protected]>
Signed-off-by: Aditya <[email protected]>
5c81107
to
4d68400
Compare
Making changes to the Latitude and logitudinal references can be updated using the |
Signed-off-by: Aditya <[email protected]>
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.
I think we should deprecate the existing static Distance
function and rename it to DistanceWGS84
or something like that. We could add the same function alias to ign-math6
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.
Initial pass, +1 to deprecate the existing static Distance()
function
Signed-off-by: Aditya <[email protected]>
Signed-off-by: Aditya <[email protected]>
Signed-off-by: Aditya <[email protected]>
Signed-off-by: Aditya <[email protected]>
5620578
to
fbe260a
Compare
I messed up the commit history here. Fixing that. |
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: methylDragon <[email protected]> Signed-off-by: Louise Poubel <[email protected]> Co-authored-by: Louise Poubel <[email protected]>
* Suppress zero variadic macro args message * Remove unused clang flag, suppress ruby warnings Signed-off-by: Michael Carroll <[email protected]>
889fad5
to
9e756fe
Compare
Signed-off-by: Aditya <[email protected]>
bb18e27
to
2a7c853
Compare
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.
I saw that you added the Python interface, do you mind to add the tests too ? otherwise can you add an issue ?
Signed-off-by: Aditya <[email protected]>
Signed-off-by: Aditya <[email protected]>
Signed-off-by: Aditya <[email protected]>
Ported test cases to python bindings, passing in CI, cc @ahcorde :
|
Signed-off-by: Aditya <[email protected]>
Signed-off-by: Aditya <[email protected]>
// https://en.wikipedia.org/wiki/Eccentricity_(mathematics)#Ellipses | ||
this->dataPtr->ellP = sqrt( | ||
std::pow(this->dataPtr->ellA, 2) / std::pow(this->dataPtr->ellB, 2) - | ||
1.0); |
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.
nit: the ellE
and ellP
computations are repeated between this MOON_SCS
case and the prior EARTH_WGS84
case. We could potentially move them outside of this switch
block if the CUSTOM_SERVICE
and default
cases had a return
instead of break
, but this isn't a big deal, so it's not required
Addressed changes, dismissing so that github allows merging
🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸
🎉 New feature
Summary
The current
SphericalCoordinates::Distance
function uses hardcoded Earth's radius for its calculation. In order to compute distances between points for any non-Earth celestial body, we would need to consider its radius as well. This PR overloads theDistance()
function to add an additional parameter,_radius
.Test it
Added a simple test case : Consider a hypothetical body with its radius half as that of the earth. The distance between 2 points on that body should be half as the distance between them on Earth.
Implementation variation
I could also implement radius as an optional parameter in the original
SphericalCoordinates::Distance()
function.Another idea is to keep a small database of radii of common celestial bodies, so "MOON" should automatically get you a radius of 1.7374 * 10^6 m. This way it makes sense to keep overloads of the
Distance
method, we can have a third one with the signatureDistance(Angle, Angle, Angle, Angle, string _celestialBody)
.Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸