geo/algorithm/intersects/
point.rs

1use super::Intersects;
2use crate::*;
3
4// Blanket implementation from Coord<T>
5impl<T, G> Intersects<G> for Point<T>
6where
7    T: CoordNum,
8    Coord<T>: Intersects<G>,
9{
10    fn intersects(&self, rhs: &G) -> bool {
11        self.0.intersects(rhs)
12    }
13}
14
15// Blanket implementation from Point<T>
16impl<T, G> Intersects<G> for MultiPoint<T>
17where
18    T: CoordNum,
19    Point<T>: Intersects<G>,
20{
21    fn intersects(&self, rhs: &G) -> bool {
22        self.iter().any(|p| p.intersects(rhs))
23    }
24}
25
26symmetric_intersects_impl!(Coord<T>, MultiPoint<T>);
27symmetric_intersects_impl!(Line<T>, MultiPoint<T>);
28symmetric_intersects_impl!(Triangle<T>, MultiPoint<T>);
29symmetric_intersects_impl!(Polygon<T>, MultiPoint<T>);