-
Notifications
You must be signed in to change notification settings - Fork 204
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
Point-Line Distance 3-Dimensional #112
Comments
Yes, I tried the same thing. So far I found two solutions: The first solution is for one both paths are "straight" and not great circles: The second solution I tried using geodesy, but it has some strange issues,I already reported this as an issue, my delphi code is in there, it might give you some ideas how to do it: I highly suggest you use the code from solution 1 as a starting point and checking point/code. And then try and develop a solution 2, which tries and use geodesy to account for the bending of earth... If you find a solution that works across the globe, let me know, my solution so far has some issues, not sure what is causing them... maybe porting issue to Delphi, or maybe it's a more general math issue... |
I just found a good solution: https://www.ffi.no/en/research/n-vector/ Example 10: When implemented correctly the CrossTrackDistance is all you need. Make sure to normalize the input point though. Also normalize the normal after computing it for the great circle. It was well worth it to convert this code from C++ to Delphi... The final solution/code is actually quite simple and works pretty fast. |
There is a problem with that solution though, it seems to not fully respect the line segment... and goes beyond it somehow... strange... |
Yes, for what I need the point with minimum distance should be on the line segment. |
Hi,
Not an issue but a question.
I'm trying to understand if with geodesy I can get the minimum distance between one 3D point (lat, lon, alt) and the line segment generated by two other 3D points.
This is better explained here:
Point-Line Distance--3-Dimensional
In my case I'm trying to find the minimum distance in meters from a point on the ground (but considering elevation) and a flying object passing by two points.
Thanks
The text was updated successfully, but these errors were encountered: