ForHosting KIT · Math

Triangle height from base and two base angles calculator

A base of 10 with two 45° angles gives a height of 5. Enter the base and the angles at its ends to get the perpendicular height, the angle at the top and the area in one step. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Base
10
Angle a
45
Angle b
45
You get
Angle a deg
45
Angle b deg
45
Apex angle deg
90
Height
5

When you know the length of one side of a triangle and the two angles that sit at the ends of that side, the altitude from the opposite vertex down to the base line is fixed by elementary trigonometry. Surveyors, roof designers, CAD scripts, and algebra students all hit the same question: given base length and the two base angles, what is the perpendicular height of the apex? This calculator applies the classic tangent identity h equals base times tan of alpha times tan of beta over tan of alpha plus tan of beta, returns that height together with the apex angle and the triangle area, and fails cleanly when the angles cannot form a triangle.

The tangent formula for apex height above a base

Drop a perpendicular from the apex to the line that contains the base. That altitude of length h splits the configuration into two right triangles that share the height. At the left base angle alpha, tan of alpha equals h over the adjacent base-line segment next to that vertex; at the right base angle beta, tan of beta equals h over the other segment.

Solving for h immediately yields h equals base times tan alpha times tan beta divided by tan alpha plus tan beta. The same identity rearranges into the numerically stabler product of sines form h equals base times sin alpha times sin beta over sin of alpha plus beta, which this implementation uses so that a base angle near ninety degrees does not blow up intermediate tangents.

When one base angle is obtuse the foot of the altitude falls outside the base segment, one segment becomes negative, and the formula still returns a positive height above the base line because the signed tangents keep the algebra consistent. The apex angle is simply one hundred eighty degrees minus alpha minus beta; requiring that sum to be strictly less than one hundred eighty degrees guarantees a positive third angle and a non-degenerate triangle.

Where the apex height is needed

Architecture and civil drafting often specify a span and the two pitch or batter angles at its ends; converting that description into a clear height is a one-line trig step that should not require a full CAD kernel. Roofing and tent layouts, triangular lot setbacks, and truss design notebooks all need the same apex height so material take-offs and clearance checks stay honest.

Classroom and tutoring platforms use a triangle height from base and two base angles calculator so learners can verify homework without memorising which form of the identity to use when one angle is obtuse. Exam generators and LMS plugins need a deterministic oracle that rejects impossible angle sums instead of inventing a hollow zero height. Failed validation does not consume balance.

Keep requests small, pin the rounded height in tests, and you get reproducible apex heights for homework, LMS plugins, and edge workers without standing up a geometry library of your own.

Roof pitch and span to ridge height

Convert a horizontal span and the two end pitch angles into the ridge height for framing, clearance, and material estimates.

Classroom triangle altitude checks

Let students submit base length and two base angles and verify the apex height and area against textbook tangent methods.

Survey and lot setback scripts

Compute perpendicular height of a triangular boundary from a known baseline and measured base angles without a full GIS stack.

How do I find triangle height from base and two base angles?

Send positive base and the two base angles in degrees (each between 0 and 180, sum under 180).

Does the formula work when one base angle is obtuse?

Yes. The signed tangent form still yields a positive height above the base line; one foot segment is negative because the altitude falls outside the base segment.

What height does a base of 10 with two 45° angles give?

The height is 5. The angle at the top is 90° and the area is 25, and the foot of the height splits the base into two equal parts of 5.

Why are two base angles that add up to 180° or more rejected?

Because the third angle would be zero or negative, so the sides never meet at a top point and there is no triangle. The two base angles must add up to less than 180°.

Does it also give the angle at the top and the area?

Yes. The angle at the top is 180° minus the two base angles, and the area comes with the height, so one entry gives you all three numbers together.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/trig/triangle-height-two-angles

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/trig/triangle-height-two-angles \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"base":10,"angle_a":45,"angle_b":45}'
{
  "base": 10,
  "angle_a": 45,
  "angle_b": 45
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "trig.triangle_height_two_angles",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

The tangent formula for apex height above a base

The two segments therefore equal h over tan alpha and h over tan beta, and their sum must equal the given base length whenever both base angles are acute and the foot falls between the endpoints.

Input contract, response fields, and validation errors

Base must be strictly greater than zero. Each angle must lie strictly between zero and one hundred eighty degrees, and their sum must be strictly less than one hundred eighty degrees so the apex remains positive. Those failures are not billed. Example: base ten with both base angles forty-five degrees yields height five, apex ninety degrees, and area twenty-five. POST a JSON body with three required finite numbers: base, the positive length of the side that carries the two known angles; angle_a, the base angle in degrees at one end of that side; and angle_b, the base angle in degrees at the other end. Each field may arrive as a JSON number or as a numeric string; missing fields, empty strings, and non-finite values fail with invalid_input naming the field. On success the body echoes base, angle_a_deg, and angle_b_deg; reports apex_angle_deg as one hundred eighty minus the two base angles; returns height as the perpendicular distance from the apex to the base line; returns area as one half times base times height; and returns segment_a and segment_b as the signed base-line distances from each base vertex to the foot of the altitude. The formula field restates the tangent identity for display next to the answer, and unit_angles is always deg. Pair the numbers with your own diagram code if you need a sketch; this endpoint solves for height and related scalars only.

What angle unit does the calculator use?

Degrees only. angle_a and angle_b are base angles in degrees; the response sets unit_angles to deg and reports apex_angle_deg in degrees.

What if the two base angles sum to 180° or more?

The task fails with invalid_input. A triangle needs a positive apex angle, so angle_a + angle_b must be strictly less than 180°.

What does the triangle height calculator cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →