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
use super::*;

mod ops;
pub use ops::*;

mod cartesian_impl;
pub use cartesian_impl::*;

mod polar_impl;
pub use polar_impl::*;

#[derive(PartialEq, PartialOrd, Eq, Copy, Clone, Debug, Default)]
#[repr(C)]
pub struct Cartesian<T> {
    /// Real part.
    pub re: T,
    /// Imaginary part.
    pub im: T,
}

#[derive(PartialEq, PartialOrd, Eq, Copy, Clone, Debug, Default)]
#[repr(C)]
/// Polar complex nuber.
pub struct Polar<T> {
    // Magnitude
    pub mag: T,
    // Angle [rad]
    pub ang: T,
}