## Posts Tagged ‘Random’

### Random hopping

Saturday, January 29th, 2011

Two years ago or so, a friend of mine showed me a neat trick. The idea is very simple:

1. Start of at a corner of an equilateral triangle
2. Randomly choose any of the three corners
3. Go half-way towards that corner
4. Mark this spot
5. Goto step 2 and do this until you’re sick

So if we do these steps a couple of times we end up with something like:

(more…)

### Random point on a sphere

Tuesday, December 8th, 2009

For a different project I needed a random point on a sphere, my first implementation was creating a random $\phi$ and $\theta$ and then calculate the coordinates as:

$x=\cos(\theta)\sin(\phi) \\y=\sin(\theta)\sin(\phi) \\z=\cos(\phi)$

It gives you random points on a sphere, however the distribution of the points is not constant. (more…)