Hessian and Curvature Visualizer
Run the Hessian Visualizer Fullscreen
Edit the MicroSim with the p5.js editor
About This MicroSim
This 3D visualization demonstrates the connection between the Hessian matrix eigenvalues and the geometric curvature of a function surface. The Hessian is a matrix of second partial derivatives that captures how a function curves in different directions.
How to Use
- Select a Function: Choose from bowl-shaped (minimum), saddle, or elongated surfaces
- Rotate View: Click and drag to rotate the 3D view
- Zoom: Use mouse scroll wheel to zoom in/out
- Move Point: Use arrow keys to move the analysis point
- Toggle Options: Show/hide principal curvature directions and quadratic approximation
Understanding the Display
- Surface: The colored 3D surface of f(x,y)
- Contour Lines: Level curves on the base plane
- Red Sphere: Current point on the surface
- Green Arrows: Principal directions with positive eigenvalues (curving up)
- Red Arrows: Principal directions with negative eigenvalues (curving down)
- Info Panel: Shows eigenvalues and point classification
Eigenvalue Interpretation
| Eigenvalue Pattern | Curvature Type | Optimization |
|---|---|---|
| Both positive (λ₁, λ₂ > 0) | Bowl (minimum) | Local minimum |
| Both negative (λ₁, λ₂ < 0) | Dome (maximum) | Local maximum |
| Mixed signs | Saddle point | Neither |
Lesson Plan
Learning Objectives
- Connect Hessian eigenvalues to geometric curvature
- Identify minima, maxima, and saddle points from eigenvalue signs
- Visualize how curvature varies with direction
Suggested Activities
- Bowl Functions: Start with x²+y² and observe both positive eigenvalues
- Saddle Point: Switch to x²-y² and see how mixed eigenvalues create a saddle
- Elongation: Compare x²+0.1y² to see how different eigenvalue magnitudes affect shape
- Approximation: Enable "Show Quadratic Approx" to see how the Hessian provides a local approximation
References
- Boyd & Vandenberghe, Convex Optimization, Chapter 3
- Wikipedia: Hessian Matrix