Git Product home page Git Product logo

Comments (4)

SkybuckFlying avatar SkybuckFlying commented on July 3, 2024

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:
https://www.fundza.com/vectors/point2line/index.html

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:

#111

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...

from geodesy.

SkybuckFlying avatar SkybuckFlying commented on July 3, 2024

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.

from geodesy.

SkybuckFlying avatar SkybuckFlying commented on July 3, 2024

There is a problem with that solution though, it seems to not fully respect the line segment... and goes beyond it somehow... strange...

from geodesy.

emanuelef avatar emanuelef commented on July 3, 2024

Yes, for what I need the point with minimum distance should be on the line segment.
@SkybuckFlying in the link you provided the example seems to be using only lat,lon and not altitude.
What did you use for the "3D points" ?

from geodesy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.