A blog of Python-related topics and code.
Following on from this earlier post, here is a class,
TruchetHexes, which generates a pleasing weave-like pattern by tiling the following hexagon shapes in random orientations.
STATISTICS AUSTRIA provides economic and demographic statistical services to the state of Austria. This page lists the Consumer Price Index it calculates every month according to a methodology that is updated every five years.
The following code implements a Quadtree in Python (see the previous blog post). There are three classes:
Point represents a point in two-dimensional space, with an optional "payload" (data structure associating the
Point with more information, for example the identity of an object). The
Rect class represents a rectangle in two-dimensional space through its centre, width and height. There are methods to determine if a given
Point object is inside the
Rect and to determine if the
Rect intersects another
Following on from this post about the simple double pendulum, (two bobs connected by light, rigid rods), this post animates the double compound pendulum (also called a double complex or physical pendulum): two rods connected to each other, with their mass distributed along their length. The analysis on Wikipedia provides the dynamical equations for the case of equal-mass and equal-length rods. Here, the more general case of rods with lengths $l_1$ and $l_2$ and masses $m_1$ and $m_2$ is considered.
To find your Hollywood Walk of Fame Quarantine house, use this script on the command line, providing your latitude and longitude: