ForHosting KIT · Math

Right triangle altitude

Enter the two legs of a right triangle and get the altitude from the right angle to the hypotenuse: legs of 3 and 4 give an altitude of 2.4, along with the hypotenuse, the area and the two hypotenuse pieces. 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
Leg a
3
Leg b
4
You get
Hypotenuse
5
Altitude to hypotenuse
2.4
Area
6
Segment a
1.8

The altitude from the right angle to the hypotenuse is one of the most useful lengths in plane geometry: it equals the product of the two legs divided by the hypotenuse, and it splits the original triangle into two smaller right triangles that are similar to each other and to the original. Students, tutors, and exam writers need that altitude quickly from known legs without redrawing similar-triangle diagrams by hand. This right triangle altitude calculator accepts the two positive leg lengths that form the right angle, builds the hypotenuse with the Pythagorean theorem, and returns the altitude to the hypotenuse together with the area and the two segments created on the hypotenuse by the altitude foot.

What the altitude to the hypotenuse is and why h = ab/c

In a right triangle the two legs meet at the right angle and the third side is the hypotenuse. Drop a perpendicular from the right-angle vertex to the hypotenuse; the length of that perpendicular is the altitude to the hypotenuse. Because the altitude creates two smaller right triangles that are similar to the original, several geometric mean relations follow at once.

The simplest computational route uses equal area: the area can be written as one half times leg a times leg b, and also as one half times the hypotenuse times the altitude to that hypotenuse. Setting those expressions equal cancels the factor one half and yields the compact identity h equals a times b over c, where c is the hypotenuse. Independently, the Pythagorean theorem supplies c as the square root of a squared plus b squared, so the full pipeline from two legs is deterministic and needs no angles.

The altitude foot also divides the hypotenuse into two segments: the segment adjacent to leg a is a squared over c, and the segment adjacent to leg b is b squared over c. Their product equals h squared, which is the geometric mean theorem stated for the altitude itself. For the classic three-four-five triangle, c is five, h is twelve fifths or two point four, the area is six, and the segments are nine fifths and sixteen fifths.

Where the altitude to the hypotenuse helps

Classrooms and tutoring platforms use a right triangle altitude to hypotenuse calculator so learners can check the geometric mean theorems after they find legs from a word problem or a construction. Failed validation does not consume balance. Keep requests small, pin the rounded altitude in tests, and you get reproducible lengths for homework, LMS plugins, and edge workers without standing up symbolic geometry infrastructure of your own.

Sibling tools cover general right-triangle side and angle solve or orthocenter from coordinates; this landing stays intentionally narrow on the altitude-to-hypotenuse intent.

Classroom geometric mean checks

Let students enter the two legs and verify the altitude to the hypotenuse, area, and hypotenuse segments against textbook geometric mean theorems.

Brace and diagonal clearance scripts

From two known wall legs of a right corner, compute the perpendicular distance from the corner to the diagonal brace without a full CAD geometry stack.

Why is the altitude equal to ab divided by c?

Area can be written as (a·b)/2 and also as (c·h)/2. Equating both forms cancels 1/2 and yields h = (a·b)/c, with c from the Pythagorean theorem.

What is the altitude to the hypotenuse of a 3-4-5 triangle?

It is 2.4. Multiply the legs, 3 times 4, and divide by the hypotenuse of 5. The same triangle has an area of 6.

How long are the two pieces of the hypotenuse?

Each piece is the neighbouring leg squared, divided by the hypotenuse. For legs of 3 and 4 the pieces are 1.8 and 3.2, and together they add back up to 5.

What does the geometric mean theorem say about the altitude?

Multiplying the two pieces of the hypotenuse gives the altitude squared. With pieces of 1.8 and 3.2, the product equals 2.4 squared, which you can check by hand.

Do I need any angles to find the altitude?

No. The two legs are enough: the hypotenuse comes from Pythagoras and the altitude from writing the area in two ways, so no angle enters the calculation.

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/geom/right-triangle-altitude

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/geom/right-triangle-altitude \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"leg_a":3,"leg_b":4}'
{
  "leg_a": 3,
  "leg_b": 4
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "geom.right_triangle_altitude",
  "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.

A negative or zero leg fails with invalid_input so automation never treats an impossible figure as a successful solve.

What the altitude to the hypotenuse is and why h = ab/c

Those closed forms make the problem ideal for a tiny pure-parse API that returns every related length in one response instead of forcing the caller to chain separate hypotenuse and area tools.

Input contract, response shape, and error behaviour

A negative leg is rejected with an explicit message that a negative length is not allowed, matching the product rule that invalid geometric input must not be billed as success. Zero is likewise rejected because a degenerate triangle has no positive altitude to a hypotenuse. POST a JSON body with two required finite numbers: leg_a and leg_b, the positive lengths of the sides that form the right angle. 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 the legs, returns hypotenuse as the Euclidean length sqrt of leg_a squared plus leg_b squared, altitude_to_hypotenuse as the product of the legs divided by that hypotenuse, area as half the product of the legs, and segment_a plus segment_b as the two pieces of the hypotenuse created by the altitude foot. A short formula string restates h equals leg product over hypotenuse for display next to the answer, and method is the fixed token right_triangle_altitude so clients can branch without parsing prose. Example: leg_a equals three and leg_b equals four yields hypotenuse five, altitude two point four, area six, segment_a one point eight, and segment_b three point two. Pair the numbers with your own diagram if you need a sketch; this endpoint solves lengths only and does not emit plots or multi-step narrative beyond the formula field.

Where a right-triangle altitude API earns its keep

CAD and shop-floor scripts often know the two wall lengths of a right corner and need the perpendicular distance from that corner to the diagonal brace; calling a focused parse API avoids pulling a full computer-algebra system for two multiplies and a square root.

Exam and LMS auto-grading

Mark altitude-to-hypotenuse items with a deterministic oracle that rejects negative legs and returns stable rounded lengths for fixtures like 3-4-5.

How do I find the altitude to the hypotenuse from two legs?

Send positive finite numbers leg_a and leg_b. The API computes c = sqrt(leg_a² + leg_b²) and returns altitude_to_hypotenuse = (leg_a · leg_b) / c, plus area and the two hypotenuse segments.

What happens if a leg is negative?

The task fails with invalid_input. A negative length is not a valid right-triangle leg, so the request is not billed as a successful solve.

Does the calculator return the hypotenuse segments as well?

Yes. segment_a = leg_a² / hypotenuse and segment_b = leg_b² / hypotenuse are the pieces created by the altitude foot, and their product equals the altitude squared.

What does the right triangle altitude 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 →