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
//! Compare, calculate, and transform spacial coordinates

mod frames;
mod lookup;

use measurements::{Angle, Distance};

pub use frames::*;
pub use lookup::*;

/// Horizontal coordinates expressed as (altitude, azimuth)
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct HorizontalCoord {
    /// The altitude angle
    pub alt: Angle,
    /// The azimuth angle
    pub az: Angle,
}

impl Default for HorizontalCoord {
    fn default() -> Self {
        HorizontalCoord {
            alt: Angle::from_radians(0.0),
            az: Angle::from_radians(0.0),
        }
    }
}

/// Equitorial coordinates expressed as (right ascension, declination)
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct EquatorialCoord {
    /// The right ascension angle
    pub ra: Angle,
    /// The declination angle
    pub dec: Angle,
}

impl Default for EquatorialCoord {
    fn default() -> Self {
        Self {
            ra: Angle::from_radians(0.0),
            dec: Angle::from_radians(0.0),
        }
    }
}

/// Coordinates that represent a location on Earth.
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct EarthLocation {
    /// The latitude coordinate
    pub lat: Angle,
    /// The longitude coordinate
    pub lon: Angle,
    /// The height of the location
    pub height: Distance,
}

impl Default for EarthLocation {
    fn default() -> Self {
        Self {
            lat: Angle::from_radians(0.0),
            lon: Angle::from_radians(0.0),
            height: Distance::from_meters(0.0),
        }
    }
}