ForHosting KIT · Math

cos⁻¹(x) calculator

Enter a cosine between -1 and 1 and get the angle back: 0.5 gives 60 degrees, or 1.047197551197 radians. Both units appear side by side, always in the 0 to 180 degree range, ready for a triangle or the angle between two vectors. 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
Value
0.5
You get
Input
0.5
Radians
1.0471975512
Degrees
60

The arccosine calculator takes a value between -1 and 1 and returns the angle whose cosine equals that value, in both radians and degrees. Arccosine — written cos⁻¹(x) or acos(x) — is the inverse of the cosine function, and it is how you recover an angle when what you know is a ratio: the length of two sides of a triangle, the dot product of two vectors, or a correlation-like quantity. Instead of reaching for a scientific calculator or firing up a spreadsheet, you send one number and get the angle back, rounded to twelve decimals so the result is identical on every machine.

What arccosine actually computes

Cosine maps an angle to a ratio: cos(θ) = adjacent over hypotenuse. The arccosine calculator runs that mapping backwards. You hand it the ratio — any real number from -1 to 1 — and it hands back the angle in the principal range from 0 to π radians, which is 0 to 180 degrees.

That range convention matters: acos(1) is 0, acos(0) is π/2 (90°), and acos(-1) is π (180°). Because the answer is always the principal value, the result is unambiguous and matches what every standard library, scientific calculator and textbook returns.

Valid input and why the domain stops at ±1

The cosine of a real angle can only ever land between -1 and 1, so the inverse function is only defined on that interval. Arccosine usually appears in the middle of a longer computation — normalizing a dot product, solving a triangle, checking a rotation — where a quiet bad value would corrupt everything after it. Failing fast, with a message you can log, is what makes the result safe to chain.

Deterministic results you can assert on

Floating-point arithmetic is famously picky: acos(0.5) times 180/π is 59.99999999999999 on paper-perfect math, and different CPUs can disagree in the last bit. That is fine for a display but terrible for a test suite or an audit trail, so the calculator rounds both outputs to twelve decimal places before returning them.

There is no randomness, no clock, no network call and no hidden state anywhere in the computation, which also means it is trivially cacheable: if you ask for the arccosine of the same value a million times, every answer is the same object. That determinism is what lets you assert on the output directly and store it in a log you can trust later.

Angle between two vectors

From a normalized dot product, θ = acos(a·b / (|a||b|)) — get the angle in degrees or radians in one call.

Solve a right triangle

Given the adjacent side and hypotenuse, recover the angle with acos(adjacent/hypotenuse) instead of a table.

Validate geometry data in a pipeline

Reject out-of-domain ratios early: an input outside [-1, 1] fails with a clear error instead of a silent NaN.

What input does it accept?

A single finite number between -1 and 1 inclusive, in the value field.

What range is the angle returned in?

The principal range of arccosine: 0 to π radians (0 to 180 degrees). Both units are always returned.

Why does acos(2) fail instead of returning a value?

Because no real angle has a cosine of 2. The domain of arccosine is [-1, 1]; out-of-domain input is a data error, and the calculator reports it rather than returning NaN.

Is my input stored?

No. The value is processed in memory and discarded; only the computed angle is returned.

How do I find an angle of a right triangle with arccosine?

Divide the side next to the angle by the hypotenuse and enter that ratio. The result is the angle between those two sides, given in degrees and radians, so a ratio of 0.5 means 60 degrees.

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/cos-1

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/cos-1 \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"value":0.5}'
{
  "value": 0.5
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "math.cos_1",
  "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 same code that powers the API runs free in your browser on this page.

What arccosine actually computes

The endpoint reports the angle twice — once in radians, the unit mathematics and most programming languages work in, and once in degrees, the unit geometry problems, navigation and engineering drawings are usually expressed in — so you never have to multiply by 180/π yourself or wonder whether you already did.

Valid input and why the domain stops at ±1

Asking for acos(2) is not a hard problem, it is a meaningless one — no real angle has that cosine — and the calculator says so with a clear invalid_input error instead of returning NaN and letting the failure travel silently downstream into your pipeline. The same goes for non-numeric input: the value must be a finite number, so null, missing fields, strings that do not parse, Infinity and NaN are all rejected with a message that tells you exactly what went wrong. This strictness is deliberate.

Deterministic results you can assert on

Twelve decimals keeps essentially all practical precision — far beyond any physical measurement — while absorbing the last-ulp differences between machines, so the same request produces byte-identical JSON everywhere: in your browser, in the API, in a CI run.

What does it cost?

$0.002 per request via the API. It is also free to run in your browser on this page.

How precise is the result?

Both radians and degrees are computed with IEEE 754 double precision and rounded to 12 decimal places, so the output is stable and identical across machines.

Read the full KIT documentation →