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
//! 4D (spatio-temporal) geodesy in pure `f64`, built on [`geo3d`].
//!
//! The fourth dimension is **time**. `geo3d` answers *where is this?*; `geo4d` answers *where is
//! this, when is it there, and how does the Earth itself move underneath it in the meantime?* It adds
//! the time axis to the 3D geometry and nothing else — the ellipsoids, ECEF/ENU frames, geodesics and
//! static volumes are `geo3d`'s, re-exported here so a program needs only one dependency.
//!
//! - [`Epoch`] / [`Duration`] — a high-precision atomic clock: nanosecond-exact, `Ord`, stored on
//! [`TAI`](TimeScale::Tai) so arithmetic never trips over leap seconds. Converts to and from
//! [`Gps`](TimeScale::Gps), [`Tt`](TimeScale::Tt), [`Utc`](TimeScale::Utc), Julian dates, GPS
//! week/time-of-week, calendars and ITRF decimal years.
//! - [`Geodetic4`] / [`Ecef4`] / [`StateVector`] — a position, or a position and velocity, bound to
//! an [`Epoch`]. A point is not a point in space-time until it carries a time.
//! - [`Trajectory`] — a time-ordered path with linear, cubic-[`Hermite`](Interpolation::Hermite) or
//! [`CatmullRom`](Interpolation::CatmullRom) interpolation and an explicit [`Extrapolation`] policy.
//! - [`PlateMotion`] / [`Helmert14`] — the Earth moving: propagate a coordinate across epochs along
//! its tectonic plate (ITRF2020 model), and transform between time-dependent reference frames
//! (ITRF, GDA2020) with a 14-parameter Helmert.
//! - [`closest_approach`], [`conflict`], [`intercept`], [`collision_probability`] — 4D kinematics in
//! absolute time: time of closest approach, cylindrical conflict windows, fixed-speed intercept,
//! and the probability of collision (Chan's series on the encounter plane).
//! - [`Timed`] / [`Volume4`] — box any `geo3d` volume into a [`TimeWindow`] for 4D geofencing, and
//! test whether a [`Trajectory`] enters it.
//!
//! Angles are **degrees**, lengths **metres**, times **seconds** (or a [`Duration`]) at the API.
//! Everything except [`Trajectory`] is `Copy` and allocation-free, and the whole crate is
//! `#![forbid(unsafe_code)]`.
//!
//! ```
//! use geo4d::{conflict, Duration, Epoch, Geodetic4, ProtectedZone, TimeWindow};
//!
//! // Two aircraft, each a position + course-over-ground at a shared time.
//! let now = Epoch::from_gregorian_utc(2026, 3, 14, 9, 30, 0.0);
//! let a = Geodetic4::from_lat_lon(-33.80, 151.30, 2_500.0, now)
//! .state_from_course(geo4d::Course::new(225.0, 240.0, 0.0)); // SW at 240 m/s
//! let b = Geodetic4::from_lat_lon(-33.95, 151.10, 2_450.0, now)
//! .state_from_course(geo4d::Course::new(45.0, 250.0, 0.0)); // NE at 250 m/s
//!
//! // When do they pass closest, and is 5 NM / 1000 ft ever breached in the next 10 minutes?
//! let cpa = a.closest_approach(b);
//! let zone = ProtectedZone::new(9_260.0, 300.0);
//! let window = TimeWindow::for_duration(now, Duration::from_minutes(10.0));
//! if let Some(c) = a.conflict(b, zone, window) {
//! assert!(c.enters >= now && c.duration().as_seconds() > 0.0);
//! }
//! assert!(cpa.tca >= now);
//! ```
/// Every Rust code block in the README is compiled and run as a doctest.
;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
// ── Re-exports of the geo3d 3D geometry geo4d builds on ──────────────────────────────────────────────
//
// So a program can `use geo4d::{Geodetic, WGS84, Sphere, ...}` and never name geo3d directly. The
// whole crate is also available as `geo4d::geo3d` for anything not surfaced here.
pub use geo3d;
pub use Aer;
pub use ;