use core::fmt::Display;
use nalgebra::Vector3;
use crate::Real;
#[derive(Debug)]
pub struct Point<T> {
pub(crate) val: Vector3<T>,
}
impl<T> Display for Point<T>
where
T: Display + Real,
{
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
self.val.fmt(f)
}
}
impl<T> Point<T> {
pub fn new(x: T, y: T, z: T) -> Self {
Self {
val: Vector3::new(x, y, z),
}
}
}
impl<T: Copy> Point<T> {
pub fn x(&self) -> T {
self.val[0]
}
pub fn y(&self) -> T {
self.val[1]
}
pub fn z(&self) -> T {
self.val[2]
}
}