I have to turn a AZ/EL rotor system into a XY system.

For the X part this is the formula where az and el are the Azimuth and Elevation values.

Y = Degrees ( ArcSin ( Sin ( Radians ( -az ) * Cos ( Radians ( -el )))) + 90.0

In arduino code this would look like:

```
#include "Arduino.h"
#include <SoftwareSerial.h>
#include <Streaming.h>
#include <math.h>
long _XX;
long _YY;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
delay(1000);
_xyConvert(36000, 19700);
}
void loop() {
}
void _xyConvert(long el, long az)
{
double azFloat = az;
azFloat = azFloat /100;
double elFloat = el;
elFloat = elFloat /100;
_XX = atan(cos(-az) / tan(-el)) + 90;
_YY = asin(sin(-az) * cos(-el) ) + 90;
Serial << _FLOAT(_XX,2) << " - " << _FLOAT(_YY,2) << endl;
}
```

But the result in both equals zero. Any help would be wolcome.

Moderator edit: Tags hopefully corrected