acalculator

What is the phase shift?

Type A, B, C and D from y = A sin(Bx − C) + D or y = A cos(Bx − C) + D. The phase shift calculator gives the phase shift and its direction, the amplitude, the period and the midline, and draws one cycle. You can type π in B and C.

Your numbers

Function
For example 2, 1/2 or π/4.
As in Bx − C: for 2x + π/3, type −π/3.
Phase shift
π/4 to the right

The phase shift is π/4 to the right, with amplitude 3, period π and vertical shift 1.

Phase shift (decimal)
0.785398
Amplitude
3
Period
π
Period (decimal)
3.14159
Frequency
0.31831
Vertical shift (midline)
1
Maximum
4
Minimum
−2

Phase shift: π/4 to the right. The phase shift is π/4 to the right, with amplitude 3, period π and vertical shift 1.

What does one cycle look like?

How to calculate

Phase shift calculator for y = A sin(Bx − C) + D or A cos(Bx − C) + D: the phase shift C/B and its direction, the amplitude, period, frequency, vertical shift, maximum and minimum, with π typed exactly.

Example with the default inputs (Function A sin(Bx − C) + D, A 3, B 2, C π/2, D 1): The phase shift is π/4 to the right, with amplitude 3, period π and vertical shift 1.

Method: y = A sin(Bx − C) + D or A cos(Bx − C) + D: amplitude |A|, period 2π ÷ |B|, phase shift C ÷ B (right when positive, left when negative), vertical shift D, maximum D + |A|, minimum D − |A|.

  • The function is written as A sin(Bx − C) + D or A cos(Bx − C) + D, with B not 0 and A not 0. For Bx + C, type −C.
  • x is in radians, so π in B or C is exact; the phase shift and period are in the same units as x.

Machine-readable copies: Markdown, JSON.

Worked examples

Each example is checked against the calculator on every build.

  1. Function A sin(Bx − C) + D, A 3, B 2, C 0, D 1 gives Amplitude 3, Period π, Period (decimal) 3.141593, Phase shift 0 (no horizontal shift), Vertical shift (midline) 1.Source: OpenStax, Precalculus 2e, §6.1 Graphs of the Sine and Cosine Functions (y = A sin(Bx − C) + D: amplitude |A|, period 2π/|B|, phase shift C/B, vertical shift D), https://openstax.org/books/precalculus-2e/pages/6-1-graphs-of-the-sine-and-cosine-functions (retrieved 2026-10-18), Example 5: amplitude 3, period π, no phase shift, midline y = 1
  2. Function A sin(Bx − C) + D, A 3, B π/4, C π/4, D 0 gives Phase shift 1 to the right, Phase shift (decimal) 1, Period 8, Period (decimal) 8, Amplitude 3, Maximum 3, Minimum -3.Source: OpenStax, Precalculus 2e, §6.1 Graphs of the Sine and Cosine Functions (y = A sin(Bx − C) + D: amplitude |A|, period 2π/|B|, phase shift C/B, vertical shift D), https://openstax.org/books/precalculus-2e/pages/6-1-graphs-of-the-sine-and-cosine-functions (retrieved 2026-10-18), Example 9: amplitude 3, period 8, phase shift 1 unit to the right
  3. Function A cos(Bx − C) + D, A -2, B π/2, C −π, D 3 gives Phase shift 2 to the left, Phase shift (decimal) -2, Period 4, Amplitude 2, Vertical shift (midline) 3, Maximum 5, Minimum 1.Source: OpenStax, Precalculus 2e, §6.1 Graphs of the Sine and Cosine Functions (y = A sin(Bx − C) + D: amplitude |A|, period 2π/|B|, phase shift C/B, vertical shift D), https://openstax.org/books/precalculus-2e/pages/6-1-graphs-of-the-sine-and-cosine-functions (retrieved 2026-10-18), Example 10: amplitude 2, period 4, phase shift −2 (2 units left), vertical shift 3
  4. Function A sin(Bx − C) + D, A 1, B 1, C -π/6, D -2 gives Phase shift π/6 to the left, Phase shift (decimal) -0.523599, Period 2π, Vertical shift (midline) -2.Source: OpenStax, Precalculus 2e, §6.1 Graphs of the Sine and Cosine Functions (y = A sin(Bx − C) + D: amplitude |A|, period 2π/|B|, phase shift C/B, vertical shift D), https://openstax.org/books/precalculus-2e/pages/6-1-graphs-of-the-sine-and-cosine-functions (retrieved 2026-10-18), Examples 3 and 4: phase shift π/6 to the left, shifted 2 units down
  5. Function A sin(Bx − C) + D, A 1, B pi/6, C 0, D 0 gives Period 12, Period (decimal) 12, Frequency 0.083333.Source: OpenStax, Precalculus 2e, §6.1 Graphs of the Sine and Cosine Functions (y = A sin(Bx − C) + D: amplitude |A|, period 2π/|B|, phase shift C/B, vertical shift D), https://openstax.org/books/precalculus-2e/pages/6-1-graphs-of-the-sine-and-cosine-functions (retrieved 2026-10-18), Example 1: B = π/6, so the period is 2π ÷ (π/6) = 12
  6. Function A cos(Bx − C) + D, A 0.5, B 4, C 1, D 0 gives Phase shift 1/4 to the right, Phase shift (decimal) 0.25, Period π/2, Period (decimal) 1.570796.Source: OpenStax, Precalculus 2e, §6.1 Graphs of the Sine and Cosine Functions (y = A sin(Bx − C) + D: amplitude |A|, period 2π/|B|, phase shift C/B, vertical shift D), https://openstax.org/books/precalculus-2e/pages/6-1-graphs-of-the-sine-and-cosine-functions (retrieved 2026-10-18)
  7. Function A sin(Bx − C) + D, A 2, B π, C 1, D 0 gives Phase shift 1/π to the right, Phase shift (decimal) 0.31831, Period 2, Frequency 0.5.Source: OpenStax, Precalculus 2e, §6.1 Graphs of the Sine and Cosine Functions (y = A sin(Bx − C) + D: amplitude |A|, period 2π/|B|, phase shift C/B, vertical shift D), https://openstax.org/books/precalculus-2e/pages/6-1-graphs-of-the-sine-and-cosine-functions (retrieved 2026-10-18)

