ForHosting KIT · Math

Phase shift calculator

In y = sin(2x + 1) the graph moves half a unit to the left, because the phase shift is −C/B = −1/2. Enter the coefficient of x and the phase constant to get the signed shift, its direction and the period. 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
B
2
C
1
You get
Phase shift
-0.5
Horizontal shift
-0.5
Direction
left
Magnitude
0.5

A sinusoidal function written as y equals A sine of Bx plus C, plus D, or the matching cosine form, hides a horizontal translation inside the pair of coefficients B and C. That translation is the phase shift: rewrite the argument as B times the quantity x minus h and the number h equals negative C over B. Students, tutors, and grading scripts ask for that single signed length more often than they ask for a four-parameter readout of amplitude, period, phase, and vertical shift.

What the phase shift is and how −C/B becomes a left or right slide

Every standard sinusoid can be written y equals A times sine of Bx plus C, plus D, or with cosine in place of sine. Coefficient A stretches the wave vertically and D lifts or drops the midline; neither of those numbers moves the graph left or right. The horizontal motion lives entirely in B and C.

Factor the argument: Bx plus C equals B times the quantity x plus C over B, which is the same as B times the quantity x minus h when h equals negative C over B. The number h is the phase shift, also called the horizontal shift. The sign is the classroom convention used in precalculus: a positive h slides the parent graph of sine of Bx to the right, a negative h slides it to the left, and a zero h leaves the wave untranslated.

Worked identity: two x plus one equals two times the quantity x plus one half, so h equals negative one half and the graph of sine of two x is moved one half unit left. The same identity with two x minus one yields h equals plus one half and a slide to the right. Amplitude never enters the quotient, so a negative A (a reflection through the midline) does not flip the reported shift.

When B is zero the original statement is no longer a wave in x—only a constant equal to A sine of C plus D—and dividing by B is undefined, so this calculator refuses that input instead of inventing a number. Search intent clusters around the phrases phase shift calculator, horizontal shift of a sine function, and find the phase shift of A sin(Bx+C); those queries want this signed length, not a bundle of amplitude and period.

Tutor and worksheet answer keys

Educators batch coefficient pairs to generate consistent phase-shift, direction, and factored-argument answers, including the zero-shift and negative-B cases.

Is a positive phase shift a shift to the right or to the left?

Positive h slides the parent graph to the right; negative h slides it to the left; zero is no slide. That is the precalculus convention for writing the argument as B(x − h).

Do I need amplitude A or the vertical shift D?

No. Neither A nor D changes the horizontal shift. This calculator only reads the coefficient of x and the phase constant.

What happens if the coefficient of x is zero?

The phase shift is undefined, so the input is refused. With B at zero the expression is no longer a wave in x but a constant, and dividing by zero would only invent a number.

Does a negative amplitude change the phase shift?

No. The amplitude only stretches or flips the wave vertically and never enters the calculation, so a negative A mirrors the graph through its midline without changing the horizontal slide.

Does the result also include the period?

Yes. The period is 2π divided by the absolute value of B, so you can compare the slide with one full cycle. For B equal to 2 it is about 3.14159265359.

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/math/phase-shift

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/math/phase-shift \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"b":2,"c":1}'
{
  "b": 2,
  "c": 1
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "math.phase_shift",
  "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 phase shift calculator accepts the coefficient of x and the phase constant, returns the signed horizontal shift with its direction and magnitude, and fails with invalid_input when the coefficient of x is zero because the quotient is then undefined.

Input contract, response shape, and error behaviour

A zero b is rejected because the identity divides by the coefficient of x; the message states that the phase shift is undefined when that coefficient is zero, and those failures are not billed either. Magnitude is the absolute value of the shift. Period is two pi over the absolute value of B so you can read the slide against one full cycle without a second call. POST a JSON body with two required finite numbers: b, the non-zero coefficient of x, and c, the phase constant inside the argument. Each field may arrive as a JSON number or as a numeric string. Common aliases are accepted when the canonical name is omitted: B, frequency_coef, or omega for b; C, phase_const, or phi for c. Missing fields, empty strings, non-numeric text, NaN, and Infinity fail with invalid_input naming the field and are not billed. On success the body echoes the cleaned b and c, returns phase_shift as the signed primary result −C/B, repeats the same number as horizontal_shift for clients that prefer the classroom name, and names direction as right, left, or none. The formula string restates phase_shift equals negative C over B, and factored_form writes the argument as B times the quantity x minus h with a readable sign. Example: b equals two and c equals one yields phase_shift negative one half, direction left, magnitude one half, period pi, and factored_form two times the quantity x plus one half. Example: b equals four and c equals negative two yields phase_shift plus one half and direction right.

Where a dedicated phase shift calculator earns its keep

Tutors and worksheet authors batch B and C pairs to build answer keys that stay consistent on the sign of the slide, including the easy-to-miss case C equals zero (no shift) and the case of a negative B, which still follows h equals negative C over B. Failed validation does not consume balance. Algebra and precalculus classrooms ask students to read the horizontal shift from an equation before they sketch intercepts or label a first peak; a dedicated endpoint that returns only h, its direction, and the factored argument avoids the extra amplitude and period fields that distract from that one skill. Physics and signal notebooks reduce a written sinusoid to a time delay or a spatial offset; calling a tiny parse API avoids pulling a computer-algebra system for a two-coefficient quotient. Automated tests freeze the JSON for a left shift, a right shift, and a zero-B rejection so a later refactor cannot flip the classroom convention in silence. Keep requests small, pin phase_shift and direction in tests, and you get a reproducible horizontal shift for homework, LMS plugins, and edge workers without standing up symbolic math infrastructure of your own.

Homework and graph labeling

Students enter B and C from y = 3 sin(2x + 1) and confirm the signed horizontal shift before sketching the first peak and intercepts.

CI fixtures for trig helpers

Pipelines freeze JSON goldens for a left shift, a right shift, and a rejected zero coefficient of x so the classroom sign convention cannot drift.

How do I find the phase shift of y = A sin(Bx + C) + D?

Send finite numbers b (non-zero) and c. The API returns the signed horizontal shift h = −C/B, plus direction (right, left, or none) and the factored argument B(x − h).

What happens if the coefficient of x is zero?

The task fails with invalid_input. When B is zero the expression is no longer a sinusoid in x and the quotient −C/B is undefined, so the call is not billed.

What does the phase shift calculator cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →