1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
pub mod xy;
pub mod xyz;
// TODO: comments / doctest
// TODO: tests with f64, f32, fixed point
// TODO: checked operations
// TODO: fixed point support
// TODO: SIMD support
// TODO: approximate equality for fixed point?
// TODO: add relative_eq for tuples for simpler assertions

use std::{
    fmt::{Debug, Display},
    ops::{Add, AddAssign, Div, Mul, Neg, Sub, SubAssign},
};

pub use xy::XYVec;
pub use xyz::XYZVec;

pub trait CordicPhantomTrait {}
impl<Frac> CordicPhantomTrait for fixed::FixedI8<Frac> {}
impl<Frac> CordicPhantomTrait for fixed::FixedI16<Frac> {}
impl<Frac> CordicPhantomTrait for fixed::FixedI32<Frac> {}
impl<Frac> CordicPhantomTrait for fixed::FixedI64<Frac> {}

pub trait VecInner:
    Clone
    + Copy
    + Sized
    + Debug
    + Display
    + Add<Output = Self>
    + AddAssign
    + Sub<Output = Self>
    + SubAssign
    + Mul<Output = Self>
    + Div<Output = Self>
    + Neg<Output = Self>
{
}
impl<
        V: Clone
            + Copy
            + Sized
            + Debug
            + Display
            + Add<Output = Self>
            + AddAssign
            + Sub<Output = Self>
            + SubAssign
            + Mul<Output = Self>
            + Div<Output = Self>
            + Neg<Output = Self>,
    > VecInner for V
{
}