Skip to content
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

Something wrong with CrossTrackDistanceTo ? It assumes a line instead of line segment ? #109

Closed
SkybuckFlying opened this issue Feb 16, 2023 · 3 comments

Comments

@SkybuckFlying
Copy link

SkybuckFlying commented Feb 16, 2023

When trying to calculate the distance to the start stop segment this function's implementation seems to ignore the line segment concept.

In other words, this math assumes the start to stop is a line throughout the universe or in this case throughout the sphere, basically and endless line which wraps itself around the earth infinityly...

I need a version of this function which will respect the line segment concept and return a larger distance if the point is beyond the start and stop points...

(I ported the C++ code version to Delphi pretty well, but so far my visualizations show this function seems to compute an infinite line across the sphere... )

@SkybuckFlying SkybuckFlying changed the title Something wrong with CrossTrackDistanceTo ? It seems to go beyond the start and stop points/segment Something wrong with CrossTrackDistanceTo ? It assumes a line instead of line segment ? Feb 16, 2023
@SkybuckFlying
Copy link
Author

Maybe I or you can combine the AtTrackDistance and the CrossTrackDistance to make a function that behaves like a line segment... hmmm...

@SkybuckFlying
Copy link
Author

Or maybe that is what isWithinExtent is for ? hmmm...

@SkybuckFlying
Copy link
Author

SkybuckFlying commented Feb 16, 2023

Another idea could be to use:

nearestPointOnSegment to compute the point which is closest on that segment...

then compute DistanceTo(closestPointOnSegment)

I think this should work for what I want.

Closing this for now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant