Comments (4)
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:
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.
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.
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.
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)
- Difference on geoscience australia example HOT 2
- How to use the library in Angular 2+ apps?
- True rhumbline distance
- Paypal Donate 404 at https://www.movable-type.co.uk/scripts/latlong-os-gridref.html HOT 2
- MGRS parsing issue HOT 1
- OSgrid Parsing Error HOT 2
- LatLonSpherical.intersection algorithm is different from edwilliams aviation formula. HOT 1
- double crossTrackDistanceTo( StartX, StartY, StartZ, EndX, EndY, EndZ, PointX, PointY, PointZ ); needed HOT 2
- Something wrong with CrossTrackDistanceTo ? It assumes a line instead of line segment ? HOT 3
- MinimumDistanceToLineSegment( Start, Stop, Point ); HOT 1
- ClosestPointDistanceToClosestPointOnSegment fails for some pairs on globe... see video and code.. any ideas ? HOT 1
- how can i verify the destination point is right?
- intersection between a circle and a great line segment
- World Geographic Reference System (GEOREF) conversion?
- OS Grid Conversion in Jersey and Channel Islands
- MGRS above 84N and below 80S
- Reason for the do...while loop in toLatLon(), utm.js
- Intersection of two paths given start points, bearings and elevations
- Swift conversion - os_tm_eas_nor_to_lat_lon giving the deprecated OSGB36 lat/lon HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geodesy.