#include #include #include #ifndef __US2SPHERICAL_H__ #define __US2SPHERICAL_H__ #include "s2plot.h" /* CONSTANTS */ #define D2R 0.017453292519943295 /* Conversion of degrees to radians */ #define RA2R 0.261799387799149408 /* Conversion of RA (hrs) to radians */ #define R2D 57.295779513082322865 /* Conversion of radians to degrees */ #define DEMIN -90.0 /* Maximum Declination in degrees */ #define DEMAX +90.0 /* Maximum Declination in degrees */ #define RAMIN 0.0 /* Minimum RA value in hours */ #define RAMAX 24.0 /* Maximum RA value in hours */ #define RASTEPS 48 /* Number of circle segments for RA lines */ #define DESTEPS 48 /* Number of circle segments for DE lines */ #define SMALLEPS 1.0E-6 /* A small number */ /* FUNCTION PROTOTYPES */ /* Coordinate functions */ /* Convert RA (hours) and Declination (degrees) into XYZ coordinates */ /* for a sphere of given radius */ XYZ us2rade2xyz(float ra, float dec, float radius); /* Plot N pairs of RA (hours) and Declination (degrees) points */ /* Sphere has radius r, plot using symbol sym */ void us2radept(int N, float *ra, float *dec, float *radius, int *sym); /* Plot a single RA (hours) and Declination (degrees) point */ /* Sphere has radius r, plot using symbol sym */ void us2radept1(float ra, float dec, float radius, int sym); /* Draw a line at constant RA (hours) between Declinations (degrees) */ /* demin and demax. Sphere has radius r */ void us2raline(float ra, float demin, float demax, float r); /* Draw a line at constant Declination (degrees) between RAs (hours) */ /* ramin and ramax. Sphere has radius r */ void us2deline(float de, float ramin, float ramax, float r); /* Draw a RA (hour) and Declination (degrees) grid with integer steps in */ /* RA and Declination. Sphere has radius r */ void us2radegrid(int rastep, int destep, float radius); /* Draw an arrow between radius r1 and radius r2 for constant RA (hour) */ /* and Declination (degrees). Arrow has colour ci and size sz */ void us2radearrow(double ra, double de, double r1, double r2, int ci, int sz); /* Draw a line from (ra1,de1) to (ra2,de2) - does not work in all cases */ void us2radeline(float ra1, float de1, float ra2, float de2, float radius); /* Vector functions */ XYZ unit(XYZ a); float dotp(XYZ a, XYZ b); float length(XYZ a); float dota(XYZ a, XYZ b); XYZ cross(XYZ a, XYZ b); #endif