-
Notifications
You must be signed in to change notification settings - Fork 166
Downloads chart: Add helper function for computing closest point on line #8584
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
Conversation
sigurdm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few nits, but LGTM
| if (t < 0 || t > 1) { | ||
| // Closest point is before or after the line. This should not happen in | ||
| // our use case. | ||
| return (double.maxFinite, double.maxFinite); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it should not happen perhaps it is better to throw?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not mathematically invalid, just not relevant in our use case. I updated the documentation a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But isn't (double.maxFinite, double.maxFinite) the wrong answer in that case?
| return (ranges: ranges, weekLists: result.reversed.toList()); | ||
| } | ||
|
|
||
| /// Calculates closest point from [point] to line defined by [startPoint] and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this more precise?
| /// Calculates closest point from [point] to line defined by [startPoint] and | |
| /// Calculates closest point to [point] on the line segment between[startPoint] and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the comment a to something more similiar.
No description provided.