Imagine you are standing on a mountainside with your eyes closed, and your goal is to reach the summit by the fastest route. To do so, you feel around with your feet, find the direction in which the sense of the uphill slope is strongest, and take a step there. The gradient is exactly this "compass" - a mathematical arrow that always points in the direction of the steepest and fastest climb in the local surroundings, and the length of the arrow tells you how steep that slope really is.
The gradient is an operator that acts on a scalar field (a function that returns a numerical value, such as pressure, temperature or height) and maps it to a vector field. For a three-dimensional function \(f(x,y,z)\), the gradient is denoted by the nabla symbol \((\nabla)\) and is defined as the vector of all the partial derivatives of the function: \[\nabla f = \left( \frac{\partial f}{\partial x}, \frac{\partial f}{\partial y}, \frac{\partial f}{\partial z} \right)\]
The gradient has two geometric meanings that make it a vector: its direction points toward the direction of maximum increase (the fastest climb) of the function at that point, and its magnitude (its norm, \(|\nabla f|\)) equals that maximum rate of change. Moreover, the gradient allows immediate computation of the "directional derivative" – the rate of change of the function in any arbitrary direction \(\hat{u}\) – by computing the dot product \(\nabla f \cdot \hat{u}\). Another essential property, widely used in physics and optimization, is that the gradient vector is always perpendicular (orthogonal) to the contour lines or level surfaces of the function (the places where the value of the function is constant).
The height of every point of the holographic mesh is the value of the function. Dragging the background rotates the table, and the wheel zooms in and out.
Drag it to any point on the mountain. The white trail shows its path.
Under the ball, on the glass of the table (the \(xy\) plane), its shadow is projected, and a laser beam connects the two.
It starts at the shadow on the glass. Its length follows \(|\nabla f|\).
Orange neon rings where \(f(x,y) = C\). The ring through the ball is yellow, and a white square marks the angle between it and the arrow.
A rain of blue light particles that flow down the mountain. One bright drop leaves from the ball itself.
A temperature fog: a hot red core and cold blue edges. The ball floats in the air and the arrow is 3D. The "temperature bubbles" are the level surfaces.
The angle between the arrow and the contour line and the direction to the summit. While dragging: the angle between the direction of motion and the arrow, and the directional derivative \(D_{\hat u}f\) along the motion.
They change only the pace of the drops and the fog, not the function and not the gradient.