Plan 9 from Bell Labs’s /usr/web/sources/contrib/pdt/sky/include/sky.h

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


typedef struct Gdloc Gdloc;
typedef struct Eqloc Eqloc;
typedef struct Hzloc Hzloc;
typedef struct Gxloc Gxloc; 
typedef struct Planar Planar;
typedef struct Obs Obs;
typedef struct Viewangle Viewangle;
typedef struct Camera Camera;

/* geodetic location */
struct Gdloc
{
	double lat;	/* in rad */
	double lng;	/* in rad */
	double alt;	/* in meters from mean sea level */
};

/* equatorial location */
struct Eqloc
{
	double ra;		/* right ascension in rad */
	double dec;	/* declination in rad */
};

/* horizontal location */
struct Hzloc
{
	double az;	/* azimuth in rad */
	double z;		/* zenith in rad (complement of elevation) */
};

/* galactic location */
struct Gxloc
{
	double b;		/* galactic latitude in rad */
	double l;		/* galactic longitude in rad */
};

/* 2D projection */
struct Planar
{
	double x, y;
};

struct Obs
{
	Gdloc g;
	double P;		/* pressure in kPa */
	double T;		/* temperature in K */
	double rh;		/* relative humidity */
};

struct Viewangle
{
	double az;	/* azimuth in rad */
	double z;		/* zenith in rad (complement of elevation) */
	double roll;	/* roll in rad */
};

struct Camera
{
	double f;		/* focal length in mm */
	double w, h;	/* sensor dimensions in mm */
	int wpx, hpx;	/* sensor dimensions in pixels */		
	Viewangle angle;
};

extern Obs defaultObs;
extern Camera defaultCamera;

#define TWOPI (PI+PI)
#define DEG 1.745329251994329576923e-2
#define DMIN 2.908882086657215961539e-4
#define DSEC 4.848136811095359935899e-6
#define HOUR 2.617993877991494365386e-1
#define MIN 4.363323129985823942309e-3
#define SEC 7.272205216643039903849e-5

#define JD00 2451545.0
#define JDX100 36525.0

/* atmospheric conditions for refraction */
#define STP_kPa 100.0
#define STP_K 273.15
#define NTP_kPa 101.325
#define NTP_K 293.15


Eqloc gx2eq00(Gxloc gx);
Gxloc eq2gx00(Eqloc eq);

Hzloc eq2hz(Eqloc eq, Gdloc geod, double jdutc, double dut1, double dt);
Eqloc hz2eq(Hzloc hz, Gdloc geod, double jdutc, double dut1, double dt);

Planar hz2pxl(Camera *c, Hzloc hz);
Hzloc pxl2hz(Camera *c, Planar px);

double gast(double jd, double dut1, double dt);
double eqeqx(double jd, double dut1, double dt);

double saemundsson(Obs *o, double z);

#define deg2rad(d) ( (d) * DEG )
#define rad2deg(a) ( (a) / DEG )
#define h2rad(h) ( (h) * HOUR )
#define rad2h(a) ( (a) / HOUR )
#define hms2h(h, m, s) ( (h) + (m)/60.0d + (s)/3600.0d )
#define hms2rad(h, m, s) ( (h)*HOUR+(m)*MIN+(s)*SEC )
#define degms2rad(d, m, s) ( (d)*DEG+(m)*DMIN+(s)*DSEC )


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.