ForHosting KIT · Math

Sine wave calculator

Know the height of a sine wave at any point: with amplitude 2 and period 1, a quarter of the way along the wave reaches 2, its peak. Frequency and midline come with it, and a zero period is 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
X
0.25
Amplitude
2
Horizontal period T
1
Phase shift
0
Vertical shift
0
You get
Y
2
Frequency
1
Midline
0

A sinusoid is fully determined by four real parameters: amplitude (how far peaks sit from the midline), period (how far along the x-axis one full cycle spans), phase shift (how far the wave is slid left or right in radians), and vertical shift (the constant height of the midline). Given those values and an independent variable x, this capability evaluates the standard model y equals A times sine of two-pi x over T plus phi, then plus k. It also returns frequency as one over the period and midline as the vertical shift, so a single call answers both “what is the height now?” and “what are the wave’s base descriptors?”. Use it for homework checks, signal sketching, AC amplitude sanity tests, animation easing curves, or any script that must refuse a zero period instead of inventing Infinity.

What the sine-wave parameters mean

Write the wave as y equals A times the sine of the quantity two-pi times x divided by T, plus the phase phi, then add the vertical offset k. Period T is the length of one full oscillation along the x-axis; smaller absolute T means a faster oscillation.

Frequency is defined here as the reciprocal of period, f equals one over T, so a period of one gives frequency one, a period of two gives frequency one half, and a negative period yields a signed frequency while the sine argument remains well-defined. Phase shift phi is measured in radians and slides the zero-crossings and peaks horizontally without changing height or period. Vertical shift k raises or lowers the entire graph; it is exactly the midline value returned by this tool.

At x equal to zero with zero phase, y equals k plus A times sine of zero, which is simply k. At a quarter-period with zero phase, the argument is pi over two and y becomes k plus A for a positive period.

Practical tips, edge cases, and related searches

Prefer simple classroom triples such as amplitude two, period one, phase zero when checking against hand tables: at x equals one quarter you should see y equal to amplitude when the vertical shift is zero. Phase of pi over two turns the pure sine into a cosine-shaped wave at the same period—useful when comparing sin and cos forms of the same physical oscillation. Large absolute x or tiny periods can still produce finite results within the published caps, but extreme products may hit floating-point limits and surface as non-finite errors.

This landing targets people searching for a sine wave calculator, sinusoid evaluator, or tools that compute frequency and midline from amplitude, period, phase, and vertical shift; it is not an inverse-period fitter, FFT, or multi-harmonic synthesizer.

AC signal and sensor sketching

Model a biased sine voltage or sensor reading: set k to the DC offset, A to peak AC amplitude, T to the cycle length, and sample y at timestamps x.

Animation, games, and procedural motion

Drive bobbing, pulsing opacity, or looping paths from a shared sinusoid formula with honest errors when period collapses to zero in config data.

What happens if the period is zero?

Zero period makes both the sine argument and the frequency undefined; the tool never returns Infinity.

Is phase in degrees or radians?

Radians. Convert degrees with φ_rad = φ_deg · π / 180 before calling if your source uses degrees.

Is the sine wave calculator free?

The browser tool is free and runs locally.

How do I get the frequency of a sine wave from its period?

Divide one by the period. A period of 1 gives a frequency of 1, and a period of 2 gives a frequency of one half, which means one full cycle every two units.

What does the vertical shift do to the wave?

It raises or lowers the whole graph without changing its height or period. The shift is exactly the midline, the level the wave swings around, and the calculator reports it as such.

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/sine-wave

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/sine-wave \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"x":0.25,"amplitude":2,"period":1}'
{
  "x": 0.25,
  "amplitude": 2,
  "period": 1
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "trig.sine_wave",
  "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.

max_abs1000000000000
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.

What the sine-wave parameters mean

Amplitude A is the peak deviation from the midline: when A is two, peaks sit two units above the midline and troughs two units below, before any vertical shift. Zero period is forbidden: dividing by T is undefined and frequency would be infinite, so the solver returns invalid_input instead of a partial or infinite result. Absolute parameter magnitudes are capped so intermediate IEEE doubles stay finite on the Worker and in the browser.

How to call the API and what comes back

Amplitude also accepts A or a; period accepts T or t. Use it from homework pipelines, interview-prep sandboxes, signal and AC coursework, animation and game tooling, or any workflow that needs reproducible sinusoid points without installing a computer-algebra package on every machine. Send a JSON body with x, amplitude, and period as required finite numbers. Optional phase_shift defaults to zero (aliases phase, phi, and the φ character map to the same field). Optional vertical_shift defaults to zero (aliases k, D, midline, and offset). On success the response echoes the five resolved parameters, returns y as the evaluated height, frequency as one over period, midline as the vertical shift, method set to sine_wave, and a short formula block documenting the model. Failed validation—missing required fields, non-finite values, magnitudes past published limits, or a period of exactly zero—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item and zero marginal unit price.

Practical tips, edge cases, and related searches

When modeling a DC-biased AC signal, set vertical_shift to the bias and amplitude to the peak AC deviation; midline in the response confirms the bias. Never pass period zero; if your data source can emit a degenerate period, catch invalid_input and treat that sample as undefined frequency. Sibling trig.sin_cos_tan evaluates the six elementary functions of a single angle and does not take wave parameters. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when learners deliberately probe zero periods or out-of-range magnitudes.

Homework checks for y = A sin(2πx/T + φ) + k

Give students amplitude, period, phase, and vertical shift; compare their hand-computed y at a chosen x, plus frequency and midline, against the free browser or API result.

What formula does the sine wave calculator use?

y = A · sin(2π · x / T + φ) + k, with frequency f = 1/T and midline equal to the vertical shift k. Phase is in radians.

Are phase_shift and vertical_shift required?

No. Both default to zero. You must always send x, amplitude, and a non-zero period.

Read the full KIT documentation →