Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

slamac.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002 * E.S.O. - VLT project
00003 *
00004 * "@(#) $Id: slamac.h,v 1.17 2001/02/05 10:15:33 vltsccm Exp $"
00005 *
00006 * who       when      what
00007 * --------  --------  ----------------------------------------------
00008 * rkarban  05/02/01  created from generic slalib sources
00009 */
00010 
00011 /************************************************************************
00012  *
00013  *----------------------------------------------------------------------
00014  */
00015 
00016 
00017 
00018 #ifndef SLAMACHDEF
00019 #define SLAMACHDEF
00020 
00021 /*
00022 **  - - - - - - - - -
00023 **   s l a m a c . h
00024 **  - - - - - - - - -
00025 **
00026 **  Macros used by slalib library.
00027 **
00028 **  Last revision:   16 October 2000
00029 **
00030 **  Copyright P.T.Wallace.  All rights reserved.
00031 */
00032 
00033 /* max(A,B) - larger (most +ve) of two numbers (generic) */
00034 #define gmax(A,B) ((A)>(B)?(A):(B))
00035 
00036 /* min(A,B) - smaller (least +ve) of two numbers (generic) */
00037 #define gmin(A,B) ((A)<(B)?(A):(B))
00038 
00039 /* dint(A) - truncate to nearest whole number towards zero (double) */
00040 #define dint(A) ((A)<0.0?ceil(A):floor(A))
00041 
00042 /* aint(A) - truncate to nearest whole number towards zero (float) */
00043 #define aint(A) ((A)<0.0f?(float)ceil((double)(A)):(float)floor((double)(A)))
00044 
00045 /* dnint(A) - round to nearest whole number (double) */
00046 #define dnint(A) ((A)<0.0?ceil((A)-0.5):floor((A)+0.5))
00047 
00048 /* anint(A) - round to nearest whole number (float) */
00049 #define anint(A) ((float)dnint((double)(A)))
00050 
00051 /* dsign(A,B) - magnitude of A with sign of B (double) */
00052 #define dsign(A,B) ((B)<0.0?-(A):(A))
00053 
00054 /* dmod(A,B) - A modulo B (double) */
00055 #define dmod(A,B) ((B)!=0.0?((A)*(B)>0.0?(A)-(B)*floor((A)/(B))\
00056                                         :(A)+(B)*floor(-(A)/(B))):(A))
00057 
00058 /* logicals */
00059 #if !defined(FALSE) || ((FALSE)!=0)
00060 #define FALSE 0
00061 #endif
00062 #if !defined(TRUE) || ((TRUE)!=1)
00063 #define TRUE 1
00064 #endif
00065 
00066 /* pi */
00067 #define DPI 3.1415926535897932384626433832795028841971693993751
00068 
00069 /* 2pi */
00070 #define D2PI 6.2831853071795864769252867665590057683943387987502
00071 
00072 /* 1/(2pi) */
00073 #define D1B2PI 0.15915494309189533576888376337251436203445964574046
00074 
00075 /* 4pi */
00076 #define D4PI 12.566370614359172953850573533118011536788677597500
00077 
00078 /* 1/(4pi) */
00079 #define D1B4PI 0.079577471545947667884441881686257181017229822870228
00080 
00081 /* pi^2 */
00082 #define DPISQ 9.8696044010893586188344909998761511353136994072408
00083 
00084 /* sqrt(pi) */
00085 #define DSQRPI 1.7724538509055160272981674833411451827975494561224
00086 
00087 /* pi/2:  90 degrees in radians */
00088 #define DPIBY2 1.5707963267948966192313216916397514420985846996876
00089 
00090 /* pi/180:  degrees to radians */
00091 #define DD2R 0.017453292519943295769236907684886127134428718885417
00092 
00093 /* 180/pi:  radians to degrees */
00094 #define DR2D 57.295779513082320876798154814105170332405472466564
00095 
00096 /* pi/(180*3600):  arcseconds to radians */
00097 #define DAS2R 4.8481368110953599358991410235794797595635330237270e-6
00098 
00099 /* 180*3600/pi :  radians to arcseconds */
00100 #define DR2AS 2.0626480624709635515647335733077861319665970087963e5
00101 
00102 /* pi/12:  hours to radians */
00103 #define DH2R 0.26179938779914943653855361527329190701643078328126
00104 
00105 /* 12/pi:  radians to hours */
00106 #define DR2H 3.8197186342054880584532103209403446888270314977709
00107 
00108 /* pi/(12*3600):  seconds of time to radians */
00109 #define DS2R 7.2722052166430399038487115353692196393452995355905e-5
00110 
00111 /* 12*3600/pi:  radians to seconds of time */
00112 #define DR2S 1.3750987083139757010431557155385240879777313391975e4
00113 
00114 /* 15/(2pi):  hours to degrees x radians to turns */
00115 #define D15B2P 2.3873241463784300365332564505877154305168946861068
00116 
00117 #endif

Generated on Wed Dec 3 14:52:19 2003 for ATCS API by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001