Hello, world!

This is just a collection of stuff I put online. If you want to stalk me, start reading my blog or follow the abundance of tracks I left in social media.

Go to Mathias' Blog » or visit Mathias Frey on Twitter Google+ Github YouTube Facebook Linkedin

Mathias' labs

Finding π

Inside: n.a. Outside: n.a. Current value of π: n.a.

On the left the browser is currently calculating π by means of numeric simulation. Imagine a circular pond inside a square. Random tosses of stones either land in the water or on the ground. The ratio between tosses and hits euqals the ratio of the square's and circle's areas. Thus π can be calculated according to this formula:

square = 4r2
circle = r2π

(inside + outside) / inside == square / circle
(inside + outside) * 4r2π == inside * 4r2

π = inside / (inside + outside) * 4

Since there is some good proof out there that π is something like 3.141592653589793, the result is rather a test of your browser's random number generator than a way of finding π.

Pendulum Waves

I was quite fascinated by the Pendulum Waves on YouTube. Since the underlying physics boils down to a simple sine function I built this simulator using HTML5's canvas element.

Chasing Rectangles

I'm a huge fan of d3 and what people do with it.

Moving Robot

Total 0 Homeruns 0 Percentage 0%

My friends came home from Europython 2012 with a mathemetical problem that turned out to be rather a riddle than a solvable problem (at least for us).

A robot is moving forward with a probability of 30%, sideways with a chance of 25% for each direction and backwards in the remaining cases.

What is the probability that it reaches its point of departure within 13 steps?

Unfortunately we were too dumb to calculate the answer.

So I'm still trying to find a solution via numeric simulation. The output is quite pretty and don't worry, the robot is untiring. So please help the planet becoming a warmer place and join the simulation in your browser window!

If you have the (mathematical!) solution send me an e-mail.

(By the way: There are 67 million possibilities for the robot moving inside the grid. This site needs 776 days to calculate all of them. The probability of the robot moving 13 steps backwards is 0.00000008%. For reasons every software developer can understand, I did although draw the grid up to this point.)


But someday maybe more.

Swimming lane chart

Time 14:15 Lane d

Move around the bluish green booking. The rest of the calendar is fixed.

3D Experiments

Isn't it awesome that modern browsers actually can do 3D rendering? Here I'm using three.js.

Spiders on drugs

First take some...






And guess which drug has the most damaging effect on the spider's net.

People have done quite a bunch of research on the effect of drugs on spiders and their nets.

No spiders were harmed in the production of this simulation.