ForHosting KIT · Math

Law of cosines angle finder

Turn three side lengths into all three angles: sides 3, 4 and 5 give exactly 90° opposite the longest side and two acute angles at the other corners. Lengths that cannot close a triangle are refused. 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
Length of side a
3
Length of side b
4
Length of side c
5
You get
Angle a
36.8698976458
Angle b
53.1301023542
Angle c
90
Unit angles
deg

When you know all three sides of a plane triangle and need the interior angles, the law of cosines is the closed-form tool that recovers them without drawing or iteration. This calculator accepts three positive side lengths, checks the strict triangle inequality so the figure can actually close, then applies the cosine formula opposite each side and returns the three angles in degrees.

How the law of cosines finds every angle from three sides

In a plane triangle the law of cosines relates each side to the cosine of the angle opposite it: the square of side a equals the square of b plus the square of c minus twice b c times the cosine of angle A, and the same identity cycles for the other vertices. Solving for the cosine of angle A yields cosine of A equals b squared plus c squared minus a squared, all over two b c.

Taking the inverse cosine of that value gives angle A in radians; converting to degrees multiplies by one hundred eighty over pi. The same formula with cycled sides produces angles B and C. Because every quantity is algebraic after the three square multiplications and the three inverse cosines, the path is fully deterministic: the same three positive sides always produce the same three angles within floating-point rounding.

Classic classroom checks include the three-four-five right triangle, where the angle opposite five is exactly ninety degrees and the other two are the well-known arctangent pair that sum with ninety to one hundred eighty. Equilateral sides of equal length yield sixty degrees at every vertex. Obtuse cases appear when one side is long enough that its opposite cosine is negative, which the inverse cosine reports correctly as an angle greater than ninety degrees.

What you send and what you get back

After parsing, the service checks that every side is strictly positive and that the strict triangle inequality holds: a plus b greater than c, a plus c greater than b, and b plus c greater than a. If any of those sums fails, the error message names the three side values so form clients and scripts can correct the input without guessing whether equality was the issue or which pair was short.

Example checks: sides three, four, and five yield ninety degrees opposite the hypotenuse and acute angles opposite the legs; sides one, one, and three fail the triangle inequality; a zero or negative side fails the same way. Cosine values are clamped into the closed interval from negative one to one before inverse cosine so near-valid floating-point drift does not produce NaN.

Wire the free browser tool for quick sanity checks, then call the identical contract from scripts when you need bulk SSS angle recovery without reimplementing the inequality gate in every language.

Where SSS angle recovery shows up in real work

Secondary-school and college trigonometry courses constantly ask students to find the angles of a triangle when only the three side lengths are known; a trusted calculator with a strict triangle-inequality check speeds homework grading and removes spreadsheet mistakes where someone applies arccos to a cosine slightly outside the legal range. Surveying and construction workflows often measure all three sides of a plot or truss and need interior angles before staking bearings or cutting joints—having a shared numeric oracle keeps field notes and office scripts aligned.

Game and graphics tutorials use SSS when three edge lengths define a mesh face; recovering the angles supports normal estimation, UV layout, and constraint debugging without a full constraint solver. If you later need ASA, SAS, AAS, SSA ambiguous cases, area from sides, or radian input and output, treat those as separate search intents rather than overloading this law-of-cosines angle landing.

Homework and exam checks

Find all three interior angles from SSS side lengths and reject triangle-inequality failures with a clear error instead of NaN.

Survey and construction triangles

From three measured sides of a plot or truss, recover interior angles before staking bearings or cutting joints.

What does this calculator compute?

Given three side lengths (SSS), it returns all three interior angles in degrees using the law of cosines.

What formula does it use?

cos A = (b² + c² − a²) / (2bc), then A = arccos(that value) in degrees, and the same formula cycled for angles B and C.

What happens if the sides break the triangle inequality?

A plane triangle requires the sum of any two sides to be strictly greater than the third.

What does it cost?

The browser tool is free and runs locally.

Can the law of cosines give an obtuse angle?

Yes. When one side is long enough, the cosine of the angle opposite it turns negative, and the result is an angle greater than 90°. Acute, right and obtuse triangles are all handled by the same formula.

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/law-of-cosines-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/trig/law-of-cosines-angle \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"side_a":3,"side_b":4,"side_c":5}'
{
  "side_a": 3,
  "side_b": 4,
  "side_c": 5
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "trig.law_of_cosines_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.

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.

Degenerate cases—non-positive sides, non-finite values, or lengths that break the triangle inequality—are rejected with a clear invalid_input error instead of a silent NaN or a set of angles that do not sum to one hundred eighty degrees. The free browser tool and the paid API share one pure function, so classroom demos and automated pipelines never silently diverge on the same inputs.

What you send and what you get back

Provide three required finite numbers: side_a (aliases a, A, side1), side_b (aliases b, B, side2), and side_c (aliases c, C, side3), each a positive length in any consistent linear unit. Missing fields, non-numeric strings, NaN, and Infinity are rejected with invalid_input and are not charged. On success the JSON response echoes the normalized sides, returns angle_a opposite side_a, angle_b opposite side_b, and angle_c opposite side_c in degrees, sets unit_angles to deg, and includes method as the string law_of_cosines for documentation in logs and teaching UIs.

Where SSS angle recovery shows up in real work

Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance.

Mesh and game geometry helpers

Recover face angles when three edge lengths are known, using the same law-of-cosines path in browser and API.

Are angles in degrees or radians?

Degrees only. The response includes unit_angles: "deg". Convert to radians yourself after the call if your pipeline needs radians.

Read the full KIT documentation →