DGS Studio

3D Graph

Volumes of Revolution

Rotate a region about an axis and draw the solid. Disk, washer, and shell use the same volume as Solve Equation.

volume_revolution(x^2,x,0,2,axis='x') rotates the region between y = x^2 and the x-axis from 0 to 2. Each slice perpendicular to the x-axis is a disk of radius x^2, so V = π ∫ x^4 dx = 32π/5.

volume_between(x,x^2,x,0,1,axis='x') is a washer: the outer radius is x and the inner radius is x^2, and the volume is 2π/15. volume_shell(x^2,x,0,1,axis='y') uses cylindrical shells of radius x and height x^2. The integral is 2π ∫ x^3 dx = π/2. The same WebGL viewer draws the solid, the flat region, and the axis.

Equation

volume_revolution(x^2,x,0,2,axis='x')

How the 3D scene is built

A 3D example is drawn in the existing surface viewer, not on the flat JSXGraph board. An equation z = f(x, y) becomes a height field. A quadric such as a sphere or hyperboloid uses its own sampler. A parametric3d or curve3d command supplies the coordinates directly.

The camera starts framed on the surface. Axes and the grid stay in the scene. Implicit surfaces are extracted with marching cubes from F(x, y, z) = 0. If you edit the equation and generate again, the same viewer replaces the mesh instead of opening a second renderer.

Reading the input

Other versions of this example

These stay on this page so each version keeps the same explanation. Choose Try example to run a version in its Studio workflow, or copy it into the editable field below.

Disk

Expected volume 32*pi/5.

volume_revolution(x^2,x,0,2,axis='x')

Washer

Expected volume 2*pi/15.

volume_between(x,x^2,x,0,1,axis='x')

Shell

Expected volume pi/2.

volume_shell(x^2,x,0,1,axis='y')

Try a change

Generate Graph sends the expression to the graph engine. A 3D result is drawn in the surface viewer: a mesh, a space curve, or a shaded region, depending on the command. The 2D board is cleared first.

Edit and generate

Generate Graph opens the studio homepage and runs this field. Open in DGS Studio loads the same text and waits for you to generate it. The equation is sent once, as a query parameter.

Related examples