use crate::coord::{Coord, CoordInt};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct Point3<T: CoordInt> {
pub x: Coord<T>,
pub y: Coord<T>,
pub z: Coord<T>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct Point2<T: CoordInt> {
pub x: Coord<T>,
pub y: Coord<T>,
}
impl<T: CoordInt> Point3<T> {
pub const fn new(x: Coord<T>, y: Coord<T>, z: Coord<T>) -> Self {
Self { x, y, z }
}
#[must_use]
pub const fn origin() -> Self {
Self { x: Coord::ZERO, y: Coord::ZERO, z: Coord::ZERO }
}
}
impl<T: CoordInt> Point2<T> {
pub const fn new(x: Coord<T>, y: Coord<T>) -> Self {
Self { x, y }
}
#[must_use]
pub const fn origin() -> Self {
Self { x: Coord::ZERO, y: Coord::ZERO }
}
}