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

There is a bug in the project method of the LineSegment class #707

Open
wenshinlee opened this issue Sep 12, 2023 · 2 comments
Open

There is a bug in the project method of the LineSegment class #707

wenshinlee opened this issue Sep 12, 2023 · 2 comments

Comments

@wenshinlee
Copy link

LineSegment line1 = new(new Coordinate(0, 0), new Coordinate(0, double.MaxValue)); ;
Coordinate coordinate1 = new Coordinate(20, 10);
Coordinate coord = line1.Project(coordinate1);

coord is (NAN, NAN)

@wenshinlee
Copy link
Author

In fact, the coordinates of coord should be (0,10).

@FObermaier
Copy link
Member

NTS fails to compute a projection factor when the squared length of a line segment is greater than double.MaxValue.
This is an edge case, do you really need double.MaxValue as ordinate or is that just convenient?

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

2 participants