Using Python + ML + AR to Unveil a Mystery in Differential Geometry.

Data Ninja
Solving the Human Problem
5 min readJan 17, 2021

Adding AR to my toolkit of Data Visualization proves to be very easy and useful to see multiple dimensions of my dataset.

Photo by Michal Balog on Unsplash

Look at both figures below. Are they in anyway equal?

From your privileged tridimensional lifestyle, you can say they are different. But if we were living in any of those surfaces, using only a measuring tape, we would not be able to tell in which we were leaving. How is that?

A Helicoid (left) and a Catenoid (Right) visualized in AR ‘touch’ recognised by neural networks (you can check it by yourself in the Augmented Data free app)

In this post you will:

  1. Discover what is an isometry and how to prove that two surfaces in the spaces are isometric.
  2. Define and calculate the first fundamental form of some surfaces.
  3. Then use Python (Pystar) to plot the surfaces in Augmented Reality so you can ‘touch’ this isometry using a pre-trained neural network.

Buckle up for some math

Distance, but within a surface

The key concept we are looking at here is called Isometry. The beauty of isometry is its focus in the distance within the surface itself, instead of exterior to it. One way to think about the difference between the distance within the surface and exterior to it can go like this: imagine a circle with two points, one in each pole of the circle. There are two ways to interpret the notion of distance between these points. One is the line passing through the center and equal to two times the radius, in this case we are taking advantage of the metric of the paper in which the circle is immerse (drawn). The other possible interpretation of distance in this context is to think on the ‘line’ connecting both points that follows along the circle drawing, in this case the distance between both points would be close to the radius times 3.14.

An Isometry makes sure the distance within a surface is kept the same.

Parametrization and First Forms

There are a few ways to show that a catenoid and a helicoid are isometric. The way we chose to do is to parametrize both as maps of two variables into the tridimensional space. Then we will calculate their first fundamental form (definition below). Once we check that the catenoid and helicoid’s first fundamental form are the same we will have proved that they are isometric.

Parametrization

Let the catenoid be given by the following parametrization:

The parametrization for the catenoid

And let the helicoid be given by the following parametrization:

The parametrization for the helicoid

See the gif above for an image of the helicoid and catenoid in ℝ³.

First Fundamental Form

The first fundamental form of a surface is defined as the (dot) product of two tangent tangent vectors (tangent to the surface). But the definition we will be using is given by the following algebraic expression:

First Fundamental Form

Which is traditionally denoted as:

First Fundamental Form traditional notation

where df/du is the derivative of the parametrization f with respect to u.

A neat summary on first fundamental forms can be found in the Encyclopedia of Math.

Now, let’s calculate the catenoid’s first fundamental form:

Hence, the catenoid’s first fundamental form is given by:

Now, let’s calculate the helicoid’s first fundamental form:

And as expected, the helicoid’s first fundamental form is given by:

Which proves that the catenoid and the helicoid are isometric.

Next we will plot the catenoid, the helicoid and intermediary steps if we were to isometrically reshape one into the other.

The Power of Pystar: Plotting the isometry in the AR space.

Pystar (Python SmooTh Augmented Reality) is a Python module that I wrote to plot data in augmented reality with just a few lines of Python code.

First we will use the following parametrization for the catenoid, the helicoid and the isometry between them:

Isometry between the catenoid and the helicoid

To see that f takes the catenoid to the helicoid note that: 𝑓(𝑢,𝑣,-𝜋/2)=𝐶(𝑢,𝑣) and 𝑓(𝑢,𝑣,0)=𝐻(𝑢,𝑣).

Let’s plot f using Python.

And this is the final result, a scene with eight surfaces, each one step closer to the helicoid from the catenoid:

The isometry between catenoid and helicoid split in 8 steps displayed in AR.

Conclusion

We found out what is an isometry between two surfaces. We also had a brief overview of what is the first fundamental form of a surface and we calculated its value for the Catenoid and the Helicoid that happened to be equal, proving that they are isometric. It is worth mentioning that the idea of isometry and surfaces can be extended beyond the tridimensional spaces, sparking the calculus on Manifolds.

Finally, AR can be an easy and practical way to visualize differential geometry and its multidimensional properties.

Want more?

— If you want more AR, here is a quick overview on PyStar.

— If you want more on differential geometry: Differential Geometry on Manifolds.

— A good generalization of Catenoid and Helicoid’s isometry: Isometric Deformation of (m,n)-Type Helicoidal Surface.

— Download my App to see this and more AR data visualizations: Augmented Data.

--

--

Data Ninja
Solving the Human Problem

Focusing on Machine Learning and AI. Solving problems for the humans.