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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2026 Vallés Puig, Ramon
//! # Astronomical Units (siderust extensions)
//!
//! Astronomical time units that are not already shipped by [`qtty`], in
//! particular the **Gaussian year** used to express orbital periods in the
//! heliocentric AU-day system.
//!
//! ## Scientific scope
//!
//! Two "year" units are widely used in astronomy: the **sidereal year**
//! (≈ 365.256 363 004 d, the actual measured period of Earth relative to
//! the fixed stars) and the **Julian year** (365.25 d exactly, used for
//! Julian centuries). Both are provided by `qtty`. This module adds the
//! **Gaussian year**, the period implied by Gauss's gravitational constant
//! `k = 0.01720209895 AU^{3/2} d^{-1}`. It is the natural time unit for
//! Kepler's third law in the AU-day system, since for a test particle at
//! 1 AU `T_Gaussian = 2π / k ≈ 365.256 898 326 d` and
//! `T [gyr] = a [AU]^{3/2}`. It differs from the sidereal year by ≈ 46 s
//! because `k` encodes only the Sun + test-particle two-body problem.
//!
//! ## Technical scope
//!
//! The unit is implemented as a zero-sized `GaussianYear` type implementing
//! the [`Unit`] trait of [`qtty`], with `RATIO = 365.256 898 326 × 86 400`
//! seconds and dimension [`Time`]. The corresponding quantity alias
//! [`GaussianYears`] supports the standard `qtty` conversion machinery
//! (`.to::<Day>()`, `.to::<Second>()`, …) and is interoperable with every
//! other time unit in the crate.
//!
//! ## References
//!
//! * Gauss, C. F., *Theoria Motus Corporum Coelestium* (1809)
//! * Seidelmann, *Explanatory Supplement to the Astronomical Almanac*,
//! §8 (time units)
//! * IAU 2012 Resolution B2 (redefinition of the astronomical unit)
use crate;
// ─────────────────────────────────────────────────────────────────────────────
// GaussianYear — unit definition
// ─────────────────────────────────────────────────────────────────────────────
/// The **Gaussian year**: the orbital period implied by the Gaussian
/// gravitational constant `k = 0.01720209895 AU^{3/2} d^{-1}`.
///
/// ```text
/// T_Gaussian = 2π / k ≈ 365.256 898 326 d ≈ 31 558 196.0 s
/// ```
///
/// This is the natural time unit for Kepler's third law in the AU-day system:
///
/// ```text
/// T [Gaussian years] = a [AU]^{3/2}
/// ```
///
/// Use [`GaussianYears`] for values and `.to::<Day>()` (or any other
/// [`qtty`] time unit) for unit-safe conversion.
;
/// Seconds in one Gaussian year (`2π / k * 86 400`, where `k = 0.01720209895`).
pub const GAUSSIAN_YEAR_SECONDS: f64 = 365.256_898_326 * 86_400.0;
/// A quantity measured in Gaussian years.
///
/// Supports `.to::<Day>()`, `.to::<Second>()`, etc., via the standard `qtty`
/// unit-conversion machinery.
///
/// # Example
///
/// ```rust
/// use siderust::astro::units::GaussianYears;
/// use siderust::qtty::time::Day;
///
/// // Earth's orbital period via Kepler's 3rd law (a = 1 AU → T = 1 Gaussian year).
/// let period_days = GaussianYears::new(1.0).to::<Day>();
/// assert!((period_days.value() - 365.256_898_326).abs() < 1e-9);
/// ```
pub type GaussianYears = ;
/// One Gaussian year as a typed constant.
pub const GAUSSIAN_YEAR: GaussianYears = new;
// ─────────────────────────────────────────────────────────────────────────────
// Tests
// ─────────────────────────────────────────────────────────────────────────────