Calculate the maximum distance at which two objects can be seen by each other, considering the curvature of the Earth and atmospheric refraction.
0.13 (Standard – often used)
0.17 (Denser Atmosphere)
0.10 (Less Dense Atmosphere)
0 (No Refraction – theoretical)
Maximum Line of Sight Distance
—
meters
Understanding Line of Sight Calculation
The Line of Sight (LOS) calculator helps determine the maximum distance at which an observer can see a target object. This is crucial in various fields such as telecommunications (for microwave links), surveying, aviation, maritime navigation, and even in landscape planning to understand visibility.
The calculation takes into account two primary factors that limit visibility over long distances:
Curvature of the Earth: The Earth is not flat. As distance increases, the horizon drops away, obscuring distant objects.
Atmospheric Refraction: Light rays bend as they pass through the Earth's atmosphere. This bending effect, called refraction, typically causes objects to appear slightly higher than they are, effectively extending the line of sight.
The formula used by this calculator is derived from geometric principles and considers these factors.
The Formula
The distance from an observer (or target) to the horizon, considering the Earth's radius ($R$) and the observer's height ($h$), is approximately given by:
$d_{horizon} \approx \sqrt{2Rh + h^2}$
However, for practical purposes where $h$ is much smaller than $R$, this simplifies to:
$d_{horizon} \approx \sqrt{2Rh}$
To account for atmospheric refraction, we use a factor 'k' (the atmospheric refraction factor) that effectively increases the Earth's radius. The apparent radius of the Earth becomes $R_{eff} = R(1+k)$.
So, the distance to the horizon from a height $h$ is:
The total line of sight distance between two objects (observer height $h_1$ and target height $h_2$) is the sum of their individual distances to the horizon:
Observer Height ($h_1$) and Target Height ($h_2$) are entered in meters.
Earth's Radius ($R$) is entered in kilometers (defaulting to the mean radius).
The Refraction Factor ($k$) is applied. A common value is 0.13.
The calculator first converts all heights to kilometers for consistency with the Earth's radius, then applies the formula, and finally presents the result in both kilometers and meters.
Use Cases:
Telecommunications: Ensuring clear paths for microwave or wireless links between towers.
Radio Communication: Estimating range for VHF/UHF communications.
Maritime and Aviation: Determining visibility distances for navigation.
Surveying and Construction: Planning sightlines for structures, roads, or infrastructure.
Renewable Energy: Assessing placement of wind turbines or solar farms where unobstructed views are needed.
function calculateLineOfSight() {
var observerHeight = parseFloat(document.getElementById("observerHeight").value);
var targetHeight = parseFloat(document.getElementById("targetHeight").value);
var earthRadiusKm = parseFloat(document.getElementById("earthRadius").value);
var refractionFactor = parseFloat(document.getElementById("refractionFactor").value);
var resultDiv = document.getElementById("result");
var resultValue = document.getElementById("result-value");
var resultUnit = document.getElementById("result-unit");
// Clear previous results and styles
resultValue.innerText = "–";
resultUnit.innerText = "meters";
resultValue.style.color = "#28a745"; // Default to success green
// Input validation
if (isNaN(observerHeight) || observerHeight < 0) {
alert("Please enter a valid positive number for Observer Height.");
return;
}
if (isNaN(targetHeight) || targetHeight < 0) {
alert("Please enter a valid positive number for Target Height.");
return;
}
if (isNaN(earthRadiusKm) || earthRadiusKm <= 0) {
alert("Please enter a valid positive number for Earth's Radius.");
return;
}
if (isNaN(refractionFactor) || refractionFactor 0) {
distanceToHorizonObserverKm = Math.sqrt(2 * effectiveEarthRadiusKm * observerHeightKm);
}
// Calculate distance to horizon for target
var distanceToHorizonTargetKm = 0;
if (targetHeightKm > 0) {
distanceToHorizonTargetKm = Math.sqrt(2 * effectiveEarthRadiusKm * targetHeightKm);
}
// Total line of sight distance in kilometers
var totalDistanceKm = distanceToHorizonObserverKm + distanceToHorizonTargetKm;
// Convert total distance to meters for display
var totalDistanceMeters = totalDistanceKm * 1000;
// Display results
if (totalDistanceMeters === 0) {
resultValue.innerText = "0";
resultUnit.innerText = "meters";
} else {
resultValue.innerText = totalDistanceMeters.toFixed(2);
resultUnit.innerText = "meters";
}
// Add a warning if inputs result in a very short or zero distance
if (totalDistanceMeters < 10) { // Arbitrary threshold for a "short" distance
resultValue.style.color = "#dc3545"; // Use danger red for very short distances
}
}