{
    "name": "Right Triangle Calculator",
    "url": "https://calculators.geekmidst.com/calculators/right-triangle-calculator",
    "markdown": "https://calculators.geekmidst.com/calculators/right-triangle-calculator.md",
    "category": "Algebra, geometry & advanced math",
    "description": "Solve a right triangle from two legs, a leg and the hypotenuse, or a side and an angle: all three sides, both angles, area, perimeter and altitude.",
    "summary": "Two measurements, at least one of them a side, fix a right triangle completely. Trigonometry and the Pythagorean theorem give everything else.",
    "also_called": [
        "Right-angled triangle calculator",
        "Right triangle solver"
    ],
    "applies_to": "Worldwide",
    "last_updated": "2026-10-29",
    "computation": "Results are computed in the visitor’s browser on the HTML page. This API describes the calculator; it does not compute results.",
    "inputs": [
        {
            "name": "known",
            "label": "I know",
            "type": "select",
            "default": "legs",
            "options": {
                "legs": "Both legs (a and b)",
                "leg_hyp": "A leg and the hypotenuse",
                "hyp_angle": "The hypotenuse and an angle",
                "leg_angle": "A leg and its opposite angle"
            }
        },
        {
            "name": "a",
            "label": "Leg a",
            "type": "number",
            "default": "3",
            "shown_when": {
                "known": "legs"
            }
        },
        {
            "name": "b",
            "label": "Leg b",
            "type": "number",
            "default": "4",
            "shown_when": {
                "known": "legs"
            }
        },
        {
            "name": "a2",
            "label": "Leg a",
            "type": "number",
            "default": "3",
            "shown_when": {
                "known": "leg_hyp"
            }
        },
        {
            "name": "c2",
            "label": "Hypotenuse c",
            "type": "number",
            "default": "5",
            "shown_when": {
                "known": "leg_hyp"
            }
        },
        {
            "name": "c3",
            "label": "Hypotenuse c",
            "type": "number",
            "default": "5",
            "shown_when": {
                "known": "hyp_angle"
            }
        },
        {
            "name": "angle3",
            "label": "Angle A (opposite leg a)",
            "type": "number",
            "default": "30",
            "unit": "°",
            "shown_when": {
                "known": "hyp_angle"
            }
        },
        {
            "name": "a4",
            "label": "Leg a",
            "type": "number",
            "default": "3",
            "shown_when": {
                "known": "leg_angle"
            }
        },
        {
            "name": "angle4",
            "label": "Angle A (opposite leg a)",
            "type": "number",
            "default": "30",
            "unit": "°",
            "shown_when": {
                "known": "leg_angle"
            }
        }
    ],
    "outputs": [
        {
            "key": "c",
            "label": "Hypotenuse c",
            "format": "number"
        },
        {
            "key": "a",
            "label": "Leg a",
            "format": "number"
        },
        {
            "key": "b",
            "label": "Leg b",
            "format": "number"
        },
        {
            "key": "angle_a",
            "label": "Angle A",
            "format": "number"
        },
        {
            "key": "angle_b",
            "label": "Angle B",
            "format": "number"
        },
        {
            "key": "area",
            "label": "Area",
            "format": "number"
        },
        {
            "key": "perimeter",
            "label": "Perimeter",
            "format": "number"
        },
        {
            "key": "altitude",
            "label": "Altitude to the hypotenuse",
            "format": "number"
        },
        {
            "key": "inradius",
            "label": "Inradius",
            "format": "number"
        }
    ],
    "formula": {
        "text": "c² = a² + b²;  sin A = a ÷ c, cos A = b ÷ c, tan A = a ÷ b;  B = 90° − A;  area = ab ÷ 2;  altitude = ab ÷ c;  inradius = (a + b − c) ÷ 2",
        "variables": {
            "a, b": "legs",
            "c": "hypotenuse",
            "A": "angle opposite a",
            "B": "angle opposite b"
        }
    },
    "worked_example": {
        "inputs": {
            "known": "legs",
            "a": "3",
            "b": "4",
            "a2": "3",
            "c2": "5",
            "c3": "5",
            "angle3": "30",
            "a4": "3",
            "angle4": "30"
        },
        "steps": [
            "c = √(3² + 4²) = 5.",
            "A = arctan(3 ÷ 4) = 36.8699°, so B = 90° − 36.8699° = 53.1301°.",
            "Area = 3 × 4 ÷ 2 = 6; perimeter = 3 + 4 + 5 = 12; altitude = 12 ÷ 5 = 2.4."
        ],
        "result": "The 3-4-5 right triangle has angles of about 36.87° and 53.13°, area 6 and perimeter 12."
    },
    "interpretation": "Angles are in degrees. The two acute angles always add up to 90°, so knowing one gives the other.",
    "assumptions": [
        "One angle is exactly 90°; angle A is opposite leg a."
    ],
    "limitations": [
        "Two angles alone fix only the shape, not the size, so at least one side is required."
    ],
    "rules": null,
    "faqs": [
        {
            "question": "What does SOH CAH TOA mean?",
            "answer": "Sine = Opposite ÷ Hypotenuse, Cosine = Adjacent ÷ Hypotenuse, Tangent = Opposite ÷ Adjacent. They relate an angle to the sides around it."
        },
        {
            "question": "How do I find a roof pitch angle?",
            "answer": "Treat the rise and the run as the two legs. The pitch angle is arctan(rise ÷ run), which is angle A when a is the rise and b the run."
        }
    ],
    "sources": [],
    "related": [
        {
            "name": "Pythagorean Theorem Calculator",
            "url": "https://calculators.geekmidst.com/calculators/pythagorean-theorem-calculator"
        },
        {
            "name": "Distance Calculator",
            "url": "https://calculators.geekmidst.com/calculators/distance-calculator"
        },
        {
            "name": "Circle Calculator",
            "url": "https://calculators.geekmidst.com/calculators/circle-calculator"
        }
    ],
    "disclaimer": null,
    "publisher": "GM¹X CalcVerse"
}