• How to generate uniformly random points on n-spheres and n-balls

    For many Monte Carlo methods, such as those in graphical computing, it is critical to uniformly sample from $d$-dimensional spheres and balls. This post describes over twenty different methods to uniformly random sample from the (surface of) a $d$-dimensional sphere or the (interior of) a $d$-dimensional ball.

  • Evenly Distributing Points in a Triangle.

    Most  two dimensional quasirandom methods focus on sampling over a unit square. However, sampling evenly over the triangle is also very important in computer graphics.  Therefore,  I describe a simple and direct construction method for a point sequence to evenly cover an arbitrary shaped triangle.     

  • A Formula for the Perimeter of an Ellipse

    Unlike for circles, there isn’t a simple exact closed formula for the perimeter of an ellipse. We compare several well-known approximations, and conclude that a formula discovered by Ramanujan is our favourite, due to its simplicity and extreme accuracy.  

  • Going beyond the Golden Ratio.

    I show that for the same reason that the golden ratio, $\phi=1.6180334..$, can be considered the most irrational number, that $1+\sqrt{2}$ can be considered the 2nd most irrational number, and indeed why $(9+\sqrt{221})/10$ can be considered the 3rd most irrational number.  

  • Trigonometry in Pictures

    This post shows how the core trigonometric definitions, relations and addition theorems can be simply and intuitively visualized.  

  • Evenly distributing points on a sphere

    How to distribute points on the surface of a sphere as evenly as possibly is an incredibly important problem in maths, science and computing, and mapping the Fibonacci lattice onto the surface of a sphere via equal-area projection is an extremely fast and effective approximate method to achieve this. I show that with only minor modifications it can be made even better.

  • Lissajous Curves

    This post illustrates and explains the beautiful Lissajous Curves – trajectories of points whose coordinates follow sinusoidal movements.  A simple but timeless classic curve that has numerous applications as well as artistic elegance.  

  • A simple formula for Sequences and Series

    If you are given the initial terms of a sequence, then here is an insanely simple method to derive a general formula for the first N terms, as well as the sum of the first N terms of the sequence.      

  • The Fisher-Yates Algorithm

    Creating unbiased random permutations of lists is often crucial to sampling. The Fisher-Yates shuffle is the definitive method to shuffle a sequence of items. Popularised by Knuth, it is unbiased, has optimal linear time efficiency; uses constant space; and is incremental.  

  • A probabilistic approach
    to fractional factorial design

    I describe a probabilistic alternative to fractional factorial design based on the Sobol’ low discrepancy quasirandom sequence. This method is robust to aliasing  (confounders), is often simpler to implement than traditional fractional factorial sample designs, and produces more accurate results than simple random sampling.

  • Multiple Pendulums

      This fun post illustrates the phenomenon of multiple uncoupled pendulums whose periods are all rational multiples of each other.