Blog

A blog of Python-related topics and code.

Power Spectra for "Blue" and Uniform Noise

The previous post provided some code for generating Poisson disc noise (in which no point the sample is closer than some fixed distance from any other). Here is a short program to calculate the power spectrum of this noise and compare it with the spectrum for the same number of points drawn from a uniform distribution.

Poisson disc sampling in Python

A set of points drawn from a uniform distribution on a two-dimensional domain typically display clustering:

Making a maze

The Depth-first search algorithm is a simple approach to generating a maze. It is well described and illustrated in lots of places on the internet, so only an outline is given here.

DOI to BibTeX

The Digital Object Identifier (DOI) resolution service at doi.org exposes an API for retrieving the BibTeX markup for a reference given its DOI. The following Python 3 script takes a DOI on the command line and returns the BibTeX. For example,

Making word wheels

Just a small script to generate word wheel puzzles: run from the command line by giving the any number of letters (central letter first) and redirecting its output to a file. Output is as an SVG file.