3D Surface Gallery¶

A tour of mathematical surfaces rendered as interactive 3D plots. We use Maxima's symbolic engine to analyse each surface — computing gradients, Hessians, and curvatures — before handing the expressions to ax-plots for visualization. This is the symbolic-numeric bridge in action: the CAS derives exact formulas, and the plotting library samples them numerically.

InĀ [121]:
load("numerics")$
load("ax-plots")$

Classic Surfaces¶

Three well-known quadric and cubic surfaces that appear throughout multivariable calculus.

InĀ [122]:
/* Saddle surface: z = x^2 - y^2 */
ax_draw3d(
  explicit(x^2 - y^2, x, -2, 2, y, -2, 2),
  title="Saddle Surface", colorscale="RdBu"
)$
No description has been provided for this image
InĀ [123]:
/* Paraboloid: z = x^2 + y^2 */
ax_draw3d(
  explicit(x^2 + y^2, x, -2, 2, y, -2, 2),
  title="Paraboloid", colorscale="Viridis"
)$
No description has been provided for this image
InĀ [124]:
/* Monkey saddle: z = x^3 - 3*x*y^2 */
ax_draw3d(
  explicit(x^3 - 3*x*y^2, x, -2, 2, y, -2, 2),
  title="Monkey Saddle", colorscale="Picnic"
)$
No description has been provided for this image

Symbolic Analysis [S+N]¶

Before plotting, Maxima can derive exact analytic properties of a surface. Here we take the saddle surface and compute its gradient and Hessian symbolically, classifying the critical point at the origin.

InĀ [125]:
/* Define the surface symbolically */
f(x, y) := x^2 - y^2$
f(x, y);
Out[125]:
InĀ [126]:
/* Gradient: nabla f */
grad_f : [diff(f(x,y), x), diff(f(x,y), y)];
Out[126]:
InĀ [127]:
/* Hessian matrix */
H : matrix(
  [diff(f(x,y), x, 2), diff(f(x,y), x, 1, y, 1)],
  [diff(f(x,y), y, 1, x, 1), diff(f(x,y), y, 2)]
);
Out[127]:
InĀ [128]:
/* Determinant of the Hessian classifies the critical point.
   det < 0 => saddle point at the origin. */
det_H : determinant(H);
Out[128]:

The Hessian determinant is negative, confirming the origin is a saddle point — exactly what we see in the 3D plot above.

Trigonometric Surfaces¶

Periodic surfaces built from sine and cosine, producing wave-like geometries.

InĀ [129]:
/* Egg-carton surface */
ax_draw3d(
  explicit(sin(x)*cos(y), x, -%pi, %pi, y, -%pi, %pi),
  title="sin(x) cos(y)", colorscale="Viridis"
)$
No description has been provided for this image
InĀ [130]:
/* Ripple: radial cosine wave */
ax_draw3d(
  explicit(cos(sqrt(x^2 + y^2)), x, -10, 10, y, -10, 10),
  title="Ripple: cos(sqrt(x^2+y^2))", colorscale="Blues",
  nticks=80
)$
No description has been provided for this image

Exotic Surfaces¶

Products and Gaussian-damped combinations that create more intricate geometry.

InĀ [131]:
/* Interleaved ridges */
ax_draw3d(
  explicit(sin(x*y), x, -3, 3, y, -3, 3),
  title="sin(x y)", colorscale="Hot"
)$
No description has been provided for this image
InĀ [132]:
/* Gaussian-damped wave */
ax_draw3d(
  explicit(exp(-(x^2+y^2)/4)*cos(x)*sin(y),
           x, -4, 4, y, -4, 4),
  title="Gaussian-damped wave", colorscale="Portland"
)$
No description has been provided for this image

Curvature Analysis [S+N]¶

The mean curvature of a surface $z = f(x,y)$ is

$$H = \frac{(1+f_y^2)\,f_{xx} - 2\,f_x\,f_y\,f_{xy} + (1+f_x^2)\,f_{yy}}{2\,(1+f_x^2+f_y^2)^{3/2}}$$

Maxima can derive this expression symbolically for any $f$, and then we can visualize it as a heatmap to see where the surface bends most.

InĀ [133]:
/* Symbolic mean curvature for the saddle f = x^2 - y^2 */
fx : diff(f(x,y), x)$
fy : diff(f(x,y), y)$
fxx : diff(f(x,y), x, 2)$
fyy : diff(f(x,y), y, 2)$
fxy : diff(f(x,y), x, 1, y, 1)$

mean_curv : ratsimp(
  ((1 + fy^2)*fxx - 2*fx*fy*fxy + (1 + fx^2)*fyy)
  / (2*(1 + fx^2 + fy^2)^(3/2))
);
Out[133]:
InĀ [134]:
/* Contour plot of the mean curvature over the domain */
ax_draw2d(
  ax_contour(mean_curv, x, -2, 2, y, -2, 2),
  colorscale="RdBu", ncontours=20,
  title="Mean Curvature of x^2 - y^2"
)$
No description has been provided for this image
InĀ [135]:
/* Heatmap view of the same curvature */
ax_draw2d(
  ax_heatmap(mean_curv, x, -2, 2, y, -2, 2),
  colorscale="RdBu",
  title="Mean Curvature (heatmap)"
)$
No description has been provided for this image