use crate::{Scalar, Map, euclidean::Euclidean3};
pub trait Geometry<T: Scalar = f64>: Clone + 'static {
type Pos: Clone;
type Dir: Clone;
type Map: Map<Self::Pos, Self::Dir>;
fn origin() -> Self::Pos;
fn default_dir() -> Self::Dir;
fn length(a: Self::Pos) -> T;
fn distance(a: Self::Pos, b: Self::Pos) -> T;
}
pub trait Geometry3<T: Scalar = f64>: Geometry<T> {
fn dir_to_local(pos: Self::Pos, dir: Self::Dir) -> <Euclidean3<T> as Geometry<T>>::Dir;
fn dir_from_local(pos: Self::Pos, dir: <Euclidean3<T> as Geometry<T>>::Dir) -> Self::Dir;
fn dir_when_moved_at_pos(src_pos: Self::Pos, src_dir: Self::Dir, dst_pos: Self::Pos) -> Self::Dir;
fn shift_x(dist: T) -> Self::Map;
fn shift_y(dist: T) -> Self::Map;
fn shift_z(dist: T) -> Self::Map;
fn rotate_x(angle: T) -> Self::Map;
fn rotate_y(angle: T) -> Self::Map;
fn rotate_z(angle: T) -> Self::Map;
fn look_at_pos(pos: Self::Pos) -> Self::Map;
fn look_at_dir(dir: Self::Dir) -> Self::Map;
fn move_at_pos(pos: Self::Pos) -> Self::Map;
fn move_at_dir(dir: Self::Dir, dist: T) -> Self::Map;
}