Index: trunk/Ohana/src/libohana/include/ohana.h
===================================================================
--- trunk/Ohana/src/libohana/include/ohana.h	(revision 18428)
+++ trunk/Ohana/src/libohana/include/ohana.h	(revision 19823)
@@ -203,4 +203,5 @@
 double  ohana_lst              PROTO((double jd, double longitude));
 int     ohana_str_to_radec     PROTO((double *ra, double *dec, char *str1, char *str2));
+double  ohana_normalize_angle  PROTO((double angle));
 
 int     hstgsc_hms_to_deg      PROTO((double *h0, double *h1, double *d0, double *d1, char *string));
Index: trunk/Ohana/src/libohana/src/time.c
===================================================================
--- trunk/Ohana/src/libohana/src/time.c	(revision 18428)
+++ trunk/Ohana/src/libohana/src/time.c	(revision 19823)
@@ -434,2 +434,36 @@
   return (sid_g);
 }
+
+double ohana_normalize_angle (double angle) {
+
+    double result;
+
+    // take an input angle and force the domain to be 0.0 - 360.0
+    // there are a few ways to do this:  
+
+    // option 1: This is a potentially very slow method, also subject to round off errors
+# if (0)
+    while (angle > 360.0) angle -= 360.0;
+    while (angle <   0.0) angle += 360.0;
+# endif
+    
+    // option 2: take sin & cos, apply atan2 (y, x) 
+# if (1)    
+    double x, y;
+
+    x = cos(angle*RAD_DEG);
+    y = sin(angle*RAD_DEG);
+
+    result = atan2 (y, x);
+    if (result < 0.0) result += 360.0;
+# endif
+
+# if (0)
+    // option 3:
+    int nCircle = angle / 360.0;
+    result -= 360.0*nCircle;
+    if (result < 0.0) result += 360.0;
+# endif
+
+    return (result);
+}
