ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

M_PI definition?

asked 2012-02-14 00:37:01 -0500

hmmm gravatar image

updated 2014-01-28 17:11:22 -0500

ngrennan gravatar image

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 flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted
5

answered 2012-02-14 01:12:46 -0500

Kai Bublitz gravatar image

updated 2012-02-14 01:15:26 -0500

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 */

If I got your question wrong please be more specific.

edit flag offensive delete link more
1

answered 2012-02-14 01:03:37 -0500

NsN gravatar image

updated 2012-02-14 01:04:03 -0500

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)

edit flag offensive delete link more
0

answered 2012-02-14 01:57:35 -0500

alfa_80 gravatar image

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.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-02-14 00:37:01 -0500

Seen: 6,051 times

Last updated: Feb 14 '12