# M_PI definition?

Hi guys, i cant find the definition of the constant M_PI ?

i try to understand following command : axes_yaw_max = 90.0*M_PI/180.0;

edit retag close merge delete

Sort by » oldest newest most voted

Your code looks like C(++), so I assume you are talking about M_PI in a C/C++ code file. M_PI is defined in math.h, usually located at /usr/include/ for linux gcc.

# define M_PI       3.14159265358979323846  /* pi */


more

I'm not quite sure where it is defined, but I am pretty sure that it is supposed to be pi (3.1415...). The formula can be reduced to 0.5*PI or an angle of 90° when expressed in radians (http://en.wikipedia.org/wiki/Radians)

more

If it is in C/C++, then, the goal of it is to convert the angle from degree to radian. This is because M_PI is not other than pi of 3.142 as in math.

more