Solve for speed, duration, or distance using the d = rt formula
Distance (d)
Rate / Speed (r)
Time / Duration (t)
Calculated Result:
Understanding the Rate, Time, and Distance Formula
In physics and mathematics, the relationship between how fast an object moves, how long it moves for, and the distance it covers is defined by a simple algebraic equation. This is often referred to as the d = rt formula.
The Basic Equations
Distance (d) = Rate × Time: Used to find how far you have traveled.
Rate (r) = Distance ÷ Time: Used to find your average speed.
Time (t) = Distance ÷ Rate: Used to find how long a journey will take.
Examples of Usage
Scenario
Formula Used
Calculation
Driving at 65 mph for 3 hours
d = r * t
65 * 3 = 195 miles
Running 10 miles in 2 hours
r = d / t
10 / 2 = 5 mph
Flying 1200 miles at 400 mph
t = d / r
1200 / 400 = 3 hours
Important Note on Units
When using this calculator, ensure that your units are consistent. For example, if your Rate is in miles per hour (mph), your Time must be in hours for the resulting Distance to be in miles. If your time is in minutes, you should convert it to a decimal fraction of an hour (e.g., 30 minutes = 0.5 hours) before calculating.
function updateRTCFields() {
var mode = document.getElementById("rtc-solve-for").value;
var label1 = document.getElementById("rtc-label-1");
var label2 = document.getElementById("rtc-label-2");
var input1 = document.getElementById("rtc-input-1");
var input2 = document.getElementById("rtc-input-2");
input1.value = "";
input2.value = "";
document.getElementById("rtc-result-area").style.display = "none";
if (mode === "distance") {
label1.innerText = "Rate (Speed)";
label2.innerText = "Time (Duration)";
input1.placeholder = "e.g. 60";
input2.placeholder = "e.g. 2";
} else if (mode === "rate") {
label1.innerText = "Distance";
label2.innerText = "Time (Duration)";
input1.placeholder = "e.g. 120";
input2.placeholder = "e.g. 2";
} else if (mode === "time") {
label1.innerText = "Distance";
label2.innerText = "Rate (Speed)";
input1.placeholder = "e.g. 120";
input2.placeholder = "e.g. 60";
}
}
function calculateRTC() {
var mode = document.getElementById("rtc-solve-for").value;
var val1 = parseFloat(document.getElementById("rtc-input-1").value);
var val2 = parseFloat(document.getElementById("rtc-input-2").value);
var resultDisplay = document.getElementById("rtc-result-area");
var finalVal = document.getElementById("rtc-final-value");
var explanation = document.getElementById("rtc-explanation");
if (isNaN(val1) || isNaN(val2) || val1 <= 0 || val2 <= 0) {
alert("Please enter valid positive numbers for both fields.");
return;
}
var result = 0;
var unitType = "";
if (mode === "distance") {
result = val1 * val2;
unitType = "Units";
explanation.innerText = "Formula: Distance = " + val1 + " (Rate) × " + val2 + " (Time)";
} else if (mode === "rate") {
result = val1 / val2;
unitType = "Units/Time";
explanation.innerText = "Formula: Rate = " + val1 + " (Distance) ÷ " + val2 + " (Time)";
} else if (mode === "time") {
result = val1 / val2;
unitType = "Time Units";
explanation.innerText = "Formula: Time = " + val1 + " (Distance) ÷ " + val2 + " (Rate)";
}
finalVal.innerText = Number(result.toFixed(2)).toLocaleString() + " " + unitType;
resultDisplay.style.display = "block";
}