This project is an interactive 3D simulation designed to visualize the calculus of integrating scalar functions over curved 2D manifolds embedded in
A curved surface
At any point on the surface, we can determine how the position changes with respect to the parameters
The cross product of these two tangent vectors yields the surface normal vector
Because mapping a flat domain
To correct for this geometric distortion, we calculate the magnitude of the normal vector, which represents the Jacobian area scale factor
This scaling factor acts as a local multiplier:
Integrating a scalar field
- Interactive 3D Engine: Drag with the left mouse button to orbit the camera, and use the scroll wheel to zoom. Includes reference coordinate axes.
-
Picture-in-Picture Parameter Grid: Displays the flat
$(s, t)$ parameter region. Selecting a cell in this 2D grid highlights its corresponding 3D counterpart, connected by a dashed tracking projection line. -
Dynamic Tangent & Normal Vectors: Renders the tangent vectors
$\vec{t}_s$ (Red) and$\vec{t}_t$ (Blue), as well as the normal vector$\vec{n}$ (Violet) directly on the 3D surface. -
Numerical Derivative Calculations: Computes partial derivatives dynamically using central differences (
$\epsilon = 10^{-3}$ ), allowing seamless compatibility with any surface type. - Painter's Rendering Pipeline: Performs back-to-front depth sorting of all surface polygons to handle transparency and resolve overlay layering.
-
Step-by-Step Numerical Integration Scanner:
- Automatically sweeps across the grid cell-by-cell.
- Computes and displays the local scalar values, Jacobian factors, and accumulated area and integral totals in real time.
- Paraboloid (Bowl): Stretching increases with distance from the origin.
- Hyperbolic Paraboloid (Saddle): Shows structural saddle points with symmetrical distortion patterns.
- Hemisphere (Dome): Illustrates classical spherical compression near the pole.
- Wavy Ripple: Shows complex local derivatives over periodic waves.
- Torus (Donut): Visualizes outer boundary stretching vs. inner boundary compression.
-
Area Density (
$f = 1.0$ ): Integrating this field yields the exact geometric surface area. -
Height Field (
$f = z + 1.5$ ): Models properties that vary linearly with elevation. -
Radial Field (
$f = x^2 + y^2$ ): Models properties radiating from a central axis. - Moving Heat Source (Dynamic): A moving Gaussian thermal spot.
- Spatio-Temporal Wave (Dynamic): Time-dependent waves propagating across the surface.
Ensure you have the Rust compiler and Cargo package manager installed:
- Clone or navigate to the repository directory.
- Execute the run command:
cargo run --release