Exact value of trig functions
A calculator shows sin 45° as 0.70710678; this gives you the exact √2/2 that textbooks and exams expect. It covers all six trig functions at the standard unit-circle angles, in degrees or radians, with a 12-decimal check beside each answer. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Function
- cos
- Angle
- 45
- Angle degrees
- 45
- Angle radians
- π/4
- Exact
- √2/2
- Decimal
- 0.7071067812
Send a function name and an angle in degrees or radians and get back the value as a radical or rational string — like √2/2 or √3/3 — with a 12-decimal approximation and the normalized angle on the unit circle. No floating-point drift, no calculator rounding, just the closed-form answer your textbook expects.
Why exact values matter more than decimals
A calculator will happily tell you that sin(45°) is 0.70710678, but that decimal is only an approximation of the real answer, √2/2. In algebra, precalculus, physics and engineering, the radical form is what actually matters: it cancels in later steps, it proves an identity, and it is what exams and textbooks ask for. This capability returns the exact value of trig functions as closed-form strings — 1/2, √3/2, 2√3/3, √2 — instead of leaving you to recognize a long decimal by eye.
You send a function name and a standard angle, and you get the value your teacher would write on the board, together with a decimal approximation rounded to twelve places for sanity checking. Because the result is a string plus a normalized angle, downstream code can display it, compare it, or feed it into a symbolic pipeline without any floating-point ambiguity.
Which angles and functions are covered
The accepted angles are the sixteen standard points of the unit circle: 0°, 30°, 45°, 60°, 90° and every coterminal multiple up to 330° — that is 120°, 135°, 150°, 180°, 210°, 225°, 240°, 270°, 300°, 315° and 330°, or their radian equivalents such as π/6, 3π/4 and 7π/4. Any of the six trigonometric functions works: sin, cos and tan directly, and csc, sec and cot as exact reciprocals, so csc(30°) comes back as 2 and sec(45°) as √2 rather than an unexplained decimal.
Angles are normalized before lookup, so −45°, 315° and 7π/4 all resolve to the same point. Signs follow the quadrant automatically through the ASTC rule, which means sin(210°) correctly returns −1/2. Values that do not exist — like tan(90°) or csc(180°) — come back with defined set to false instead of an invented infinity.
Reciprocal values are always rationalized the way a textbook writes them: you get 2√3/3 for sec(30°), never the unsimplified 2/√3 that a naive reciprocal would produce.
How the computation works and what it costs
The implementation is a deterministic table lookup, not a numerical solver. Your angle is reduced modulo 360°, checked against the standard set, mapped to its acute reference angle, and combined with a quadrant sign; reciprocal functions are derived from the same table with rationalized forms like 2√3/3. There is no network call, no randomness and no date dependence, so the same input always produces byte-identical output — which is exactly what you want when the answer feeds an automated grader or a symbolic math pipeline.
What you can do with it
Check homework answers instantly
Verify that cos(135°) really is −√2/2 before handing in a precalculus assignment, in degrees or radians.
Feed a symbolic math pipeline
Get closed-form radical strings like 2√3/3 for csc(60°) that a CAS or grading script can compare exactly.
Teach the unit circle interactively
Query all six functions at every standard angle to build flashcards, quizzes or unit-circle visualizations.
FAQ
Which functions are supported?
All six: sin, cos, tan, csc, sec and cot, including long names like sine or cotangent.
Which angles are accepted?
The sixteen standard unit-circle angles: 0°, 30°, 45°, 60°, 90° and coterminal multiples up to 330°, given in degrees or radians. Non-standard angles like 22° are rejected because they have no simple closed-form value.
What happens for undefined values like tan(90°)?
The response sets defined to false and omits the exact and decimal fields, instead of returning an infinity or an error.
Does it handle negative or coterminal angles?
Yes. Angles are normalized onto the unit circle first, so −45°, 315° and 7π/4 all give the same result with the correct quadrant sign.
Why is sec(30°) shown as 2√3/3 and not 2/√3?
Because every reciprocal is rationalized the way a textbook writes it, with no root left in the denominator. Both forms are the same number, but 2√3/3 is the one teachers and exams expect.
Related tools
For developers — API access
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.
API endpoint
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.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/math/exact-value-of-trig-functions \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"function":"cos","angle":45}'const res = await fetch("https://api.kit.forhosting.com/math/exact-value-of-trig-functions", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"function": "cos",
"angle": 45
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/exact-value-of-trig-functions",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"function": "cos",
"angle": 45
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/exact-value-of-trig-functions", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"function":"cos","angle":45}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"function":"cos","angle":45}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/exact-value-of-trig-functions", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"function": "cos",
"angle": 45
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.exact_value_of_trig_functions",
"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.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
The exact trig value API answers the classic homework and engineering question: what is sin, cos, tan, csc, sec or cot of a standard angle, exactly?
How the computation works and what it costs
Non-standard angles such as 22° are rejected with a clear invalid_input error rather than a misleading approximation, because an exact value simply does not exist in closed radical form for arbitrary measures. The same code runs free in your browser on this page; the API costs $0.002 per call when you automate it from your own application.
Technical questions
What does it cost?
$0.002 per API call. It is also free to run in your browser on this page.