3D Surfaces
Klein Bottle (3D)
Explore a parametric Klein bottle.
The Klein bottle is entered as one parametric3d surface. The coordinates are a standard immersion: a tube that passes through itself in 3D because a true Klein bottle needs four dimensions to sit without a crossing.
u runs from 0 to π and v runs from 0 to 2π in this parameterization. The picture is still one mesh in the same 3D viewer. The self-crossing is a feature of the immersion, not two separate surfaces.
Equation
parametric3d(
4*cos(u)*sin(u)^5*(1+2*cos(u)^2)-0.10*cos(u)*cos(v)*(3+5*cos(u)*sin(u)),
3.9*sin(u)^2-0.055*sin(u)^3*cos(v)*(1-16*cos(u)^4)*(3+5*cos(u)*sin(u)),
0.12*(3+5*cos(u)*sin(u))*sin(v),
0,
pi,
0,
2*pi
)
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
parametric3d(— This is a command. The name selects the routine, and the items inside the parentheses are its arguments.4*cos(u)*sin(u)^5*(1+2*cos(u)^2)-0.10*cos(u)*cos(v)*(3+5*cos(u)*sin(u)),— This is a command. The name selects the routine, and the items inside the parentheses are its arguments.3.9*sin(u)^2-0.055*sin(u)^3*cos(v)*(1-16*cos(u)^4)*(3+5*cos(u)*sin(u)),— This is a command. The name selects the routine, and the items inside the parentheses are its arguments.0.12*(3+5*cos(u)*sin(u))*sin(v),— This is a command. The name selects the routine, and the items inside the parentheses are its arguments.0,— This is a header or a data row. Values in the same column share a meaning.pi,— This is a header or a data row. Values in the same column share a meaning.0,— This is a header or a data row. Values in the same column share a meaning.2*pi— This line is part of the example input and is sent to DGS unchanged.1 more lines— The remaining lines use the same kind of instruction. Read them by the same rule as the lines above.
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.