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

Closest point #167

Merged
merged 6 commits into from
Sep 24, 2017
Merged

Closest point #167

merged 6 commits into from
Sep 24, 2017

Conversation

Michael-F-Bryan
Copy link
Contributor

@Michael-F-Bryan Michael-F-Bryan commented Sep 21, 2017

The initial implementation of a ClosestPoint algorithm. The trait itself looks something like this:

pub trait ClosestPoint<F: Float, Rhs = Point<F>> {
    fn closest_point(&self, other: &Rhs) -> Closest<F>;
}

pub enum Closest<F: Float> {
    Intersection(Point<F>),
    SinglePoint(Point<F>),
    Indeterminate,
}

If you can think of a better name for Closest please let me know (names are hard!).

(fixes #161)

@Michael-F-Bryan
Copy link
Contributor Author

I've finished off most of the ClosestPoint impls where the right hand side is a Point. Luckily I was able to find a generic way to do things early on, so that eliminated loads of boilerplate.

@Michael-F-Bryan Michael-F-Bryan changed the title WIP: Closest point Closest point Sep 21, 2017
@frewsxcv
Copy link
Member

looks great!

bors r+

bors bot added a commit that referenced this pull request Sep 24, 2017
167: Closest point r=frewsxcv a=Michael-F-Bryan

The initial implementation of a `ClosestPoint` algorithm. The trait itself looks something like this:

```rust
pub trait ClosestPoint<F: Float, Rhs = Point<F>> {
    fn closest_point(&self, other: &Rhs) -> Closest<F>;
}

pub enum Closest<F: Float> {
    Intersection(Point<F>),
    SinglePoint(Point<F>),
    Indeterminate,
}
```

If you can think of a better name for `Closest` please let me know (names are hard!).

(fixes #161)
@bors
Copy link
Contributor

bors bot commented Sep 24, 2017

Build succeeded

@bors bors bot merged commit 6faf090 into georust:master Sep 24, 2017
@Michael-F-Bryan Michael-F-Bryan deleted the closest-point branch September 24, 2017 10:45
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.

Closest Point
2 participants