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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
use super::*;

mod circle;
mod circle3d;
mod convert;
mod ellipse;

/// A circle defined by center and radius.
#[cfg_attr(feature = "serde", repr(C), derive(Serialize, Deserialize))]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct Circle<T> {
    /// The center points of the circle.
    pub center: Point<T>,
    /// The radius of the circle.
    pub radius: T,
}

/// A circle in 3D space defined by center and radius.
#[cfg_attr(feature = "serde", repr(C), derive(Serialize, Deserialize))]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct Circle3D<T> {
    /// The center points of the circle.
    pub center: Point3D<T>,
    pub radius: T,
    pub rotate: (T, T, T),
}

/// An ellipse defined by center and axes.
#[cfg_attr(feature = "serde", repr(C), derive(Serialize, Deserialize))]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct Ellipse<T> {
    /// The center points of the ellipse.
    pub center: Point<T>,
    /// The axes of the ellipse.
    pub radius: (T, T),
    /// The rotation of the ellipse.
    pub rotate: T,
}

/// A ellipse in 3D space defined by center and radius.
#[cfg_attr(feature = "serde", repr(C), derive(Serialize, Deserialize))]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct Ellipse3D<T> {
    /// The center points of the ellipse in 3D space.
    pub center: Point3D<T>,
    /// The axes of the ellipse.
    pub radius: (T, T),
    /// The rotation of the ellipse in 3D space.
    pub rotate: (T, T, T),
}

/// A Ball in 3D space
#[cfg_attr(feature = "serde", repr(C), derive(Serialize, Deserialize))]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct Ball<T> {
    /// The coordinates of the center point of the ball
    pub center: Point3D<T>,
    /// The radius of the ball
    pub radius: T,
}

#[cfg_attr(feature = "serde", repr(C), derive(Serialize, Deserialize))]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct Ellipsoid<T> {
    /// The coordinates of the center point of the ellipsoid
    pub center: Point3D<T>,
    /// The radius from x, y, z axes
    pub radius: (T, T, T),
    /// The rotate from a, b, y corner
    pub rotate: (T, T, T),
}