How it works

For y = A sin(Bx − C) + D or y = A cos(Bx − C) + D, with A and B not 0:

  • Amplitude = |A|.
  • Period P = 2π ÷ |B|, and the frequency is 1 ÷ P = |B| ÷ 2π (cycles per unit of x).
  • Phase shift h = C ÷ B, because A sin(Bx − C) = A sin(B(x − C/B)). A positive h moves the graph right; a negative h moves it left; 0 means no horizontal shift.
  • Vertical shift D: the midline is y = D, the maximum is D + |A| and the minimum is D − |A|.

If your function has Bx + C, type −C: sin(x + π/6) has C = −π/6. The chart draws y from h − P/4 to h + 7P/4 and marks x = h.

What you can type

  • A and D: a whole number, a decimal, a fraction or a mixed number (3, −0.5, 1/3, 1 1/2), read exactly. Commas and exponents are not accepted.
  • B and C: a number (2, −0.5, 1,000; commas only between groups of three digits) with an optional whole number below it (3/4), or a multiple of π: π or pi, optionally with a number in front (2π, 0.5pi, 2*π) and a whole number below it (π/4, −3π/2). One pair of outer brackets is allowed, and spaces around π, / and * are ignored. Up to 30 characters. B and C are read exactly as a fraction r times π⁰ or π¹.
  • A = 0 (a flat line) and B = 0 (no period) have no answer, and so does text in B or C that is not one of the forms above.

Output format

  • Exact forms. The phase shift is r × π^k with k = 1 (C has π and B does not), 0 (both or neither have π) or −1 (B has π and C does not); the period is r × π^k with k = 1 when B has no π and 0 when it has. Each is written with r in lowest terms and the true minus sign: k = 0 as an integer or a fraction (8, −2, 3/2); k = 1 as nπ/d (π, 2π, π/4, −3π/2; 1 is not written, nor /1); k = −1 as n/π or n/(dπ) (1/π, 3/(4π)).
  • The headline is the size of the phase shift followed by "to the right" or "to the left", or "0 (no horizontal shift)".
  • The decimals (phase shift, amplitude, period, frequency, vertical shift, maximum, minimum) show to 6 significant figures. π is a 64-bit float; the amplitude, vertical shift, maximum and minimum are exact from the typed values, rounded once.

Worked examples by hand

y = 3 sin(2x) + 1. A = 3, B = 2, C = 0, D = 1: amplitude 3, period 2π ÷ 2 = π, phase shift 0, midline y = 1.

f(x) = 3 sin((π/4)x − π/4). B = π/4 and C = π/4: phase shift (π/4) ÷ (π/4) = 1, to the right; period 2π ÷ (π/4) = 8; maximum 3, minimum −3.

y = −2 cos((π/2)x + π) + 3. B = π/2 and C = −π: phase shift −π ÷ (π/2) = −2, 2 to the left; period 2π ÷ (π/2) = 4; amplitude 2; maximum 3 + 2 = 5, minimum 3 − 2 = 1.

f(x) = sin(x + π/6) − 2. B = 1, C = −π/6: phase shift −π/6 = −0.523599, π/6 to the left; period 2π; the graph is 2 units down.

f(x) = sin((π/6)x). B = π/6: period 2π ÷ (π/6) = 12; frequency 1/12 = 0.0833333.

y = 0.5 cos(4x − 1). B = 4, C = 1: phase shift 1/4 = 0.25, to the right; period 2π ÷ 4 = π/2 = 1.5708.

y = 2 sin(πx − 1). B = π, C = 1: phase shift 1 ÷ π = 1/π = 0.31831, to the right; period 2π ÷ π = 2; frequency 0.5.

Other questions people ask

How do you calculate the phase shift?

Write the function as y = A sin(Bx − C) + D, then divide C by B. For y = 3 sin(2x − π/2) + 1, the phase shift is (π/2) ÷ 2 = π/4. A positive phase shift moves the graph right; a negative one moves it left.

How do you find the phase shift when the function has Bx + C?

Rewrite Bx + C as Bx − (−C). For sin(x + π/6), C = −π/6 and B = 1, so the phase shift is −π/6: π/6 to the left.

How do you find the period of a sine or cosine function?

The period is 2π ÷ |B|. For y = 3 sin(2x) + 1 it is 2π ÷ 2 = π, and for sin((π/4)x) it is 2π ÷ (π/4) = 8.

What is the amplitude of a sine wave?

The amplitude is |A|, the height of a crest above the midline. For y = −2 cos((π/2)x + π) + 3, the amplitude is 2; the minus sign flips the graph upside down but does not change the amplitude.

What is the vertical shift?

D, the number added at the end, moves the whole graph up (positive) or down (negative). The midline is y = D, the maximum is D + |A| and the minimum is D − |A|.

Is the phase shift C or C/B?

C ÷ B. The function A sin(Bx − C) can be written A sin(B(x − C/B)), so the graph of sin(Bx) moves by C/B. For 3 sin((π/4)x − π/4), the shift is (π/4) ÷ (π/4) = 1, not π/4.