How to use the calculator
The calculator has two modes. Simple is the default. It analyzes an existing function. Advanced builds an equation. The Wave selector (Sine or Cosine) and the vertical shift field are shared by both modes.
Simple mode: find amplitude, period, and phase shift from an equation
- Choose Sine or Cosine.
- Enter the coefficients , , , and from or .
- Read the main result, the signed Phase shift, which is labelled
(left),(right), or(no shift). The cards below it show Amplitude, Period, and Vertical shift.
The starting values are sine with , , , . The Examples selector loads two presets, and editing any field returns it to Custom.
Advanced mode: write an equation from amplitude, period, and phase shift
- Choose Sine or Cosine.
- Enter a positive amplitude, a positive period, a signed phase shift (horizontal shift), and a vertical shift.
- Read the generated equation, which is the main result.
With the untouched defaults, Advanced displays .
Both modes use radians. The tool has no degree mode.
Phase shift formula for sine and cosine
A sinusoid written as can be factored as
The same factoring applies to cosine. Because expands to , matching terms gives , and therefore
This is the phase shift formula the calculator applies. The value is measured in the same units as .
| Quantity | Formula | Meaning |
|---|---|---|
| Phase shift (horizontal shift) | Signed displacement along | |
| Amplitude | Distance from the midline to a peak or trough | |
| Period | Horizontal length of one cycle | |
| Vertical shift | The midline is |
The direction follows the sign of :
- : the curve shifts right.
- : the curve shifts left.
- : there is no shift.
The shift is measured relative to a reference wave with the same function, the same signed , the same signed , and the same , but with . That reference is the dashed curve on the graph.
Phase shift versus the angle offset
Textbooks differ on terminology. Some call the phase and the phase shift. Others call itself the phase shift. This calculator reports the horizontal displacement , in units of . The constant is an angle in radians. At , the horizontal shift is .
A common mistake is to read the sign off directly. For , is positive, but the curve moves left by , because . The calculator removes this ambiguity by showing the signed and the direction label.
Worked examples
Reading a shift from coefficients
Take . Then , , , and .
- Phase shift: , so the curve moves 1 unit left.
- Amplitude: .
- Period: .
- Vertical shift: .
This matches the Sine shifted left preset, which displays −1 (left), amplitude 2, period 3.141593, and vertical shift 1.
A reflected cosine with negative
Take . Here , , , and .
The shift is , so the curve moves right. The amplitude is still , and the period is . This is the Reflected cosine shifted right preset, which displays 1 (right).
Two points about signs matter here:
- A negative reflects the wave across its midline. The amplitude remains .
- The sign of is kept in the formula and in the plotted function. Only affects the period.
Starting from a factored equation
If an equation is already written as , the shift is visible directly as , but the calculator needs . Expand: .
For , we have and , so
In Simple mode, choose Cosine and enter 3 for , pi/3 for , 2π/3 for , and 0 for . The result is a phase shift of (left), amplitude , and period .
Building an equation from properties
Suppose you need a cosine with amplitude , period , horizontal shift , and vertical shift . In Advanced mode, the equation is built as
Because is negative, the display shows addition inside the parentheses. A zero vertical term is omitted, and when the argument uses alone. The coefficient of is always positive and equals .
Multiple sinusoidal representations can describe the same curve. Advanced mode constructs one valid equation in this convention, but it is not the only correct answer. For example, .
For the Advanced defaults (, , , ), the generated equation is . In Simple coefficients, that is , , , .
Reading the graph
The graph draws the shifted curve as a solid line and the unshifted reference as a dashed line. The axes are labelled, and the graph reports the period, amplitude, and graphed shift. You can zoom, pan, and reset the viewport.
A marker shows where the reference point at lands after applying the graphed shift:
- Sine: the marked point lies on the midline .
- Cosine: the marked point is a peak when and a trough when .
In the reflected cosine example, the reference value at is , a trough. The shifted curve reaches at , so the marker sits on a trough one unit to the right.
Large shifts and the graphed shift
Shifting by a whole number of periods gives the same curve. To keep the comparison readable, the graph uses the signed remainder after removing whole periods:
When , the tool shows an advisory explaining the equivalent graphed shift. For example, , gives and . Since , the graphed shift is . At an exact integer number of periods, the curves coincide and the graphed shift is zero.
The phase shift result in Simple mode and the equation in Advanced mode always keep the full signed shift. Only the drawing is reduced.
Input rules and limits
Fields are text-entry boxes. Numeric fields accept signed decimals, scientific notation, fractions such as 1/2, and signed multiples of , optionally divided by a decimal, such as pi/4, −pi, 2π/3, or 2*pi. An entry can be at most 100 characters. A single field does not evaluate sums, parentheses, or general expressions, so enter pi/4, not pi/2 - pi/4.
| Mode | Field | Default | Accepted values |
|---|---|---|---|
| Both | Vertical shift | 1 |
to |
| Simple | 2 |
to , but not zero | |
| Simple | 2 |
to , or to | |
| Simple | 2 |
to | |
| Advanced | Amplitude | 2 |
to |
| Advanced | Period | 4 |
to |
| Advanced | Phase shift | 1 |
to |
Simple rejects , because a constant function has no unique horizontal shift, and rejects . Only the fields active in the current mode are validated. If a nonzero shift, amplitude, or vertical shift would round to zero in double precision, the calculator shows a field-specific error.
Results show up to seven significant digits with trailing zeros removed. Invalid inputs replace the result with an em dash, clear the graph, and disable Copy and Export.
Working in degrees
The calculator uses radians only. To convert an angle offset given in degrees, multiply by . For example, , which you can enter as pi/6.
Copy, export, and reset
Copy places the active inputs, the displayed results, and any advisory into a text summary. Export opens the browser's print dialog, where you can save the page as a PDF. Reset restores the starting Simple sine values and the graph viewport. Everything runs locally in your browser.
What the calculator does not do
The calculator analyzes and builds single sine or cosine functions from separate coefficient fields. It does not parse a typed equation, fit a curve to data, or compare the phase of two independently supplied signals. If your function includes a tangent or a sum of waves, it falls outside this tool's scope.
Frequently asked questions
How do I find the phase shift of a sine or cosine function?
Write the function as or , then compute . A positive means a shift right, and a negative means a shift left.
Is the horizontal shift the same as the phase shift?
In this calculator, yes. Both refer to , the signed displacement along . The angle offset is the input used with to calculate that displacement.
Why does a negative not change the period?
The period depends on through . The sign of does affect the phase shift formula, because it enters .
Can the shift be larger than one period?
Yes. The reported shift keeps its full value, and the graph displays an equivalent shift within one period of the reference, along with an advisory.
Does a vertical shift affect the phase shift?
No. moves the midline to and does not enter the formula for .
Read the formula definitions, supported input ranges, and limitations before using this estimate.