ForHosting KIT · Math

Triangle side from two sides and included angle

Sides of 3 and 4 with a 90° angle between them leave a third side of 5. Enter two sides and the angle they enclose, in degrees, and get the opposite side from the law of cosines, whether the angle is acute, right or obtuse. 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
Side a
3
Side b
4
Angle
90
You get
Unknown side
5

A triangle-side calculator that uses the law of cosines recovers the unknown side opposite an included angle when the two enclosing sides are already known. Surveyors, carpentry layouts, and trigonometry homework all reduce to the same closed form: the square of the unknown side equals the sum of the squares of the given sides minus twice their product times the cosine of the included angle.

What the law of cosines computes for two sides and the included angle

The law of cosines relates the three sides of any Euclidean triangle to the cosine of one interior angle. When the known data are two sides and the angle they enclose, the identity is written for the opposite unknown side: the square of that unknown side equals the sum of the squares of the given sides minus twice their product times the cosine of the included angle. Taking the positive square root yields the side length this calculator returns.

The same formula covers acute, right, and obtuse included angles because cosine is positive, zero, or negative in those three ranges, so an obtuse included angle automatically lengthens the opposite side. A right included angle reduces the identity to the Pythagorean theorem, which is why a three-four-ninety input recovers an unknown side of five. The included angle must be an interior angle of a non-degenerate triangle, which means it is strictly greater than zero degrees and strictly less than one hundred eighty degrees.

Zero or one hundred eighty would flatten the figure into a line segment; an angle outside that open interval is not an interior angle at all. Both given sides must be positive finite lengths in the same unit. This landing returns only the unknown side length, the echoed inputs, and the formula string: it does not compute the remaining angles or the area, so the page stays aligned with the search for a triangle side from two sides and the included angle rather than a full SAS triangle solver.

Where the law of cosines saves time

Classrooms and tutoring platforms use a law-of-cosines side calculator so learners can verify the missing opposite length without mixing sine and cosine or forgetting to convert degrees to radians. Construction and layout tools convert two measured members plus a stated included corner into the remaining span before ordering stock or setting a brace.

Survey and GIS sketches often know two legs of a traverse and the interior angle at the station: the same identity recovers the closing side without opening a full triangle solver that also dumps area and leftover angles the caller does not want. Game engines and physics sandboxes spawn a third edge from whichever two sides the designer already stored and the included heading the art brief named.

Exam generators and LMS plugins need a deterministic oracle that rejects an angle of zero, one hundred eighty, or two hundred instead of taking a wrapped remainder and marking a flattened figure as a valid triangle. The landing is deliberately narrower than a full SAS solver: it does not return the remaining angles or the area, so the page stays aligned with the search for the unknown side alone.

Classroom law-of-cosines checks

Students enter two sides and the included angle to verify the missing opposite length against textbook SAS exercises, including the right-angle case that reduces to Pythagoras.

Brace or span from two members and a corner

Convert two measured members plus a stated included corner into the remaining span before ordering stock, cutting a brace, or setting a traverse closing side.

Exam and LMS auto-grading

Mark SAS-side items with a deterministic oracle that rejects an included angle outside 0 to 180 degrees instead of wrapping or taking absolute values.

What happens if the included angle is not between 0 and 180 degrees?

An included interior angle must be strictly between 0 and 180 degrees to form a non-degenerate triangle; those failures are not billed.

Is this the same as the law of sines or a full SAS triangle solver?

No. This landing recovers only the unknown side opposite the included angle via the law of cosines. It does not take an opposite side-angle pair (law of sines) and it does not return the remaining angles or the area.

Does a 90-degree included angle use Pythagoras?

Yes, as a special case. A 3-4-90 input therefore returns 5.

What is the law of cosines formula for a missing side?

The square of the missing side equals the sum of the squares of the two known sides minus twice their product times the cosine of the angle between them. The side itself is the positive square root of that value.

Why does an obtuse angle make the third side longer?

Because the cosine of an angle above 90° is negative, so the last term of the formula adds length instead of taking it away. The wider the angle between the two sides, the longer the side that closes the triangle.

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/math/triangle-side-angle

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/math/triangle-side-angle \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"side_a":3,"side_b":4,"angle":90}'
{
  "side_a": 3,
  "side_b": 4,
  "angle": 90
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "math.triangle_side_angle",
  "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.

max_side1000000000000
min_angle_deg0
max_angle_deg180
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.

This endpoint accepts those two positive lengths and one interior angle in degrees, applies that identity, and returns the unknown side length. An angle that is not strictly between 0 and 180 degrees cannot sit inside a non-degenerate triangle, so the task fails with invalid_input and is not billed.

Input contract, response shape, and error behaviour

Example: two equal sides of five with an included angle of sixty recover the remaining side of a rhombus-cut isosceles triangle. You supply both sides and the included angle already in one consistent length unit and in degrees. POST a JSON body with three required finite numbers: side_a and side_b, the two known positive lengths that enclose the given angle, and angle, the included interior angle in degrees. Each field may arrive as a JSON number or as a numeric string. Field side_a also accepts the aliases a and side1; side_b accepts b and side2; angle accepts included_angle, angle_c, and C. A missing field, an empty string, Infinity, NaN, or a token that is not a decimal number fails with invalid_input naming the field. A given side that is zero or negative fails with invalid_input stating that a positive finite side length is required. An included angle that is not strictly between 0 and 180 degrees fails with invalid_input stating that the angle must be between 0 and 180 degrees; those validation failures are not billed. On success the body returns unknown_side as the recovered length, echoes the two sides and the included angle, restates the identity in the formula field, and sets method to law_of_cosines so clients can distinguish this landing from a law-of-sines pair or an angle-from-three-sides inversion. Example: side_a equals three, side_b equals four, and angle equals ninety yields unknown_side five. Pair the structured JSON with your own drawing code if you need a sketch; this endpoint returns numbers only and does not emit SVG or unit conversion.

Where a triangle side-from-angle API earns its keep

Keep requests small, pin the rounded unknown_side in tests, and you get reproducible geometry for homework, edge workers, and design scripts without standing up symbolic math infrastructure of your own.

How do I find a triangle side from two sides and the included angle?

Send two positive finite sides (side_a, side_b) and the included interior angle in degrees (angle). The API returns unknown_side = sqrt(side_a² + side_b² − 2·side_a·side_b·cos(angle)).

What does the triangle side-from-angle 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 →