Trig Function Grapher

Plot sine, cosine, tangent and their reciprocals with real-time controls for amplitude, period, phase shift, and vertical shift.

Home / Calculators / Trig Function Grapher

Trig Function Grapher

Visualize sine, cosine, tangent and more with live sliders. See how amplitude, period, phase shift, and vertical shift transform your function in real time.

y = sin(x)

Understanding the General Form: y = A · f(Bx - C) + D

A (Amplitude) stretches the graph vertically. |A| is the maximum distance from the midline.
B (Period Factor) compresses horizontally. Period = 2π/|B| for sin and cos.
C (Phase Shift) moves the graph left or right by C/B units.
D (Vertical Shift) moves the entire graph up or down.

Graphing Trigonometric Functions: A Complete Guide

Trigonometric functions are periodic functions that form the backbone of countless applications in science, engineering, and mathematics. The six standard trig functions -- sine, cosine, tangent, cosecant, secant, and cotangent -- each produce a distinct graph shape. By understanding how to transform these graphs using amplitude, period, phase shift, and vertical shift, you can model almost any periodic phenomenon.

The general form of a transformed trig function is written as y = A · f(Bx - C) + D. Each parameter controls a specific transformation. Mastering these four parameters gives you complete control over the shape and position of any trigonometric graph.

The Four Transformation Parameters

Amplitude (A)

The amplitude |A| determines the vertical stretch or compression of the function. For sine and cosine, it represents the maximum distance from the midline to the peak (or trough). A basic sine wave oscillates between -1 and 1; setting A = 3 makes it oscillate between -3 and 3. If A is negative, the graph is reflected vertically (flipped upside down). Note that tangent, cosecant, secant, and cotangent do not have a bounded amplitude since they extend to infinity.

Period Factor (B)

Period = 2π / |B|   (for sin and cos)     Period = π / |B|   (for tan and cot)

The B value controls horizontal compression or stretching. Larger values of B compress the graph horizontally, producing more cycles in the same interval. For example, B = 2 doubles the frequency, halving the period from 2π to π. This parameter directly relates to the physical concept of frequency in sound waves and oscillations.

Phase Shift (C)

The phase shift C/B moves the entire graph horizontally. A positive C shifts the graph to the right, while a negative C shifts it to the left. Phase shift is crucial in applications like AC circuits, where it describes the timing offset between voltage and current waveforms.

Vertical Shift (D)

The D parameter moves the graph up (positive D) or down (negative D). This is the simplest transformation: it changes the midline of the function from y = 0 to y = D. In real-world modeling, this often represents a baseline offset, such as average temperature around which seasonal fluctuations occur.

Worked Example: Graphing y = 2 sin(3x - π/2) + 1

  1. Amplitude: A = 2, so the graph oscillates 2 units above and below the midline.
  2. Period: 2π/|3| = 2π/3 ≈ 2.094. The wave completes a full cycle in about 2.09 units.
  3. Phase shift: C/B = (π/2)/3 = π/6 ≈ 0.524 units to the right.
  4. Vertical shift: D = 1, so the midline is at y = 1 instead of y = 0.
  5. Range: The function oscillates between 1 - 2 = -1 and 1 + 2 = 3.

Real-World Applications of Trig Graphs

Frequently Asked Questions

What is the difference between amplitude and vertical shift?
Amplitude (A) controls how tall the wave is -- the distance from the midline to the peak. Vertical shift (D) moves the entire wave up or down, changing where the midline sits. A wave with amplitude 2 and vertical shift 3 oscillates between 1 and 5, with its midline at y = 3.
How do I find the period from a graph?
Identify two consecutive points where the function completes one full cycle (for example, from peak to the next peak, or from one zero-crossing going up to the next zero-crossing going up). The horizontal distance between these points is the period. For the equation y = A sin(Bx - C) + D, the period equals 2π/|B|.
Why does tangent have vertical asymptotes?
Tangent is defined as sin(x)/cos(x). Wherever cos(x) = 0 (at x = π/2 + nπ), the function is undefined and approaches positive or negative infinity. These locations appear as vertical asymptotes on the graph. The same principle applies to cosecant (1/sin) and secant (1/cos) at their respective undefined points.
What is phase shift and why does it matter?
Phase shift is a horizontal translation of the graph, calculated as C/B from the general form y = A sin(Bx - C) + D. It matters because it describes when a periodic event starts relative to a reference. In physics, the phase difference between two waves determines whether they interfere constructively or destructively.
How are cosecant, secant, and cotangent related to sin, cos, and tan?
They are reciprocal functions: csc(x) = 1/sin(x), sec(x) = 1/cos(x), and cot(x) = 1/tan(x) = cos(x)/sin(x). Their graphs have vertical asymptotes wherever the corresponding base function equals zero, and they share the same period as their base function.