use geo::algorithm::contains::Contains;
use geo::algorithm::euclidean_distance::EuclideanDistance;
use geo::algorithm::intersects::Intersects;
use geo::{Coordinate, Line, LineString, Point, Polygon, Rect, Triangle};
#[allow(non_snake_case)]
pub trait Relates<T> {
fn Contains(&self, other: &T) -> bool;
fn Intersects(&self, other: &T) -> bool;
fn EuclideanDistance(&self, other: &T) -> f64;
}
#[allow(clippy::many_single_char_names)]
fn rect_points(r: &Rect<f64>) -> [Coordinate<f64>; 4] {
let a = r.min();
let c = r.max();
let b: Coordinate<f64> = (a.x, c.y).into();
let d: Coordinate<f64> = (c.x, a.y).into();
[a, b, c, d]
}
#[allow(clippy::many_single_char_names)]
fn rect_lines(r: &Rect<f64>) -> [Line<f64>; 4] {
let [a, b, c, d] = rect_points(r);
[
Line::new(a, b),
Line::new(b, c),
Line::new(c, d),
Line::new(d, a),
]
}
include!("relates_impl.rs");