Trigonomectric constants Polar and spherical to rectangular coordinates transform

Dependents:   DISCO-F746NG_Lidar ZAILLEL_Interface

Committer:
cromda
Date:
Sun Nov 25 11:35:18 2012 +0000
Revision:
1:eb028056d162
Parent:
0:2f533ad7c611
Child:
2:fe695d6c9c83
Documented

Who changed what in which revision?

UserRevisionLine numberNew contents of line
cromda 0:2f533ad7c611 1 #ifndef MBED_TRIGO_H
cromda 0:2f533ad7c611 2 #define MBED_TRIGO_H
cromda 0:2f533ad7c611 3
cromda 1:eb028056d162 4 // Trigo Library
cromda 1:eb028056d162 5 // trogonometric constants and utilities
cromda 1:eb028056d162 6 // rémi cormier 2012
cromda 1:eb028056d162 7
cromda 0:2f533ad7c611 8
cromda 0:2f533ad7c611 9 const float Pi=3.141592653590;
cromda 1:eb028056d162 10 const float halfPi=Pi/2.0;
cromda 1:eb028056d162 11 const float twoPi=2.0*Pi;
cromda 1:eb028056d162 12 const float degre=Pi/180.0;// radian
cromda 0:2f533ad7c611 13
cromda 1:eb028056d162 14 // rectangular (x,y) to polar coordinates (r : radius, a : angle) transform
cromda 1:eb028056d162 15 // a is the angle (radian, counter clockwise), with origin on x axis
cromda 1:eb028056d162 16 // -pi <= a <= pi
cromda 0:2f533ad7c611 17 void RecPol(float x, float y, float *r, float *a);
cromda 0:2f533ad7c611 18
cromda 1:eb028056d162 19 // polar (r : radius, a : angle (rd))) to rectangular (x,y) transform
cromda 0:2f533ad7c611 20 void PolRec(float r, float a, float *x, float *y);
cromda 0:2f533ad7c611 21
cromda 1:eb028056d162 22 // Rectangular (x,y,z) to sphérical (r : radius, a : angle, b : angle)
cromda 1:eb028056d162 23 // a is the angle (radian, counter clockwise) betwen the projection of (x,y,z) on xy plane and the x axis
cromda 1:eb028056d162 24 // -pi <= a <= pi
cromda 1:eb028056d162 25 // b is the angle (radian, counter clockwise) betwen (x,y,z) and the xy plane
cromda 1:eb028056d162 26 // -pi/2 <= b <= pi/2
cromda 0:2f533ad7c611 27 void RecSph(float x, float y, float z, float *r, float *a, float *b);
cromda 0:2f533ad7c611 28
cromda 0:2f533ad7c611 29 void SphRec(float r, float a, float b, float *x, float *y, float *z);
cromda 0:2f533ad7c611 30
cromda 0:2f533ad7c611 31 #endif