This simulator lets you drag a probe across a 3D scalar-field surface — a Gaussian hill, quadratic bowl, hyperbolic saddle or sinusoidal terrain — and compares the slope in a chosen test direction against the field's true gradient. Watch the gradient arrow sit perpendicular to the level contours, and follow a numerical ascent trail climb toward higher ground.
• A real-time 3D terrain surface with home view, focus-selected-part, auto-rotate, expand and toggleable labels, tappable components with callouts (terrain surface, level contours, movable probe, gradient arrow, test-direction arrow with lifted tangent, and ascent trajectory trail). • Four controls: scalar field selector (Gaussian hill, quadratic bowl, hyperbolic saddle, sinusoidal terrain), probe x position, probe y position, and test direction θ from 0° to 360°. • Play/pause, single-step (0.1 s) and larger-step (1 s) time controls, plus a playback-speed selector from 0.01× to 60× laboratory speed. • A follow-gradient-ascent action, a rotate-test-direction action, and a pause-motion action, with a live sequence narrative describing what's happening. • Six live metrics: field value f, ∂f/∂x, ∂f/∂y, steepest-ascent rate, directional slope in the test direction, and gradient bearing in degrees. • A Curves & measurements tab with a slope-versus-test-direction chart, a local x/y cross-section chart, the full model equations, and snapshot measurements. • An Experiments tab with four guided scenarios (climb the hill, inspect a saddle, perpendicular direction on a bowl, compare all directions on a wave), a model-verification bench of independent automated checks, and a timestamped event log with a copyable trial report. • A Learn & assess tab with four guided lessons, a two-question knowledge-check quiz, and a written scope/reference statement linking to OpenStax's directional derivatives and gradient chapter.
For a differentiable scalar field f(x,y), the gradient ∇f = (∂f/∂x, ∂f/∂y) is a vector in the input plane, not a 3D surface normal. Moving in any unit direction u changes height, to first order, at the rate Duf = ∇f·u — the directional derivative. Because that dot product is maximized when u points the same way as ∇f, the gradient direction is exactly the direction of steepest local increase, and its magnitude |∇f| is the steepest rate itself.
Rotate the test-direction control on any of the four fields and watch the directional-slope readout oscillate between −|∇f| and +|∇f| as θ sweeps around the probe — it peaks when the gold test-direction arrow aligns with the teal gradient arrow and crosses zero when the two are perpendicular.
Moving tangent to a regular level contour does not change height to first order, which is exactly why the gradient sits perpendicular to that contour wherever the contour is regular. The saddle field makes this concrete: probing the exact center gives a zero gradient even though height is rising along x and falling along y at that same point — a zero gradient alone never proves a maximum, since hills, bowls and saddles can all have stationary points, and only the surrounding shape distinguishes them.
The magenta ascent trail is generated by explicit-Euler steps in the gradient direction (pnext = p + 0.35·Δt·∇f(p)) and stops at the domain boundary or a small gradient — it is a numerical local path toward a nearby summit, not a guaranteed global optimizer. All four fields are defined analytically over [−2,2]²: hill = 2·exp(−(x²+y²)/3), bowl = (x²+y²)/4, saddle = (x²−y²)/4, waves = sin(x)cos(y).
Moving tangent to a regular level contour keeps the field value constant to first order, meaning the directional derivative along that tangent is zero. Since the directional derivative equals ∇f·u, a zero result for every tangent direction u forces the gradient to be perpendicular to the contour at that point.
No. A zero gradient only identifies a stationary point — it could be a maximum, a minimum, or a saddle. The simulator's saddle field demonstrates this directly: at its center the gradient is exactly zero even though the surface rises along one axis and falls along the perpendicular axis.
It sets a unit direction u at angle θ from the +x axis, and the simulator computes the directional derivative Duf = ∇f·u — the instantaneous slope you would feel walking in that exact direction from the probe. Rotating θ traces every possible directional slope at that point, from −|∇f| to +|∇f|.
No. It follows small explicit-Euler steps along the local gradient and stops once it reaches the domain boundary or the gradient becomes very small — a numerical local-ascent path, not a proof of finding the global maximum of the field.