Advanced maths

Trigonometric function grapher

Graph transformed sine and cosine waves with amplitude, period, phase and vertical shifts, quarter-cycle values and a downloadable SVG.

Your numbers

Period is 2π/|B| for a nonconstant wave. Negative B reverses the argument.
Enter 0.5 for a shift of π/2 radians. The formula uses B(x−Cπ).

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Try it, understand it

Explore the result

Change one transformation at a time and follow the equation, reference points and graph together.

Worked example comparison
ExampleOutputWhat to notice
Original doubled sineFunction equation — x in radiansy = 2 sin(1(x − (0π))) + (0)Amplitude 2, period 2π and zero midline.
Shift right by π/2Function equation — x in radiansy = 2 sin(1(x − (0.5π))) + (0)The factored shift remains π/2 without dividing by B again.
Reflected compressed cosineFunction equation — x in radiansy = -3 cos(2(x − (0π))) + (2)The amplitude is 3, period π and global range [−1,5].
Reverse the sine argumentFunction equation — x in radiansy = 2 sin(-1(x − (0π))) + (0)Negative B reverses argument traversal while preserving the positive period.
Constant cosineFunction equation — x in radiansy = 2 cos(0(x − (0π))) + (0)The graph is y=2 with no least positive fundamental period.

Check your understanding

Does C=0.5 mean half a radian?

No. C is entered in multiples of π, so it means π/2 radians.

What is the period when B=−2 for a nonconstant wave?

π radians, because the period uses |B|.

Behind the numbers

How this calculation works

Adjust A, B, the horizontal shift in multiples of π and D to inspect a transformed sine or cosine curve. Valid input changes redraw the graph automatically. Analytic range and period values sit alongside a table of quarter-cycle samples and an SVG export. Graph coordinates are multiples of π; table x values are also shown in radians.

THE FORMULAy=A sin(B(x−Cπ))+D or y=A cos(B(x−Cπ))+D; nonconstant period T=2π/|B|

A worked example

For y=2 sin(x), the amplitude is 2, period 2π, midline 0 and global range [−2,2]. Changing B to 2 compresses the period to π. Keeping B=1 and entering C=0.5 shifts the wave right by π/2 radians.

Good to know

Sine and cosine only, bounded coefficients and graph windows with at most 80 visible cycles. The graph is sampled, with at least 32 samples per visible cycle. Constant functions have no least positive fundamental period. C is in multiples of π, not degrees or an unfactored phase angle.

Read the transformed wave in a consistent order

Start with the parent function: sine is zero at argument zero, while cosine is one. The coefficient A scales that parent value vertically. The factor B changes how quickly its argument moves as x changes. The horizontal shift moves the argument origin, and D adds a vertical offset. Treating these four operations separately makes a complicated-looking formula easier to interpret.

This page uses the factored convention y=A sin(B(x−Cπ))+D, or the same expression with cosine. The C field is measured in multiples of π, so entering 0.5 means a horizontal shift of π/2 radians. This matches the graph’s horizontal axis, which displays x/π. The table additionally reports ordinary radian x values to help connect the visual coordinates with direct substitution into the formula.

Amplitude is a distance rather than a signed height

For a nonconstant wave, amplitude is |A|. A negative coefficient reflects the curve about the midline D; it does not make the amplitude a negative distance. With A=−3 and D=2, the wave still ranges from −1 to 5, and the amplitude is three. The sign changes which phase positions reach those extremes.

The global minimum and maximum use the analytic range of the sinusoid, not a search through plotted points. They remain correct even when the selected graph window contains only a small portion of a cycle. The colored range lines help distinguish those global bounds from whichever peaks happen to be visible in the current window.

Separate the horizontal coefficient from ordinary frequency

The period of a nonconstant sine or cosine wave is 2π/|B| radians of the horizontal variable. For B=2, one complete cycle occupies π radians. For B=0.5, it occupies 4π radians. The absolute value matters: B=−2 has the same period as B=2 while reversing traversal of the parent function’s argument.

The coefficient B is sometimes loosely called frequency. In a formula whose x variable is measured in radians, cycles per radian is |B|/(2π), and B is the angular scaling coefficient. If x represented time in seconds in a separate physical model, B would carry the corresponding angular frequency units. This grapher does not silently assume a time scale or convert a mathematical coefficient into measured hertz.

A little curiosity

Follow a phase shift through five reference points

For y=2 sin(x), a cycle can be traced through x=0, π/2, π, 3π/2 and 2π. The corresponding values are 0, 2, 0, −2 and 0. Changing to cosine gives 2, 0, −2, 0 and 2 at those same points. These quarter-cycle values explain the shape more directly than a large table of arbitrary decimal samples.

With C=0.5, B=1 and D=0, the sine reference cycle begins at x=π/2. Its quarter-cycle points are shifted right by π/2. If B becomes two, the spacing between those reference points becomes π/4, while the starting shift remains π/2. Because the formula is already factored as B(x−Cπ), dividing the entered shift by B again would move the wave incorrectly.

The cycle table starts at the entered shift and advances by one quarter of a positive cycle length. Negative B changes the resulting function values through the reversed argument. Reference points outside the plotted window remain in the table and are simply omitted from the graph’s sample markers, so they do not stretch the requested viewing window.

Handle a constant graph without an invented period

When A=0, both parent choices reduce to y=D. When B=0, sine reduces to y=D and cosine reduces to y=A+D. In either situation the actual oscillation amplitude is zero. Applying the usual period expression at B=0 would divide by zero, while claiming a positive fundamental period for an A=0 graph would also be misleading.

A constant function repeats after every positive horizontal displacement, so it has no least positive fundamental period. The result states that directly and still plots the constant value. For the B=0 cosine case, the entered D line remains visible as an input reference even when the actual constant value is A+D.

Use the graph window and export as part of the explanation

Valid input changes redraw the graph locally, and the calculate button remains available for explicit recalculation or error feedback. A window with more than 80 visible cycles is rejected rather than reduced to an unreadable undersampled stripe. Within the supported window the curve uses at least 32 sampled segments per visible cycle, with a baseline of 800 segments for slower waves.

The downloadable SVG records the function curve, selected window, range lines and visible reference dots. It is a mathematical illustration based on entered parameters, not an image of measured data. The Riemann sums calculator can explore signed accumulation of a supported trigonometric expression over an interval; the triangle solver instead evaluates supplied side-and-angle relationships. Those are related tasks with different inputs and interpretations.

A few questions, answered

Is the horizontal axis measured in degrees?

No. The axis shows x/π, so a horizontal value of 1 represents x=π radians. The table also gives x in radians.

Does a negative A mean a negative amplitude?

No. For a nonconstant wave the amplitude is |A|. A negative A reflects the curve about the midline.

What happens when B is zero?

Sine becomes y=D and cosine becomes y=A+D. The function is constant and has no least positive fundamental period.

Why are the global extrema different from the visible peaks?

The selected window may contain only part of a cycle. Analytic global extrema describe the full function, while the plot shows the selected window.

Can I plot tangent?

This tool focuses on sine and cosine transformations. Tangent has poles and does not have a finite amplitude or global range like these waves.

Find your calculator

Start typing to explore the library.