David,

thanks for answering about my questions. I checked that single precision should be enough, this is a quick test for a HotBird Satellite seen from Milan, Italy. It seems to work:

```
#include <pololu/orangutan.h>
#include <stdio.h> // required for printf()
#include <math.h> // required for printf()
int main()
{
lcd_init_printf();
clear();
double PosLat, PosLong, SatLong,v1,v2,SatElevation,SatAzimuth,SatPolarization;
/* Address: milan, Italy
Latitude: 45.4637°
Longitude: 9.1881°
Satellite: 13E HOT BIRD 6 | HOT BIRD 8 | HOT BIRD 9
Elevation: 37.5°
Azimuth (true): 174.6°
Azimuth (magn.): 173.0°
*/
// play("L16 ceg>c");
PosLat = 45.4637;
PosLong = 9.1881;
SatLong = 13;
PosLat = (2*M_PI*PosLat) / 360.0;
PosLong = (2*M_PI*PosLong) / 360.0;
SatLong = (2*M_PI*SatLong) / 360.0;
SatElevation = 0;
SatAzimuth = 0;
SatPolarization = 0;
printf("Pos %fN",PosLat);
printf(" %fE",PosLong);
while(1)
{
red_led(255);
green_led(255);
v1 = 6.612 * cos(PosLat)*cos(PosLong-SatLong)-1;
v2 = 6.612 * sqrt( 1-(pow(cos(PosLat),2)) * pow((cos(PosLong-SatLong)),2) );
SatElevation = atan(v1/v2);
SatAzimuth = M_PI + atan( tan(PosLong-SatLong) / sin(PosLat) );
SatPolarization = -atan( sin(PosLong-SatLong) /tan(PosLat) );
clear();
SatElevation = (SatElevation * 360.0) / (2*M_PI);
SatAzimuth = (SatAzimuth * 360.0) / (2*M_PI);
printf("Az %f\n",SatElevation);
printf("El %f",SatAzimuth);
}
return 0;
}
Now I need to play with the compass and GPS...
Thanks.
Giuseppe Marullo
```