ForHosting KIT · Math

Midline of a sinusoidal function

Get the line a sine or cosine wave swings around: a vertical shift of 3 puts the midline at height 3, and with an amplitude of 2 the wave peaks at 5 and bottoms out at 1. 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
D
3
Optional amplitude A
2
You get
Vertical shift
3
Midline
3
Equation
y = 3
Horizontal line
y = 3

Every sine or cosine graph of the form y = A sin(B(x − C)) + D or y = A cos(B(x − C)) + D oscillates about a single horizontal line called the midline. That line is y = D: the vertical shift of the parent wave. Finding the midline is the first step in sketching, fitting, or comparing sinusoidal models in algebra, precalculus, physics, and signal work.

What the midline is and why D defines it

A sinusoidal function stretches vertically by amplitude A, compresses or stretches horizontally by frequency factor B, slides left or right by phase C, and shifts up or down by D. The vertical shift does not change the wave’s shape: it only moves the entire oscillation so that its center sits at a new height. That center is the midline—the unique horizontal line about which crests and troughs are symmetric when the amplitude is constant.

For the standard forms y = A sin(B(x − C)) + D and y = A cos(B(x − C)) + D, the midline is always y = D, regardless of A, B, or C. Related intents such as period, phase shift alone, or full equation solvers are separate landings; here the search intent is specifically the midline of a sinusoidal function from D.

Amplitude, max and min, precision, and limits

Amplitude is optional. When you omit it, the response is only about the center line: D, midline, equation, and related fields. The calculator does not parse a full symbolic equation string, fit data points, or solve for B, C, or period—those are different product surfaces.

Use this page when you already know the vertical shift (or want to treat a candidate D as the midline) and need a deterministic, machine-readable answer that matches the definition used in standard high-school and college trigonometry.

Tutor and worksheet answer keys

Educators batch vertical shifts (and optional amplitudes) to generate consistent midline, max, and min answers for quizzes.

How do I find the midline of a sinusoidal function?

For y = A sin(B(x − C)) + D or the cosine form, the midline is the horizontal line y = D.

What is the relationship between vertical shift and midline?

They are the same height: the vertical shift D moves the parent wave so it oscillates about y = D. This tool returns that line explicitly as equation y = D.

What happens if D is not a number?

Only finite numeric values (or digit strings that parse to finite numbers) are accepted for d and a.

How do I find the maximum and minimum of a sinusoid from its midline?

Add the size of the amplitude to the midline for the maximum and subtract it for the minimum. With a vertical shift of 3 and an amplitude of 2, the wave reaches 5 at the top and 1 at the bottom.

Can I find the midline from a graph instead of the equation?

Yes. Average the highest and lowest values of the wave. A graph peaking at 5 with its lowest point at 1 has its midline at 3, the same number as the vertical shift.

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/sinusoid-midline

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/sinusoid-midline \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"d":3}'
{
  "d": 3
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "trig.sinusoid_midline",
  "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 takes the vertical shift D (and optionally the amplitude A), returns the midline equation y = D, and when amplitude is provided also reports the peak and trough y_max = D + |A| and y_min = D − |A|. Non-numeric input is rejected with invalid_input so a bad payload never looks like a real answer.

What the midline is and why D defines it

If D = 0 the wave is centered on the x-axis; if D = 3 the wave rides three units above the axis; if D = −2 it rides two units below. Teachers often ask students to read D from an equation, or to recover D from a graph by averaging the maximum and minimum y-values, which yields the same number because (y_max + y_min) / 2 equals D when y_max = D + |A| and y_min = D − |A|. This tool focuses on the direct path from the vertical shift: you supply D and receive the midline equation and the numeric center value ready for graphing, labeling, or downstream math.

How to call the calculator and read the result

Send a numeric field named d (aliases D, vertical_shift, and shift are accepted) for the vertical shift of your sinusoid. Optionally send a (aliases A and amplitude) for the amplitude; the tool stores |A| so a negative amplitude still yields correct max and min heights. Digit strings that parse to finite numbers are allowed; missing d, empty strings, NaN, Infinity, objects, and other non-numeric types fail with invalid_input naming the problem field. On success the JSON echoes d and vertical_shift, reports midline as the same finite number, and builds equation and horizontal_line strings of the form y = <value> so clients can display or copy the center line without formatting work. The field oscillates_about repeats the numeric center for APIs that prefer a pure number over a string equation. When amplitude is present, amplitude, y_max, and y_min are included so a single call covers both the midline and the vertical range of the wave. Pricing for a successful API call is a flat $0.002 under the item unit; validation failures are never charged. Typical clients include students labeling graphs, tutors generating answer keys, curriculum authors checking examples, and automated tests that freeze expected JSON for regression.

Amplitude, max and min, precision, and limits

When you include A, the tool takes the absolute value so that y_max = D + |A| and y_min = D − |A| always describe the highest and lowest points of a constant-amplitude sinusoid, even if the original equation wrote a negative coefficient in front of sine or cosine. It does not invent a midline when D is missing; it fails fast with invalid_input.

Homework and graph labeling

Students enter D from y = 2 sin(x) + 3 and confirm the midline equation y = 3 before sketching crests and troughs.

CI fixtures for math helpers

Pipelines freeze JSON goldens for positive, negative, and zero midlines so a refactor cannot change the center line silently.

What if I also know the amplitude?

Optional field a (or A / amplitude) adds y_max = D + |A| and y_min = D − |A| so you get the full vertical range around the midline in one call.

Is the browser midline calculator free?

Yes. The in-browser runner uses the same library as the API and costs nothing. The API charges $0.002 per successful request from your prepaid KIT balance.

Read the full KIT documentation →