gizmobench

Parametric Equation Grapher

Type x(t) and y(t), set the range for t, and the curve appears with the numbers that made it beside it. Four things here are deliberate. Both expressions share one parameter, so the curve can double back, cross itself and close, and the page checks whether it does: cos(t) and sin(t) over 0 to 2pi return to (1, 0), so the readout says closed. Both axes are held to one scale, so a circle is drawn round and an ellipse is drawn as an ellipse. A point with no value, or one that leaves the view, ends the arc rather than being joined to the next point, which is why x(t) = t with y(t) = tan(t) comes out as three arcs with two breaks instead of two straight lines across the poles. And both expressions are read by a parser written for this page, so only the 25 functions and 3 constants listed under the plot exist and eval(t) is refused by name rather than run. The even grid is 1,024 values of t by default, anything from 32 to 20,000 works, extra points are worked out between samples where the curve turns quickly, and the total is capped at 20,000.

equationst in [0, 2π]
1,024 points1 arcx -1 to 1y -1 to 1
curve1,024 samples
-1-0.500.51-1-0.500.51
Samples
1,024
t range
0 to 2π
Closed
Yes
Breaks
0

  • x(t) and y(t) are worked out at 1,024 evenly spaced values of t from 0 to 2π, and neighbouring points are joined with straight lines.
  • t is a plain number, not an angle: sin, cos and tan take radians, so a full turn is 2pi.
  • Both axes are drawn to the same scale, 2.24 across and 2.24 up, so a circle is drawn round.
  • The even samples already resolve this curve to within a pixel, so no extra points were needed.
  • The last point returns to the first, within 1.000e-9, which is a billionth of the size of the curve, so it is closed at (1, 0).

The moving point

A parametric curve is drawn in the order t increases, and that order is part of the answer. Drag the slider to walk the point along the curve, or let it run.

t = 2π/3: the point is at (-0.5, 0.866).

The parameter

t is a plain number, not an angle: sin, cos and tan inside your expressions take radians, so a full turn is 2pi. The range fields read pi, tau and arithmetic, so 2pi, pi/2 and 4pi all work.

Quick ranges

Between 32 and 20,000 evenly spaced values of t. Those samples are what the ranges and the table report; the page works out extra points between them where the curve turns quickly or crosses the edge of the view, and the two together never pass 20,000 points.

The view

Both axes are held to one scale, so a circle is drawn round. A box that is wider than it is tall is opened out on its shorter side rather than the picture being stretched.

Viewport

Worked examples

Each one runs through the same function as your own expressions, refusals included. Load one to see it in the fields.

  • cos(t), sin(t) over 0 to 2piunit circle
    closes at (1, 0)
  • x = t, y = tan(t)poles at pi/2
    3 arcs, 2 breaks, no line across the gaps
  • An expression that is not mathseval(t)
    refused: in x(t), eval is not one of the functions this page knows, and nothing you type is run as code.

Coordinate samples

21 values of t spread across the range, with the point each one lands on. This is the same grid the plot is drawn from, so the numbers here are the numbers on the stage.

txy
010
0.31320.95130.3081
0.62650.81010.5863
0.93970.590.8074
1.25910.30670.9518
1.5723-0.00151
1.8856-0.30960.9509
2.1988-0.58750.8092
2.512-0.80830.5888
2.8253-0.95040.3111
3.1447-1-0.0031
3.4579-0.9504-0.3111
3.7711-0.8083-0.5888
4.0844-0.5875-0.8092
4.3976-0.3096-0.9509
4.7109-0.0015-1
5.02410.3067-0.9518
5.34350.59-0.8074
5.65670.8101-0.5863
5.96990.9513-0.3081
1-2.449e-16

What the expressions may contain

t is the parameter. These 25 functions and 3 constants are the whole vocabulary: a name that is not here is an error rather than a surprise, because the text is read by a parser on this page and never run as code.

  • sinsine, in radians
  • coscosine, in radians
  • tantangent, in radians
  • sec1 / cos
  • csc1 / sin
  • cotcos / sin
  • asininverse sine
  • acosinverse cosine
  • ataninverse tangent
  • sinhhyperbolic sine
  • coshhyperbolic cosine
  • tanhhyperbolic tangent
  • sqrtsquare root
  • cbrtcube root
  • absabsolute value
  • expe to the power
  • lnnatural log
  • loglog base 10
  • floorround down
  • ceilround up
  • roundround to the nearest whole number
  • sign-1, 0 or 1
  • modremainder, always positive
  • minthe smaller of two values
  • maxthe larger of two values
  • pihalf a turn in radians
  • taua full turn in radians
  • ethe base of the natural log
  • Only the listed names are available: both expressions are read by a parser on this page, never run as code. The list is sin, cos, tan, sec, csc, cot, asin, acos, atan, sinh, cosh, tanh, sqrt, cbrt, abs, exp, ln, log, floor, ceil, round, sign, mod, min, max, with t, pi, tau and e.
  • The x and y ranges are the largest and smallest values among the even samples, not solved extremes, so a peak between two samples is reported a little short.
  • A loop narrower than the gap between two samples can be missed. Raise the sample count, or narrow the t range, to look closer.
  • It samples x(t) and y(t) and draws them. It does not eliminate the parameter, differentiate, find where the curve crosses itself, or solve anything algebraically.
A drawing of samples, read by a parser. Expressions are read by a small mathematics parser, never by the browser's own evaluator, so nothing you type is executed. Sampling is adaptive up to 20,000 points and a jump larger than the viewport is drawn as a break rather than joined, which is why a pole looks like a pole. The curve is a plot of samples, not an exact algebraic solution, so zoom far enough and you see the sampling.

Common questions

How do I graph a parametric equation?
Put the expression for x in the x(t) field, the one for y in the y(t) field, and set where t starts and ends. The page opens on cos(t) and sin(t) from 0 to 2pi, which is the unit circle: 1,024 evenly spaced values of t, one arc, no breaks, and a readout that says it closes at (1, 0). Everything else follows from those three fields, so a Lissajous figure is cos(3t) and sin(2t) over the same range, and a cycloid is t - sin(t) and 1 - cos(t) over 0 to 4pi.
Why does my curve have breaks in it?
Because the curve had no value there, or it left the view, and joining the two sides would draw a line that is not part of the curve. x(t) = t with y(t) = tan(t) over 0 to 2pi is the clear case: tan runs away at a quarter turn and at three quarters of a turn, so the page draws three arcs with two breaks and nothing across either pole. The Breaks cell in the readout counts them, and the notes under the plot say how many samples had no value and how many fell outside the view.
What can I type in x(t) and y(t)?
t for the parameter, numbers, brackets, + - * / ^, and the 25 functions and 3 constants listed under the plot: sin, cos, tan, sec, csc, cot, asin, acos, atan, sinh, cosh, tanh, sqrt, cbrt, abs, exp, ln, log, floor, ceil, round, sign, mod, min and max, with pi, tau and e. Multiplication can be left out where it is obvious, so 2t, 3 cos(t) and 2(1 + t) all read the way you would write them on paper. A name outside that list is refused with the list attached, because the text is read by a parser here rather than handed to the browser to run, and each expression is held to 240 characters.
Is t measured in degrees or radians?
t is a plain number, not an angle, so it has no unit of its own. The trigonometric functions inside your expressions take radians, which is why a full turn is 0 to 2pi rather than 0 to 360. The range fields accept pi, tau and arithmetic, so 2pi, pi/2 and 4pi are all valid entries, and the readout prints the range back as a multiple of pi where it is one.
How does the page decide the curve is closed?
It compares the first point with the last and calls them closed when the gap between them is under a billionth of the size of the curve, with no sampled value missing in between. That test is about the curve rather than the window, so zooming in does not change the answer. cos(t) and sin(t) over 0 to 2pi meet to within 2.4e-16, so that reads as closed at (1, 0). Change the end of the range to 6 and the same curve ends 0.2822 short of its start, so the readout says it is not closed and the notes give the gap.
Can I zoom in on part of the curve?
Yes, three ways. The zoom buttons halve or double the viewport around its middle, Fit frames the samples again, and the four edge fields take exact numbers. However you set it, the viewport is squared up before it is drawn, so both axes keep one scale: a box that is wider than it is tall is opened out on its shorter side rather than stretching the picture. Zoom far enough and the straight lines between samples become visible, which is the honest limit of drawing a curve from samples.
How many samples does it take, and does that change the curve?
1,024 evenly spaced values of t by default, and anything from 32 to 20,000. Those even samples are what the x and y ranges and the coordinate table report, so a peak that falls between two of them is reported a little short. On top of them the page works out extra points wherever two neighbours land more than two pixels apart or one of them is outside the view: at 1,024 samples a circle needs none, and at 64 samples it gets 945 more. The two together never cost more than 20,000 points, so no expression can hang the page.
Can I save the graph?
The SVG and PNG buttons both draw from the same scene the stage draws, so the file cannot disagree with the picture you approved, and each arc of the curve is its own path in the SVG, which is how the breaks survive being pasted somewhere else. Copy puts the expressions, the range, the ranges of x and y and the arc count on the clipboard as text, and Copy samples as CSV gives you t, x and y for 21 values of t spread across the range, with any t where there is no point written out as such.
What is the difference between this and a normal graphing calculator?
A normal plot draws y as a function of x, so it has one y for every x and cannot loop. A parametric plot drives x and y from the same parameter t, so it can cross itself, double back and close, and the order the points are drawn in is part of the answer: the moving point runs along the curve in that order. For r as a function of an angle, the polar graphing calculator on this site does that job instead.
What will this page not do?
It samples x(t) and y(t) and draws what it found. It does not eliminate the parameter to give you a Cartesian equation, differentiate, find where the curve crosses itself, or prove anything about the shape. It also plots one pair of expressions at a time, so comparing two curves means plotting them one after the other. Everything runs in your browser, and nothing you type is sent anywhere.

Expressions are read by a small mathematics parser, never by the browser's own evaluator, so nothing you type is executed. Sampling is adaptive up to 20,000 points and a jump larger than the viewport is drawn as a break rather than joined, which is why a pole looks like a pole. The curve is a plot of samples, not an exact algebraic solution, so zoom far enough and you see the sampling.