# include "external.h"
# include "shell.h"
# include "dvomath.h"
# include "convert.h"
# include "display.h"
# include "data.h"

# ifndef ASTRO_H
# define ASTRO_H

void InitAstro (void);
void FreeAstro (void);

typedef struct {
  int    isIdentity;	      // identity transformation 
  double phi;		      // saved in radians
  double Xo;		      // saved in radians
  double xo;		      // saved in degrees
  double sin_phi_cos_Xo;      // pre-computed values
  double sin_phi_sin_Xo;      // pre-computed values
  double cos_phi_cos_Xo;      // pre-computed values
  double cos_phi_sin_Xo;      // pre-computed values
  double cos_phi;	      // pre-computed values
  double sin_phi;	      // pre-computed values
  double cos_Xo;	      // pre-computed values
  double sin_Xo;	      // pre-computed values
} CoordTransform;

typedef enum {COORD_NONE, COORD_CELESTIAL, COORD_GALACTIC, COORD_ECLIPTIC} CoordTransformSystem;

CoordTransform *InitTransform (CoordTransformSystem input, CoordTransformSystem output);
int ApplyTransform (double *x, double *y, double X, double Y, CoordTransform *transform);

# endif
