mixed_num/
complex.rs

1use super::*;
2
3mod ops;
4pub use ops::*;
5
6mod cartesian_impl;
7pub use cartesian_impl::*;
8
9mod polar_impl;
10pub use polar_impl::*;
11
12#[derive(PartialEq, PartialOrd, Eq, Copy, Clone, Debug, Default)]
13#[repr(C)]
14/// Cartesian complex number.
15pub struct Cartesian<T> {
16    /// Real part.
17    pub re: T,
18    /// Imaginary part.
19    pub im: T,
20}
21
22#[derive(PartialEq, PartialOrd, Eq, Copy, Clone, Debug, Default)]
23#[repr(C)]
24/// Polar complex number.
25pub struct Polar<T> {
26    // Magnitude
27    pub mag: T,
28    // Angle [rad]
29    pub ang: T,
30}