Skip to main content

Module time_dilation

Module time_dilation 

Source
Expand description

Time dilation effects for special and general relativity.

Structs§

ClockComparison
Visualize two clocks at different velocities/heights side by side.
DilatedClock
A clock experiencing time dilation due to velocity.
TimeDilationRenderer
Render clocks with tick rate proportional to proper time rate.

Functions§

gps_time_correction
Compute the GPS time correction needed per day. Combines special relativistic (velocity) and general relativistic (gravity) effects. Returns the correction in seconds per day.
gravitational_time_dilation
Gravitational time dilation (weak field approximation). dt_high / dt_low = 1 + g*h/c^2 (to first order). Returns the fractional time difference for height_diff.
integrated_proper_time
Multi-step time dilation for a clock undergoing varying velocity. Takes a series of (duration, velocity) segments and returns total proper time.
muon_lifetime
Dilated muon lifetime. Rest lifetime ~ 2.2 microseconds. Returns the dilated lifetime at speed v.
muon_travel_distance
Distance a muon can travel at speed v given dilated lifetime.
time_dilation_factor
Time dilation factor: returns gamma. Proper time interval = coordinate time / gamma.
twin_paradox
Twin paradox calculation. Given a distance (one way) and travel speed v, returns (traveler_time, stay_at_home_time). Assumes instantaneous turnaround.