added a conditional macro define for the use_math defines which lets the code see M_PI