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
volume_revolution(x^2,x,0,2,axis='x')— This is a command. The name selects the routine, and the items inside the parentheses are its arguments.
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
- Change a constant on the right-hand side, or the amplitude of a wave, and generate. The 3D frame updates to the new surface.
- If this is z = f(x, y), try z = -f(x, y). The shape flips through the xy-plane.
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.