Interactive three-dimensional simulations & visualizations

Visualizing the beauty in physics and mathematics


Project maintained by zhendrikse Hosted on GitHub Pages — Theme by mattgraham

3D scalar fields


What are you looking at?

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.

Scalar vis-à-vis vector quantities


Scalar versus Vector Quantities
This excellent visual guide originates from House of Physics.

The idea of a scalar field

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.

Starting situation: a hot spot

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.

What happens over time? (Heat diffusion)

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:

How to read the visualization

The coordinate axes are only there to help you understand distances and directions.

Why this is useful

This kind of visualization helps you:

Instead of thinking in formulas, you can see the heat flow.

Scalar Field Visualization – 🔥 Heat Diffusion 🔥


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.


Initial Temperature Distribution

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.


Time-Dependent Heat Diffusion

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:


Visualization Details

This visualization provides an intuitive, geometric view of scalar fields and diffusive processes in three dimensions.


Share on: