Visualizing the beauty in physics and mathematics
This visualization shows how temperature spreads through space.
Each small sphere represents a point in space where we measure the temperature. The color of the sphere tells you how hot it is:
Together, all these spheres form a scalar field: a function that assigns one number (temperature) to every point in space.
🔧 This scalar_plot.html is 100% JavaScript!
👉 A VPython version is also available as scalar_plot.py.
A scalar field is simply a function like
\[T(x, y, z)\]that gives a single value at each position.
Examples of scalar fields:
Here, the scalar field represents temperature in 3D space.
At the beginning, the temperature is highest near the center and decreases smoothly outward:
\[T(\mathbf{r}) = e^{-\alpha \lVert \mathbf{r} \rVert^2}\]This describes a localized heat source:
You can think of this as a small hot object placed in cold space.
As time passes, heat spreads out due to diffusion.
Mathematically, this is described by the heat equation:
\[\frac{\partial T}{\partial t} = \kappa \nabla^2 T\]You don’t need to solve this equation to understand what happens:
In the animation, this means:
The coordinate axes are only there to help you understand distances and directions.
This kind of visualization helps you:
Instead of thinking in formulas, you can see the heat flow.
This visualization shows a three-dimensional scalar field representing a temperature distribution in space.
Each small sphere corresponds to a sample point in ℝ³, where the scalar value is given by a temperature function
\[T(\mathbf{r}, t)\]evaluated at that position. The color of each sphere encodes the local temperature, with warmer colors indicating higher values.
At an initial time, the temperature is modeled as a radially symmetric Gaussian field:
\[T(\mathbf{r}) = e^{-\alpha \lVert \mathbf{r} \rVert^2},\]where:
This represents a localized heat concentration centered at the origin.
The time evolution of the temperature follows the fundamental solution of the three-dimensional heat equation:
\[\frac{\partial T}{\partial t} = \kappa \nabla^2 T,\]with thermal diffusivity $\kappa$.
The analytical solution for a point-like heat source is:
\[T(\mathbf{r}, t)= \exp\left( -\frac{\lVert( \mathbf{r} \rVert^2}{4\kappa t} \right), \qquad t > 0.\]As time increases:
This visualization provides an intuitive, geometric view of scalar fields and diffusive processes in three dimensions.
Share on: