Use this if you already have the ratio (Opposite / Adjacent)
Angle in Degrees: 0°
Angle in Radians: 0 rad
function calculateArctan() {
var opp = document.getElementById("oppositeSide").value;
var adj = document.getElementById("adjacentSide").value;
var ratioInput = document.getElementById("tanValueInput").value;
var resultDiv = document.getElementById("arctanResult");
var resDeg = document.getElementById("resDegrees");
var resRad = document.getElementById("resRadians");
var tanValue;
// Logic: If user provides ratio directly, use that. Otherwise use sides.
if (ratioInput !== "") {
tanValue = parseFloat(ratioInput);
} else if (opp !== "" && adj !== "") {
var o = parseFloat(opp);
var a = parseFloat(adj);
if (a === 0) {
alert("Adjacent side cannot be zero (division by zero error).");
return;
}
tanValue = o / a;
} else {
alert("Please enter either both sides or the tangent value.");
return;
}
if (isNaN(tanValue)) {
alert("Please enter valid numeric values.");
return;
}
// Calculate Arctan (result in radians)
var radians = Math.atan(tanValue);
// Convert to Degrees
var degrees = radians * (180 / Math.PI);
// Display Results
resDeg.innerHTML = degrees.toFixed(4);
resRad.innerHTML = radians.toFixed(4);
resultDiv.style.display = "block";
}
Understanding the Tan Inverse (Arctan) Function
The Tan Inverse Calculator, also known as the Arctan calculator, is a fundamental tool in trigonometry used to find the angle of a right-angled triangle when the lengths of the opposite and adjacent sides are known. While the tangent function (tan) gives you the ratio of sides for a given angle, the inverse tangent function (tan⁻¹) does the exact opposite: it takes the ratio and returns the angle.
The Tan Inverse Formula
In a right-angled triangle, the relationship between the angle (θ) and the sides is defined as:
tan(θ) = Opposite / Adjacent
To solve for the angle, we apply the inverse tangent to both sides:
θ = tan⁻¹(Opposite / Adjacent)
How to Use the Calculator
Our calculator provides two ways to find your angle:
Using Side Lengths: Enter the length of the "Opposite" side (the side across from the angle) and the "Adjacent" side (the side next to the angle, but not the hypotenuse).
Using a Ratio: If you already know the tangent value (e.g., 0.75 or 1.5), simply enter it into the "Tangent Value" field.
Practical Example
Imagine you are building a wooden ramp. You know the height of the deck (Opposite side) is 3 feet and the horizontal distance the ramp covers (Adjacent side) is 10 feet. To find the angle of the incline:
Calculate the ratio: 3 / 10 = 0.3.
Input 3 for Opposite and 10 for Adjacent (or 0.3 for Tangent Value).
The result is approximately 16.70 degrees.
Degrees vs. Radians
In mathematics and engineering, angles can be expressed in two primary units:
Degrees: Most common in construction, navigation, and basic geometry (0° to 360°).
Radians: Preferred in calculus and advanced physics. One full circle is 2π radians. Our calculator provides both outputs instantly to ensure you have the precise data needed for your project.