I can't find a c# version of libastro so I guess I have to convert it myself. It doesn't look all that hard though it does use static locals a lot which c# doesn't support. I figure I'll have to use class static vars and rename them so different methods don't mess with other methods using the same local var name.
So my question is, is that a reasonable approach or does anyone know a better way? An example of the C code is below.
So my question is, is that a reasonable approach or does anyone know a better way? An example of the C code is below.
C code:
static void
aaha_aux (
double lt,
double x, double y,
double *p, double *q)
{
static double last_lt = -3434, slt, clt;
double cap, B;
if (lt != last_lt) {
slt = sin(lt);
clt = cos(lt);
last_lt = lt;
}
solve_sphere (-x, PI/2-y, slt, clt, &cap, &B);
*p = B;
*q = PI/2 - acos(cap);
}