Added definition of M_PI if not defined

TIL M_PI is not in C or C++ standards but only required by POSIX.