Trigonomectric constants Polar and spherical to rectangular coordinates transform
Dependents: DISCO-F746NG_Lidar ZAILLEL_Interface
Diff: Trigo.cpp
- Revision:
- 1:eb028056d162
- Parent:
- 0:2f533ad7c611
- Child:
- 4:a6b0fd2c4f85
diff -r 2f533ad7c611 -r eb028056d162 Trigo.cpp --- a/Trigo.cpp Sun Nov 25 11:13:56 2012 +0000 +++ b/Trigo.cpp Sun Nov 25 11:35:18 2012 +0000 @@ -1,6 +1,10 @@ #include "mbed.h" #include "Trigo.h" +// Trigo Library +// trogonometric constants and utilities +// rémi cormier 2012 + void RecPol(float x, float y, float *r, float *a) {*r=sqrt(x*x+y*y); if (x==0.0) @@ -8,15 +12,15 @@ {*a=0.0;} else {if (y>=0.0) - {*a=Pis2;} + {*a=halfPi;} else - {*a=-Pis2;}}} + {*a=-halfPi;}}} else {*a=atan(y/x); if(x<0) {*a=Pi+*a;} if (*a>Pi) - {*a=*a-DeuxPi;} + {*a=*a-twoPi;} } }