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

Geometry_Engine: Edge case for FitLine with three equidistant points #3278

Closed
peterjamesnugent opened this issue Feb 2, 2024 · 0 comments · Fixed by #3280
Closed

Geometry_Engine: Edge case for FitLine with three equidistant points #3278

peterjamesnugent opened this issue Feb 2, 2024 · 0 comments · Fixed by #3280
Assignees
Labels
type:bug Error or unexpected behaviour

Comments

@peterjamesnugent
Copy link
Member

peterjamesnugent commented Feb 2, 2024

Description:

With three equidistant points you can this line:

double b = (p1 + Math.Sqrt(p1 * p1 + 4 * p2 * p2)) / (2 * p2);

To produce NaN because you're dividing by 0, i.e. p2 = 0.

Steps to reproduce:

See test script.

Expected behaviour:

A line through the middle of all three points.

Test file(s):

#3278-FitLineEdgeCase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Error or unexpected behaviour
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants