By · Updated

3D Function Plotter

Graph z = f(x, y) as a Surface Online, Free

No ratings yet

Drag to orbit, scroll to zoom, right-drag to pan

OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.

How the 3D Function Plotter works

This 3D function plotter draws z = f(x, y) as a surface. Type a formula in x and y and this page draws the surface z = f(x, y) in 3D, coloured by height, with axes and a floor grid. Orbit it with the mouse, tighten or widen the x and y range, raise the grid resolution for smooth curves, scale the height, clip the poles of a function that shoots off to infinity, and switch between solid, wireframe and faceted rendering. Download a PNG for a worksheet, a slide or a textbook figure.

3D function plotter: writing the formula

The formula uses ordinary maths notation: + - * / for arithmetic, ^ for powers, brackets for grouping, and the functions sin cos tan asin acos atan atan2 sinh cosh tanh sqrt cbrt abs exp log log10 log2 floor ceil round min max pow sign. The constants pi and e are built in. sin(x) * cos(y) gives the egg-box surface shown by default; x^2 - y^2 is the saddle; sin(sqrt(x^2 + y^2)) / sqrt(x^2 + y^2) is the classic ripple; exp(-(x^2 + y^2) / 4) is a Gaussian bump and x * y a hyperbolic paraboloid. Implicit multiplication is not read, so write 2*x rather than 2x.

Range, resolution and scale

The x and y ranges are symmetric about zero, so a range of 5 plots from −5 to 5 along that axis. Resolution is the number of grid cells along each side; 100 is smooth for most functions and 300 is enough for anything with fine ripples, at the cost of ninety thousand samples per redraw. Height scale multiplies z before drawing so that a surface with a tiny or a huge range still reads well against the x and y extent; it changes the picture only, and the minimum and maximum z in the rail are the real values. Clipping caps |z| at the figure you enter, which tames functions such as 1 / (x * y) or tan(x) whose spikes would otherwise flatten everything else to a plane.

Undefined points

Where the formula has no real value, for example sqrt(x * y) in the quadrants where the product is negative, or log(x) at and below zero, the surface is simply left open. The sample count in the rail tells you how many of the grid points were undefined, so a surprisingly small plot usually means the formula only exists over part of the domain.

Colour and style

The colour runs from the lowest z to the highest z after clipping: blue up through green to red for Rainbow, a diverging blue–white–red for Cool to warm, and dark to light for Greyscale, which prints well in black and white. Solid shows the shaded surface; Solid + wireframe overlays the grid lines so you can see the sampling and the curvature; Wireframe alone is the traditional graphing-calculator look; Faceted flattens the shading on each triangle, which brings out sharp ridges and creases.

FAQ

What functions and operators can I use?

Arithmetic with + - * / ^, brackets, the trigonometric and hyperbolic functions and their inverses, sqrt, cbrt, abs, exp, the logarithms, rounding, min, max, pow, sign, and the constants pi and e. Function names are lower case and every multiplication needs an explicit *.

Why does my plot look flat?

Either the surface has a much smaller range in z than in x and y, in which case raise the height scale, or a single spike is dominating and everything else is squashed to a plane, in which case set a clip value a little above the interesting part of the function.

Can I plot in polar or spherical coordinates?

Not directly: the input is z as a function of x and y on a rectangular grid. You can still write functions of the radius, since sqrt(x^2 + y^2) is r and atan2(y, x) is the angle, so cos(3 * atan2(y, x)) * sqrt(x^2 + y^2) plots a three-lobed rose in height.

How large can the grid be?

Up to 300 cells per side, which is 301 × 301 samples and about 180 000 triangles. Any modern laptop redraws that as you type; on a phone 100 to 150 is more comfortable. The PNG download renders at up to 4K regardless of the grid size.

See also: all 3D Science tools, Images, Audio, Video & Screen, PDF, SVG, Simulations & Screensavers, Generative Art, Chart Makers, 3D Model Viewers, Drawing Pads, Mockups & 3D Making, Diagram Makers, Tracker Music.

Related tools