geo/algorithm/intersects/
point.rs1use super::Intersects;
2use crate::*;
3
4impl<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
15impl<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>);