Skip to content

Conversation

@szakarias
Copy link
Contributor

No description provided.

Copy link
Contributor

@sigurdm sigurdm left a 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);
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this more precise?

Suggested change
/// Calculates closest point from [point] to line defined by [startPoint] and
/// Calculates closest point to [point] on the line segment between[startPoint] and

Copy link
Contributor Author

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.

@szakarias szakarias merged commit eab7a94 into dart-lang:master Feb 25, 2025
31 checks passed
isoos pushed a commit to isoos/pub-dev that referenced this pull request Mar 5, 2025
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

Successfully merging this pull request may close these issues.

3 participants