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
/*
* SPDX-License-Identifier: MIT
* Copyright (c) 2023 - 2026. The DeepCausality Authors and Contributors. All Rights Reserved.
*/
use crateCoordinate;
use crateMetricSignature;
use crateSpatial;
use crateTemporal;
use RealField;
use Identifiable;
use ;
/// An event of a spacetime: a node with a position and a time.
///
/// Every four-dimensional spacetime of this crate indexes its coordinates
/// `0 => t, 1 => x, 2 => y, 3 => z`, the order of Carroll 1997, eq. (1.5), with `t` at index 0
/// where Carroll places `x⁰ = ct`. `t()` is the time coordinate, counted in the unit
/// [`Temporal::time_scale`] names. What the time means is set by the geometry: absolute time in a
/// classical spacetime, the coordinate time of a frame in a relativistic one. [`MetricSignature`]
/// reports which. [`NoSpaceTime`](crate::NoSpaceTime) has zero coordinates, and its `t()` is `()`.
/// The interval between two events of Minkowski spacetime,
///
/// ```text
/// s² = −(cΔt)² + Δx² + Δy² + Δz²
/// ```
///
/// with `t` in seconds, positions in metres and `c = 299 792 458 m/s` (Carroll 1997, eq. (1.3),
/// in the east-coast convention of eq. (1.8)). The interval is negative between timelike
/// separated events, zero between null separated ones and positive between spacelike separated
/// ones (Carroll 1997, §1, after eq. (1.9)). An implementor whose metric is not Minkowski's
/// overrides [`interval_squared`](Self::interval_squared), as
/// [`TangentSpacetime`](crate::TangentSpacetime) does.
///
/// # Required methods
/// - `time()`: the time coordinate in seconds, or NaN when the node's time names no duration
/// - `position()`: `[x, y, z]` in metres
///
/// # References
/// - Carroll, S. M. (1997). *Lecture Notes on General Relativity*. arXiv:gr-qc/9712019, ch. 1.
/// Copy: `papers/carroll_1997_lecture_notes_on_general_relativity_arXiv_gr-qc_9712019.pdf`.
///
/// # The scalar
/// The interval is measured in the same scalar the type's coordinates are, so this trait reads it
/// from [`Coordinate::Coord`] rather than declaring one of its own. A second associated type would
/// let a spacetime report its position in one scalar and its interval in another.