Skip to main content

MinkowskiTime

Struct MinkowskiTime 

Source
pub struct MinkowskiTime<R>
where R: RealField,
{ /* private fields */ }
Expand description

The coordinate time t of an inertial frame of Minkowski spacetime, counted in time_scale units.

An event of Minkowski spacetime has coordinates (t, x, y, z) in an inertial frame, with x⁰ = ct (Carroll 1997, eq. (1.5)). Unlike the absolute time of a classical spacetime, t depends on the frame: whether two events are simultaneous depends on the coordinates used (Carroll 1997, §1, after eq. (1.4)). The frame-independent quantity is the interval, which MinkowskiSpacetime computes.

A translation x^μ → x^μ + a^μ leaves the interval unchanged (Carroll 1997, eq. (1.10)), so the zero of t is a choice. Adjustable accepts any finite coordinate time, zero and negative included, and refuses NaN and infinity.

§Example

use deep_causality_context::{Identifiable, MinkowskiTime, Temporal, TimeScale};

let t = MinkowskiTime::new(1, TimeScale::Second, core::f64::consts::E);

assert_eq!(t.id(), 1);
assert_eq!(t.time_scale(), TimeScale::Second);

§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.

Implementations§

Source§

impl<R: RealField> MinkowskiTime<R>

Source

pub fn new(id: ContextoidId, time_scale: TimeScale, time_unit: R) -> Self

Trait Implementations§

Source§

impl<R: RealField + Default> Adjustable<R> for MinkowskiTime<R>

Source§

fn update<const W: usize, const H: usize, const D: usize, const C: usize>( &mut self, array_grid: &ArrayGrid<R, W, H, D, C>, ) -> Result<(), UpdateError>

The default implementation does nothing to keep update optional. Override this method to implement a node update when needed. For a sample implementation, see src/types/context_types/node_types_adjustable
Source§

fn adjust<const W: usize, const H: usize, const D: usize, const C: usize>( &mut self, array_grid: &ArrayGrid<R, W, H, D, C>, ) -> Result<(), AdjustmentError>

The default implementation does nothing to keep adjustment optional. Override this method to implement a node adjustment when needed. Depending on the type of node adjustment, select a 1, 2,3, or 4 dimensional array grid that contains the transformation data to apply to the node. For a sample implementation, see src/types/context_types/node_types_adjustable
Source§

impl<R> Clone for MinkowskiTime<R>
where R: RealField + Clone,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<R> Copy for MinkowskiTime<R>
where R: RealField + Copy,

Source§

impl<R> Debug for MinkowskiTime<R>
where R: RealField + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<R: RealField + Display + Debug> Display for MinkowskiTime<R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<R: RealField> From<MinkowskiTime<R>> for TimeKind<R>

Source§

fn from(t: MinkowskiTime<R>) -> Self

Converts to this type from the input type.
Source§

impl<R: RealField> Identifiable for MinkowskiTime<R>

Source§

fn id(&self) -> ContextoidId

Returns the unique id of this item.
Source§

impl<R> PartialEq for MinkowskiTime<R>
where R: RealField + PartialEq,

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<R: RealField + Into<f64> + FromPrimitive> Recordable<TimeRecord> for MinkowskiTime<R>

Source§

fn to_record(&self) -> Result<TimeRecord, ProjectionError>

The node as a record.
Source§

fn from_record( id: ContextoidId, record: TimeRecord, ) -> Result<Self, ProjectionError>

The node a record describes, under the given identifier.
Source§

impl<R: RealField + Default> ScalarProjector for MinkowskiTime<R>

Source§

type Scalar = R

The scalar value extracted from the input (must implement ScalarValue)
Source§

fn project(&self) -> Self::Scalar

Extracts a scalar from self.
Source§

impl<R> StructuralPartialEq for MinkowskiTime<R>
where R: RealField + PartialEq,

Source§

impl<R: RealField> Temporal for MinkowskiTime<R>

Source§

type TimeUnit = R

The type this node’s time is measured in.
Source§

fn time_scale(&self) -> TimeScale

Returns the unit scale of time (e.g. TimeScale::Milliseconds).
Source§

fn time_unit(&self) -> R

Returns the time unit value (e.g. 0, 100, 32768).

Auto Trait Implementations§

§

impl<R> Freeze for MinkowskiTime<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for MinkowskiTime<R>
where R: RefUnwindSafe,

§

impl<R> Send for MinkowskiTime<R>
where R: Send,

§

impl<R> Sync for MinkowskiTime<R>
where R: Sync,

§

impl<R> Unpin for MinkowskiTime<R>
where R: Unpin,

§

impl<R> UnsafeUnpin for MinkowskiTime<R>
where R: UnsafeUnpin,

§

impl<R> UnwindSafe for MinkowskiTime<R>
where R: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<Borrowed> SampleBorrow<Borrowed> for Borrowed

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.