Sine of difference of angles calculator
The sine of a difference of angles calculator evaluates sin(A − B) by expanding it as sin(A) cos(B) − cos(A) sin(B).
Run — free
Enter two angles, choose degrees or radians, and receive the two product terms together with their final difference. This makes the result useful not only for obtaining a number, but also for checking homework, documenting a derivation, or confirming each part of a manual calculation. The same deterministic formula is used for every request, with no approximation method, network dependency, or random behavior.
What the sine difference identity means
The sine difference identity rewrites the sine of one angle minus another as sin(A − B) = sin(A) cos(B) − cos(A) sin(B). It is important that the expression contains two products and that the products are subtracted in this order. The first combines the sine of A with the cosine of B. The second combines the cosine of A with the sine of B. This calculator exposes both terms before returning their difference, so the path from the inputs to the answer remains visible. That detail is especially helpful when a sign error has entered a handwritten solution. For example, A = 75° and B = 30° produce a difference of 45°, but the tool still evaluates the expanded identity rather than skipping directly to a memorized special-angle result. Negative angles and cases where B is larger than A are accepted too. In those situations the ordinary sign rules for sine are preserved automatically, so sin(A − B) can correctly be negative without any special mode or manual adjustment.
Choose one unit for both angles
Both input angles must use the same selected unit. Choose degrees when the values are written with a degree symbol or come from common geometry exercises, surveying diagrams, rotations, or headings. Choose radians when the values use π-based measures, arise in calculus, or come directly from programming and scientific formulas. The calculator converts degree inputs to radians internally because JavaScript trigonometric functions operate in radians; radian inputs are used as supplied. It then calculates sin(A), cos(B), cos(A), and sin(B), multiplies the appropriate pairs, and subtracts the second product from the first. Do not convert only one of the two angles before submitting them. A value such as 30 interpreted as radians is entirely different from 30 degrees, and mixing units produces a valid-looking but irrelevant number. The returned angle unit and difference make the interpretation explicit. Results are rounded to twelve decimal places to keep the response stable and readable while retaining ample precision for education, ordinary engineering checks, spreadsheets, and application-level validation.
Read and verify the returned result
Start with the returned difference, which is A − B in the same unit as the inputs. Next inspect sin_a, cos_b, cos_a, and sin_b; these are the four trigonometric factors used by the identity. The first_term field is sin(A) cos(B), while second_term is cos(A) sin(B). Finally, value is first_term minus second_term and therefore the requested sine of the angle difference. Keeping these intermediate values is useful when comparing the calculator with a textbook solution, a spreadsheet formula, or another software library because a disagreement can be traced to a particular factor rather than treated as an unexplained final mismatch. For an independent reasonableness check, remember that every sine result lies from −1 through 1. You can also subtract the angles first and evaluate the sine of that difference using another trusted method; it should agree within normal floating-point rounding. API requests cost $0.002, while the browser version can perform the same deterministic calculation locally. Inputs must be finite numbers within the published limit, and invalid or missing angles return a clear input error instead of a fabricated answer.
What you can do with it
Check a trigonometry exercise
See every factor and product in the sine difference identity, making misplaced signs or swapped terms easier to identify.
Verify a spreadsheet formula
Compare a sheet's expanded formula with a deterministic result in the same angle unit before relying on a larger calculation.
Document an engineering calculation
Record the inputs, unit, intermediate terms, identity, and final value as a transparent numerical check.
FAQ
What formula does the calculator use?
It uses sin(A − B) = sin(A) cos(B) − cos(A) sin(B), evaluating and returning both product terms before their difference.
Can I enter degrees and radians?
Yes. Select either degrees or radians for the request. Both angles must be expressed in that same unit.
Can either angle be negative?
Yes. Finite positive, zero, and negative angles are accepted within the published absolute limit.
Why are intermediate values returned?
They show exactly how the identity was evaluated and help locate a unit, sign, multiplication, or transcription error.
What does an API request cost?
Each API request costs $0.002. The browser version runs the same pure calculation locally.
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/trig/sin-difference \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"angle_a":75,"angle_b":30}'const res = await fetch("https://api.kit.forhosting.com/trig/sin-difference", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"angle_a": 75,
"angle_b": 30
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/trig/sin-difference",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"angle_a": 75,
"angle_b": 30
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/trig/sin-difference", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"angle_a":75,"angle_b":30}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"angle_a":75,"angle_b":30}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/trig/sin-difference", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"angle_a": 75,
"angle_b": 30
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "trig.sin_difference",
"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.
Limits
max_abs_angle | 1000000000000 |
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. |