ForHosting KIT · Math

Double-angle calculator

For an angle of 30°, the doubled angle is 60°: sin(2x) is 0.8660254038, cos(2x) is 0.5 and tan(2x) is 1.7320508076. All three come from one entry, and an undefined tangent is reported instead of a meaningless number. 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
Given angle x
30
You get
Double angle
60 deg
Sin 2x
0.8660254038
Cos 2x
0.5
Tan 2x
1.7320508076

Double-angle identities are the workhorse formulas students meet right after the unit circle: sine of twice an angle equals twice the product of sine and cosine, cosine of twice an angle equals cosine squared minus sine squared, and tangent of twice an angle follows from their ratio when that cosine is nonzero. Homework, contest drills, and graphics code all need the same three numbers from a single measure in degrees or radians, with a clear failure when the doubled angle lands on a vertical asymptote of tangent. Non-numeric or non-finite input fails the same way.

What the double-angle identities are and when tan(2x) fails

In trigonometry, the double-angle formulas express functions of two times an angle in terms of functions of the original angle. The three standard identities used here are sin of two x equals two times sin of x times cos of x; cos of two x equals cos squared of x minus sin squared of x; and tan of two x equals sin of two x divided by cos of two x whenever that denominator is nonzero.

Equivalent cosine forms such as two cos squared minus one or one minus two sin squared are algebraically the same; this engine uses the difference-of-squares form for a single consistent path. Search intent clusters around double angle calculator, sin two theta, cos two x formula, tan double angle, and evaluate double angle identities online. Learners want numeric answers they can check against a textbook key, not only a symbolic rewrite.

Tangent of two x is undefined precisely when cos of two x is zero, which happens when two x is an odd multiple of pi over two—classic examples include forty-five degrees and one hundred thirty-five degrees, where the doubled measure is ninety or two hundred seventy degrees.

How this calculator validates input, applies the identities, and shapes the response

Unit defaults to deg; set unit to rad when the measure is already in radians. Internally the angle is converted to radians only for Math.sin and Math.cos, then the double-angle identities are applied: sin of two x as twice the product of sine and cosine of x, cos of two x as cosine squared minus sine squared, and tan of two x as their quotient after a strict near-zero check on cos of two x.

Using the sine-over-cosine path for tangent avoids the intermediate tan of x form, which would incorrectly fail when cos of x itself is zero even though tan of two x is well defined and equals zero.

Edge cases are explicit: thirty degrees yields sin of sixty equal to the square root of three over two, cos of sixty equal to one half, and tan of sixty equal to the square root of three; forty-five degrees fails because cos of ninety is zero; pi over six radians mirrors the thirty-degree success path.

Homework double-angle drills with domain checks

Students and graders confirm sin(2x), cos(2x), and tan(2x) for degree or radian measures, including clear rejection when tan(2x) is undefined.

What happens if the angle is not a number?

Non-numeric or non-finite values are rejected before any identity is applied; those calls are not charged.

Is the double-angle calculator free?

The browser tool runs free on your device.

Can I use radians instead of degrees?

Yes. Set unit to rad so the input angle is interpreted in radians. Omit unit or set deg for degrees.

What are sin 2x, cos 2x and tan 2x for 30 degrees?

The doubled angle is 60°, so sin 2x is 0.8660254038, cos 2x is 0.5 and tan 2x is 1.7320508076. These are the familiar values for 60°, rounded to ten decimal places.

When is tan 2x undefined?

Whenever cos 2x is zero, which happens when the doubled angle is an odd multiple of a right angle, for example for an angle of forty-five degrees. That case is reported clearly instead of returning an endless number.

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/double-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/double-angle \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"angle":30}'
{
  "angle": 30
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "trig.double_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.

This capacity accepts a finite angle, evaluates the double-angle identities deterministically, and returns sin(2x), cos(2x), tan(2x), and the doubled measure as structured JSON. Cases where tan(2x) is undefined—when cos(2x) is zero—are rejected with invalid_input and are not charged.

What the double-angle identities are and when tan(2x) fails

Reporting that domain error explicitly is more useful than returning infinity or NaN, because answer keys and automated graders need a stable failure code rather than a silent non-finite payload that may break downstream JSON consumers.

How this calculator validates input, applies the identities, and shapes the response

Send a JSON body with required field angle and optional field unit. Angle must be a finite number—JSON numbers and numeric strings such as thirty or pi over six as a decimal are accepted; words, empty strings, null, infinity, and NaN fail with invalid_input so those failed calls are not charged. Results are rounded to a stable ten-decimal precision so the same input always yields the same JSON, including for radian measures that cannot be represented exactly in binary floating point. The response echoes angle and unit, reports double_angle as two times the input in the same unit, and tags method as double_angle_identities so pipelines can assert provenance without re-deriving which formula family was used.

Practical use, limits, pricing, and delivery channels

Use the browser tool when you want an immediate double-angle triple while checking homework, verifying a unit-circle sketch, or confirming a rotation step without installing a computer-algebra system. Results are fully deterministic: the same angle and unit always yield the same three trig values. There is no language model, no external geometry service, and no randomness, so the capacity is safe to pin in continuous-integration checks and reproducible lesson materials. Each successful request is one billable item at $0.002; failed validation—including undefined tan of two x—does not consume balance. Accepted input is any finite real measure in degrees or radians for which cos of two x is nonzero; the response returns sin_2x, cos_2x, tan_2x, and double_angle with method double_angle_identities. Wire the endpoint into double-angle drills, contest answer checkers, animation helpers that expand a half-turn from a base heading, or floating pipelines where you already prefer explicit domain errors for non-numeric or asymptotic payloads over opaque black-box widgets that cannot show why an angle failed to parse or why tangent was undefined.

Deterministic fixtures for trigonometry tests

Pipelines that seed unit tests or interactive unit-circle demos can call a pure double-angle oracle instead of reimplementing identities and asymptote checks in every language.

Rotation and animation helpers

Scripts that need sine and cosine of a doubled heading or sweep recover stable floating values as structured JSON for logs, shaders, or UI without a computer-algebra dependency.

How do I compute sin(2x), cos(2x), and tan(2x) with this API?

Send angle (required) and optional unit deg or rad to trig.double_angle. The response returns sin_2x, cos_2x, tan_2x, and double_angle using the classic double-angle identities.

When is tan(2x) undefined?

When cos(2x) is zero—equivalently when 2x is an odd multiple of π/2 (for example x = 45° or x = 135°). Those requests fail with invalid_input and are not charged.

Read the full KIT documentation →