Trigonomectric constants Polar and spherical to rectangular coordinates transform

Dependents:   DISCO-F746NG_Lidar ZAILLEL_Interface

Trigo.h

Committer:
cromda
Date:
2012-11-25
Revision:
1:eb028056d162
Parent:
0:2f533ad7c611
Child:
2:fe695d6c9c83

File content as of revision 1:eb028056d162:

#ifndef MBED_TRIGO_H
#define MBED_TRIGO_H

// Trigo Library
// trogonometric constants and utilities
// rémi cormier 2012


const float Pi=3.141592653590;
const float halfPi=Pi/2.0;
const float twoPi=2.0*Pi;
const float degre=Pi/180.0;// radian

// rectangular (x,y) to polar coordinates (r : radius, a : angle) transform
// a is the angle (radian, counter clockwise), with origin on x axis 
// -pi <= a <= pi
void RecPol(float x, float y, float *r, float *a);

// polar (r : radius, a : angle (rd))) to rectangular (x,y) transform
void PolRec(float r, float a, float *x, float *y);

// Rectangular (x,y,z) to sphérical (r : radius, a : angle, b : angle)
// a is the angle (radian, counter clockwise) betwen the projection of (x,y,z) on xy plane and the x axis
// -pi <= a <= pi
// b is the angle (radian, counter clockwise) betwen (x,y,z) and the xy plane
// -pi/2 <= b <= pi/2
void RecSph(float x, float y, float z, float *r, float *a, float *b);

void SphRec(float r, float a, float b, float *x, float *y, float *z);

#endif