#29 | py03 – Delaunay triangulation and tribute to Stephen Hawking

Hi guys.
Today, I learned what is a Delaunay triangulation and how to use it.

Delaunay triangulation is a geometrical algorithm used to link random plots into triangles with shortest distance edges. The triangulation is a dual graph with the voronoi geometry (blue) that maximize the visual area of each point, making it easier to know what point is nearest to another. When we linked all the points together with Delaunay triangulation, the overall veil is defined as the “convex hull”(green).

With the visual, we can now see what point is the nearest from the others.
For the code, I tried to make something a bit more organized with what I learned 4 days ago:
– making a list of dictionaries and printing them in a loop: I will avoid writing many times the “print” function.
– making some shortcut names and compacting all the code.
– making a bounding box for a more precise view of where I want to look.
– measuring the exact distances in meters and kilometers between two points (need to be improved).
– trying to make an interactive map to know the coordinates when moving the cursor on the map.

Here is a more compact code so far:

And for the end, my tribute to Stephen Hawkins who left us for the pi day.
I didn’t make the code, but an image in grayscale image has been converted to an ascii art.
Oh, and happy birthday to Albert Einstein too… Gosh, so many things happened for the 3.14

Leave a Reply

Your email address will not be published.