viewof tof_time_ms = Inputs.range([0, 100], {
value: 67.33,
step: 0.01,
label: "Signal Travel Time (ms)"
})
viewof tof_speed_of_light = Inputs.select(
[299792.458, 299792, 300000],
{
value: 299792.458,
label: "Speed of Light (km/s)",
format: x => x === 299792.458 ? "Exact (299,792.458)" : x === 299792 ? "Approx (299,792)" : "Rounded (300,000)"
}
)
tof_distance_km = (tof_time_ms / 1000) * tof_speed_of_light
html`<div style="padding: 12px; background: #f8f9fa; border-left: 4px solid #16A085; margin: 12px 0;">
<strong style="color: #2C3E50;">Distance:</strong>
<span style="color: #E67E22; font-size: 1.2em; font-weight: bold;">${tof_distance_km.toFixed(2)} km</span>
<span style="color: #7F8C8D; margin-left: 8px;">(${(tof_distance_km * 1000).toFixed(0)} meters)</span>
</div>`Time of Flight to Distance
Time of Flight to Distance
animation
gps
location
Try Change Signal Travel Time (ms) to 67.33.
Observe Watch Distance after you press Calculate.
Explain Describe how Calculate multiplies speed of light by time of flight.
Technical boundaries. Distance is speed of light multiplied by reception time minus transmission time. The calculation uses speed of light in vacuum.
Distance Calculation:
Distance = Speed of Light × Time of Flight
d = c × Δt
where:
- c = 299,792,458 m/s (speed of light in vacuum)
- Δt = reception time - transmission time
NoteTime of Flight to Distance
Try it: Adjust the signal travel time to see how distance changes. GPS satellites orbit at ~20,200 km altitude, so typical travel times are 67-68 milliseconds.