To find the equation of a trigonometric function from its graph, read four values off the picture: the amplitude, the period, the vertical shift (the midline), and the phase shift at one known point. Write them as y = A·sin(B(x − C)) + D or y = A·cos(B(x − C)) + D, where A is the amplitude, B = 2π ÷ period, C is the horizontal shift in the same units as x, and D is the midline. Every reading below comes from a grid whose units you must confirm first. A graph drawn with x in degrees instead of radians changes B entirely, and that single mix-up causes more wrong answers than any other.
What Each Letter in y = A·sin(B(x − C)) + D Actually Controls
Four parameters do four separate jobs, and each one shows up as a distinct feature of the curve. A sets how far the wave rises above and falls below its midline, so you read it as half the vertical distance between a maximum and the following minimum. D is the midline itself, the average of that maximum and minimum, and it is the value the wave oscillates around.
B compresses or stretches the wave horizontally, so it comes from the period rather than the picture's height. B equals 2π divided by the period when x is measured in radians, and 360° divided by the period when x is measured in degrees. C slides the whole curve left or right, and it must be expressed in the same units as x.
A common failure shows up when a student treats the distance between two peaks as the period. The period is one full cycle peak to peak, yes, but if you measure trough to trough you get the same number, and if you measure peak to the next trough you get half a period. According to the Khan Academy algebra 2 unit on graphing sinusoidal functions, the period is the horizontal length of one complete cycle, which is why picking the wrong pair of landmarks halves or doubles your B. As of November 2026, Khan Academy lists this under "Trigonometric functions" in its Algebra 2 course, and the unit defines amplitude as half the distance between the maximum and minimum values.
A second trap sits in the sign of A. A negative A flips the wave, so a downward-opening sine can be written with a positive A and a phase shift instead, and both answers are correct. Standard curricula, including the College Board's AP Precalculus course description for 2023–24 and later, accept equivalent forms, so don't panic if your C differs from a classmate's by a quarter period.
Read the Midline and Amplitude First, Before Anything Else
Start with vertical information because it is the easiest to see and it anchors everything else. Find the highest point the curve reaches and the lowest point it reaches, then average those two y-values to get D. The amplitude A is half their difference, so it is always positive unless you deliberately choose a negative sign.
Suppose a graph peaks at y = 5 and bottoms out at y = −1. The midline is (5 + (−1)) ÷ 2 = 2, so D = 2. The amplitude is (5 − (−1)) ÷ 2 = 3, so A = 3. That is the entire vertical story in two numbers, and every later step depends on them.
Check your midline against the grid rather than trusting the eye alone. If the axes are labeled in increments of 2, a peak that sits halfway between two gridlines is at an odd value you should measure carefully. A misread of one grid unit shifts both D and A and ruins the final answer even when your period and phase are perfect.
If the curve never crosses a visible midline, as happens with a tangent or secant graph, this amplitude step does not apply. Those functions have no maximum and minimum, so skip straight to the asymptote and period reading described later. Sine and cosine graphs always have a measurable high and low, which is why this step comes first for them.
Measure the Period by Counting Grid Squares Between Matching Points
The period is the horizontal distance from one identifiable point to the next point where the curve looks identical and is heading the same direction. A peak to the next peak works, and so does a midline crossing to the next midline crossing in the same direction. Count the grid squares and multiply by the labeled value of each square.
Take a graph where consecutive maxima sit at x = 1 and x = 5 on a grid marked in units of 1. The period is 4, so B = 2π ÷ 4 = π/2. If the same picture were labeled at x = 30° and x = 150°, the period would be 120°, and B = 360° ÷ 120° = 3.
Here is a concrete classroom example you can check against your own work. The OpenStax Algebra and Trigonometry textbook, in its chapter on graphs of the sine and cosine functions, gives a graph with a maximum at x = 1 and a minimum at x = 5 on a radian axis, which produces B = π/2. That published example is a reliable benchmark: match your own reading of the same picture and you know your method is sound.
Count carefully when the peaks land between gridlines. If a maximum appears at x = 1.5 rather than 1, the period might still be an integer, and the apparent drift usually means the phase shift is fractional. Estimate the fraction from the grid and keep it in the equation rather than rounding it away.
Find the Phase Shift From a Peak, a Trough, or a Midline Crossing
The phase shift C is the horizontal distance from the y-axis to the point where the basic function's cycle begins. For sine, that starting point is a midline crossing going upward; for cosine, it is a maximum. Read that point's x-coordinate and you have C.
For a sine curve that crosses its midline heading upward at x = 2, the equation's inside becomes (x − 2), and C = 2. For a cosine curve whose maximum sits at x = 3, C = 3. The sign matters: a shift to the right is (x − C) with positive C, and a shift to the left gives a negative C, which appears as (x + |C|).
You will sometimes find the starting point is not on a gridline at all. Then read the fraction as best you can, or use a different reference point and adjust. A cosine with a peak at x = 0.5 and a period of 4 is fully described, because the peak position alone fixes C.
Watch for the false start. A sine graph that crosses the midline going down at x = 1 is not starting its standard cycle there. You can either shift to the next upward crossing, which adds half a period, or write the equation with a negative amplitude. Both routes give the same curve, and checking one point in your finished equation is the fastest way to confirm you chose correctly.
Assemble the Equation and Verify With One Test Point
Multiply out the pieces: y = A·sin(B(x − C)) + D, with A, B, C, and D filled in from your readings. Plug in the coordinates of one clear point on the graph, ideally a peak or a midline crossing, and confirm both sides match. If they don't, the error is almost always in C or in a missing degree-to-radian conversion.
Take the earlier example: A = 3, D = 2, period 4 so B = π/2, and an upward midline crossing at x = 2 so C = 2. The equation is y = 3·sin(π/2·(x − 2)) + 2. Test the peak at (4, 5): π/2·(4 − 2) = π, sin(π) = 0, so y = 2, which is the midline, not the peak. Wrong point. Test x = 3: π/2·(3 − 2) = π/2, sin(π/2) = 1, so y = 3 + 2 = 5, which is the peak, so the peak is actually at x = 3 and the reading was off by one grid square.
That failed check is the point. Verification does not just confirm an answer; it catches misread landmarks. In practice, testing one point costs about 30 seconds and saves the whole problem. If the test fails, re-read the peak position first, then the period, and only then the amplitude.
Write the final equation in the form your course expects. Many textbooks accept either sine or cosine as the base function, and some online homework systems require a specific one. The College Board's AP Precalculus materials accept equivalent sinusoidal forms, so a cosine answer and a sine answer that plot the same curve both earn credit there.
Write the Cosine Version Without Redoing All the Work
Converting between sine and cosine is the fastest shortcut in this topic, and it saves the re-measurement step. A sine wave equals a cosine wave shifted a quarter period to the left, so you can add or subtract a quarter period from C instead of starting over.
Rule of thumb: sin(θ) = cos(θ − π/2) in radians. If your sine equation has B and C, the cosine form uses the same A, B, and D but replaces C with C − π/(2B). For the example above, B = π/2, so π/(2B) = 1, and the cosine form is y = 3·cos(π/2·(x − 1)) + 2.
Why bother? Some graphs make the peak easier to read than the midline crossing, and starting from cosine at the peak avoids the fractional phase shift. If the peak sits exactly on a gridline and the crossing sits between gridlines, write the cosine version first and convert to sine only if required.
Check the conversion by plotting one point in both forms. They should land on the same y-value for the same x. If they don't, you added the quarter-period shift in the wrong direction, which is a sign error in C rather than a deeper mistake.
Handle Tangent, Cotangent, Secant, and Cosecant Graphs
Tangent and cotangent have no amplitude, so the vertical reading becomes a stretch factor instead. Tangent's basic period is π, not 2π, and its equation is y = A·tan(B(x − C)) + D, where B = π ÷ period. Identify the asymptotes: consecutive vertical asymptotes sit one period apart, and tangent crosses its midline halfway between them.
For a tangent graph with asymptotes at x = −1 and x = 3, the period is 4, so B = π/4. The midline crossing sits at x = 1, halfway between, giving C = 1, and the equation is y = A·tan(π/4·(x − 1)) + D. Read A by measuring how far the curve rises over a known horizontal run near the crossing, and D from the height of the crossing itself.
Secant and cosecant are the reciprocals of cosine and sine, so their periods match and their equations can be written by fitting the underlying sine or cosine curve first. Find the invisible cosine wave whose peaks touch the secant's local minima and whose troughs touch its local maxima, fit that cosine, then take its reciprocal. This indirect route is more reliable than trying to read a secant's parameters directly off its U-shapes.
One failure case is worth knowing: a tangent graph drawn on a degree axis with asymptotes at 90° and 270° has a period of 180°, and B = 180° ÷ 180° = 1. Forgetting that tangent's basic period is 180° rather than 360° in degrees produces a B that is half what it should be, and the curve will plot with the wrong frequency.
Work Through a Complete Cosine Example Step by Step
Here is a full problem in the order you should solve it. Suppose a graph shows a maximum at (2, 7), a minimum at (6, −1), and the curve is labeled in radians.
1: Average the extreme y-values: (7 + (−1)) ÷ 2 = 3, so D = 3. 2: Halve their difference: (7 − (−1)) ÷ 2 = 4, so A = 4. 3: Read the period from the peak to the next peak. If the next peak is at x = 10, the period is 8, so B = 2π ÷ 8 = π/4. 4: The maximum sits at x = 2 and cosine starts at a maximum, so C = 2. 5: Write y = 4·cos(π/4·(x − 2)) + 3. 6: Test the minimum at (6, −1): π/4·(6 − 2) = π, cos(π) = −1, so y = −4 + 3 = −1. It matches.
The step that trips people is step 3 when the next peak is not shown. If you only see a peak at x = 2 and a trough at x = 6, the half-period is 4, so the full period is 8, and B = π/4. That doubling step is a common omission.
A tidy check is to list all four values before writing the equation. A = 4, B = π/4, C = 2, D = 3. If any value looks unreasonable against the picture, such as a B larger than the number of cycles visible, re-read that feature before assembling the formula.
Precalculus-Level Sine and Cosine From Graphs: What Changes
In a precalculus or AP Precalculus course, the same four values are required, but the expected form and the tolerance are stricter. The College Board's AP Precalculus course description for 2023–24 and later frames sinusoidal modeling around amplitude, midline, period, and phase shift, and it expects students to move fluently between sine and cosine forms of the same graph.
What changes in practice is the answer format. A precalculus problem may specify radians and ask for the smallest nonnegative phase shift. If your reading gives C = −3 with period 8, the equivalent nonnegative shift is C = 5, because adding the period lands on the same curve. Rewrite the equation as y = A·sin(B(x − 5)) + D and check one point to confirm.
Another difference is that precalculus problems often give you a graph without gridlines, only labeled tick marks. Then you must infer the unit from the labels before measuring. If tick marks are every π/2, a peak four ticks from the origin sits at x = 2π, not x = 4, and that misread changes C by a factor of π/2.
Keep the answer in exact form when the problem allows it. Writing B = π/4 is cleaner than B ≈ 0.7854, and many grading systems accept only the exact version. If a numeric answer is required, round B to three decimal places and say so in your work.
Five Mistakes That Produce Wrong Equations Every Time
1: Using the distance between a peak and the next trough as the period. That distance is half a period, so B comes out doubled. Fix it by doubling the measured distance before dividing. 2: Mixing degrees and radians in B. If x is in degrees, B = 360° ÷ period; if x is in radians, B = 2π ÷ period. Confirm the axis label before computing. 3: Dropping the negative sign on a leftward phase shift. A shift left by 2 is (x + 2), which expands to (x − (−2)), so C = −2. Writing (x − 2) flips the curve to the wrong side. 4: Reading amplitude as the peak's y-value instead of half the peak-to-trough distance. Amplitude is a distance from the midline, not a height above the x-axis. If the midline is at y = 3 and the peak at y = 7, the amplitude is 4, not 7. 5: Forgetting the vertical shift when the graph doesn't cross y = 0. A wave that lives entirely above the x-axis has a midline above 0, and omitting D shifts the whole equation down.
These five account for most incorrect answers in this topic. Each has a one-step fix, and the verification test described earlier catches four of the five by itself.
FAQ
How do I know whether to use sine or cosine for the equation?
Use whichever base function puts a readable landmark at the phase shift. Sine starts at a midline crossing, so pick sine when the graph crosses its midline on a gridline; cosine starts at a maximum, so pick cosine when a peak sits on a gridline. Both are correct, and converting between them costs one quarter-period adjustment (π/(2B) in radians). If your course requires one form, write the easier reading first and convert.
What if the graph has no visible maximum or minimum?
That usually means you are looking at a tangent or cotangent curve, which has no amplitude and a basic period of π (180° in degrees). Read the vertical asymptotes instead: consecutive asymptotes are one period apart, and the curve crosses its midline exactly halfway between them. Secant and cosecant do have maxima and minima in the sense that their U-shapes touch the underlying sine or cosine wave, so fit that wave first.
Why does my equation plot the same curve but with a different phase shift than the answer key?
Because a sinusoidal curve repeats every period, an infinite family of phase shifts describes the same graph. Adding or subtracting one period, or half a period with a sign flip on A, produces an equivalent equation. Most courses accept any correct form, but if yours demands the smallest nonnegative shift, add or subtract whole periods until C falls in the required range, then verify with one point.
Can I find the equation if I only know three points on the graph?
Only if the points are chosen well. Three points at a peak, a trough, and a midline crossing can fix all four parameters, but three generic points can usually be fit by more than one sinusoid. Prefer a maximum, the following minimum, and the x-coordinate of a midline crossing. If the points are equally spaced but none is an extreme, the fit may be ambiguous, and you should ask for more information.
How many grid squares equal one period on a typical textbook graph?
It depends on the grid's labels, not the square count. Count the squares between matching points and multiply by the value printed on each square. A peak five squares after the previous peak on a grid labeled every π/2 units gives a period of 5π/2, not 5. Never assume one square equals one unit unless the axis is labeled that way.
Do tangent graphs have an amplitude I need to find?
No. Tangent and cotangent are unbounded, so amplitude is undefined for them. The multiplier in front of tan or cot controls vertical stretch near the midline and is found by measuring how far the curve rises over a known horizontal run. That stretch factor is not found by halving a peak-to-trough distance, because there is no finite peak or trough.
What is the fastest way to check my final equation?
Test one distinctive point, preferably a peak or a midline crossing, by substituting its x-value and confirming the output equals the point's y-value. If it matches, your A, B, C, and D are consistent. If it fails, re-check the peak position first, then the period, then amplitude. A single test point catches sign errors, phase-shift mistakes, and doubled periods quickly.
Is it possible to get the period wrong by exactly a factor of two and still pass the test point?
Yes, and this is the sneakiest error in the topic. If you mistake half a period for a full one, the doubled B value makes the curve complete two cycles where it should complete one, but a test point placed at a peak or trough can still match by coincidence. Guard against it by checking a second point halfway between two landmarks, where the doubled frequency usually diverges.