Today it is June the 28th which means that it is day!

The irrational and transcendental constant is what defines , which obviously makes it an important constant. To celebrate this day, I created a C program which calculates by randomly creating 9-dimensional points inside the 9-dimensional hypercube and testing if they are inside the 9-dimensional hypersphere with its center located at .

Today’s time is 3:18:53 as . As one does not know if the time is specified as ante or post meridiem, there are actually two perfectly acceptable times.

;b$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$b h$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ .$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ,$$$$$$$$$kn}~I"`($$$$$$$x```````````````` )$$$m $$$$$$$$ +$$c q$$$$$$$> $$ $$$$$$$$ $$$$$$$$. '$$$$$$$$ $$$$$$$$ ?$$$$$$$a $$$$$$$$ Q$$$$$$$f $$$$$$$$ $$$$$$$$i $$$$$$$$ $$$$$$$$; $$$$$$$$ J$$$$$$$w $$$$$$$$; $$~ $$$$$$$$ $$$ '$$$$$$$$C "$$$ $$$$$$$$$w '$$$$ $$$$$$$$$$$$$$$$$$$$B $$$$$$$$$$$$$$$$$$. $$$$$$$$$$$$$$$' 8$$$$$$$q

The formula used for calculating is derived from a 9-dimensional hypersphere’s hypervolume formula (see this Wikipedia article).

The constant gets calculated to . The real value is approximately , which makes the percent error .

Thereby this C program’s approximation is not too far off. The source code is listed below and can also be downloaded here. Instructions on how to compile it using GCC can be seen below or in the source code.

```
gcc tau.c -o tau -lm; ./tau
tau = 6.293700
```

Resources worth checking out regarding are The Tau Manifesto and 2 Pi or Not 2 Pi?. I wish everybody a happy day.

```
// C Code
// Jonathan Frech, 27th of June 2017
```

```
// === COMPILATION AND EXECUTION ===
// gcc tau.c -o tau -lm; ./tau
// tau = 6.293700
// This program creates random 9-dimensional
// points inside the unit 9-dimensional hyper-
// cube and tests, if they are in the hyper-
// sphere with radius .5. From this information
// it calculates the constant tau.
// Happy tau day to everyone!
// inclusion
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
// number of iterations
#define ITR 1e8
// generate random number in the intervall [0, 1]
double rnd() { return (double) rand()/RAND_MAX; }
// main funtion
int main() {
// seed random number generator
srand(time(NULL));
// number of points in hypersphere, outer part of the hypercube
long sph = 0, cub = 0;
// look at randomly generated 9-dimensional points
for (int i = 0; i < ITR; i++) {
// generate random 9-dimensional point
double vec[9] = {rnd(), rnd(), rnd(), rnd(), rnd(), rnd(), rnd(), rnd(), rnd()};
// point's distance to (.5, .5, .5, .5, .5, .5, .5, .5, .5)
double dst = sqrt((vec[0]*vec[0]+vec[1]*vec[1]+vec[2]*vec[2]+vec[3]*vec[3]+vec[4]*vec[4]+vec[5]*vec[5]+vec[6]*vec[6]+vec[7]*vec[7]+vec[8]*vec[8])/4.);
// determine if point is inside hypersphere
if (dst <= .5) { sph++; }
else { cub++; }
}
// calculate hypersphere's volume
double vol = (double) sph/cub;
// calculate tau
double tau = pow(241920*vol, .25);
// output result
printf("tau = %f\n", tau);
}
```