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
148
149
150
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2026 Vallés Puig, Ramon
//! # Trackable, Zero-Cost Object Abstraction
//!
//! The [`Trackable`] trait represents "anything that can produce coordinates
//! at an arbitrary time *t*". It separates the *object* (a star, a planet,
//! a fixed direction …) from the *coordinate sample* ([`CoordinateWithPM`]).
//!
//! ## Design
//!
//! * **Associated type** `Coords`, each implementor chooses its natural output
//! type, so the trait is zero-cost through monomorphization.
//! * **No `&mut self`**, tracking is a pure, stateless query.
//! * **Static dispatch**, callers write `fn foo<T: Trackable>(t: &T)` and pay
//! no dynamic-dispatch overhead.
//!
//! ## Implementors
//!
//! | Type | `Coords` | Backing engine |
//! |------|----------|----------------|
//! | `direction::ICRS` | `direction::ICRS` | identity (fixed direction) |
//! | `CoordinateWithPM<T>` | `T` | identity (returns stored position) |
//! | `Star` | `direction::ICRS` | extracts RA/Dec from stored coordinate |
//! | `Sun`, `Mercury` … `Neptune` | `CoordinateWithPM<Position<Bary, Ecl, AU>>` | VSOP87 |
//! | `Moon` | `Position<Geocentric, Ecl, Km>` | ELP2000 |
//!
//! The implementations for `Star` and solar-system bodies live in the `bodies`
//! module to keep `targets` free of `bodies` dependencies.
use cratedirection;
use crateJulianDate;
use CoordinateWithPM;
// =============================================================================
// Trait Definition
// =============================================================================
/// Anything that can produce coordinates at an arbitrary epoch.
///
/// This is the central abstraction that separates *objects* (which evolve in
/// time) from *coordinate samples* (a single snapshot).
///
/// # Example
///
/// ```rust
/// use siderust::targets::Trackable;
/// use siderust::bodies::solar_system::Mars;
/// use siderust::time::JulianDate;
///
/// let pos = Mars.track(JulianDate::J2000);
/// println!("Mars at J2000: {:?}", pos);
/// ```
// =============================================================================
// Implementation: direction::ICRS (fixed direction, identity)
// =============================================================================
// =============================================================================
// Implementation: CoordinateWithPM<T> (identity, returns stored position)
// =============================================================================
// =============================================================================
// Implementation: Star (extracts RA/Dec from stored coordinate)
// =============================================================================
// NOTE: impl Trackable for Star<'_> lives in bodies/stars.rs to avoid a
// bodies ↔ targets circular dependency.
// =============================================================================
// Implementations: Solar-system unit types (VSOP87 / ELP2000)
// =============================================================================
// NOTE: impl_trackable_vsop87! and impl Trackable for Moon live in
// bodies/solar_system.rs for the same reason.
// =============================================================================
// Tests
// =============================================================================