Added script front-end for primer-design code
[htsworkflow.git] / htswanalysis / MACS / lib / gsl / gsl-1.11 / doc / examples / const.c
1 #include <stdio.h>
2 #include <gsl/gsl_const_mksa.h>
3
4 int
5 main (void)
6 {
7   double c  = GSL_CONST_MKSA_SPEED_OF_LIGHT;
8   double au = GSL_CONST_MKSA_ASTRONOMICAL_UNIT;
9   double minutes = GSL_CONST_MKSA_MINUTE;
10
11   /* distance stored in meters */
12   double r_earth = 1.00 * au;  
13   double r_mars  = 1.52 * au;
14
15   double t_min, t_max;
16
17   t_min = (r_mars - r_earth) / c;
18   t_max = (r_mars + r_earth) / c;
19
20   printf ("light travel time from Earth to Mars:\n");
21   printf ("minimum = %.1f minutes\n", t_min / minutes);
22   printf ("maximum = %.1f minutes\n", t_max / minutes);
23
24   return 0;
25 }