Index: /trunk/psLib/test/astronomy/tst_psCoord.c
===================================================================
--- /trunk/psLib/test/astronomy/tst_psCoord.c	(revision 2983)
+++ /trunk/psLib/test/astronomy/tst_psCoord.c	(revision 2984)
@@ -6,6 +6,6 @@
 *  @author GLG, MHPCC
 *
-*  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-01-13 22:45:40 $
+*  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-01-13 22:53:37 $
 *
 *  XXX: Must test psSpherePrecess.
@@ -60,12 +60,4 @@
                           };
 
-#define ARCSEC_TO_RAD (M_PI / (180.0 * 60.0 * 60.0))
-#define ARCMIN_TO_RAD (M_PI / (180.0 * 60.0))
-#define MY_DEG_TO_RAD (M_PI / 180.0)
-#define MY_RAD_TO_DEG (180.0 / M_PI)
-#define RAD_TO_ARCMIN ((180.0 * 60.0) / M_PI)
-#define RAD_TO_ARCSEC ((180.0 * 60.0 * 60.0) / M_PI)
-
-
 psS32 main( psS32 argc, char* argv[] )
 {
@@ -1026,6 +1018,6 @@
             offset = psSphereGetOffset(&position1, &position2,
                                        PS_SPHERICAL, PS_ARCMIN);
-            offset->r = offset->r * ARCMIN_TO_RAD;
-            offset->d = offset->d * ARCMIN_TO_RAD;
+            offset->r = MIN_TO_RAD(offset->r);
+            offset->d = MIN_TO_RAD(offset->d);
             PS_COMPARE_TINY_THEN_PRINT_ERROR(offset->r, (position2.r - position1.r), 2);
             PS_COMPARE_TINY_THEN_PRINT_ERROR(offset->d, (position2.d - position1.d), 3);
@@ -1034,6 +1026,6 @@
             offset = psSphereGetOffset(&position1, &position2,
                                        PS_SPHERICAL, PS_ARCSEC);
-            offset->r = offset->r * ARCSEC_TO_RAD;
-            offset->d = offset->d * ARCSEC_TO_RAD;
+            offset->r = SEC_TO_RAD(offset->r);
+            offset->d = SEC_TO_RAD(offset->d);
             PS_COMPARE_TINY_THEN_PRINT_ERROR(offset->r, (position2.r - position1.r), 2);
             PS_COMPARE_TINY_THEN_PRINT_ERROR(offset->d, (position2.d - position1.d), 3);
@@ -1130,6 +1122,6 @@
             psFree(position2);
 
-            tmpOffset.r = offset.r * RAD_TO_ARCMIN;
-            tmpOffset.d = offset.d * RAD_TO_ARCMIN;
+            tmpOffset.r = RAD_TO_MIN(offset.r);
+            tmpOffset.d = RAD_TO_MIN(offset.d);
             tmpOffset.rErr = 0.0;
             tmpOffset.dErr = 0.0;
@@ -1140,6 +1132,6 @@
             psFree(position2);
 
-            tmpOffset.r = offset.r * RAD_TO_ARCSEC;
-            tmpOffset.d = offset.d * RAD_TO_ARCSEC;
+            tmpOffset.r = RAD_TO_SEC(offset.r);
+            tmpOffset.d = RAD_TO_SEC(offset.d);
             tmpOffset.rErr = 0.0;
             tmpOffset.dErr = 0.0;
@@ -1244,4 +1236,16 @@
 }
 
+bool testNonEqualF32(psF32 num1, psF32 num2)
+{
+    if ((fabs(num1) <= FLT_EPSILON) && (fabs(num2) <= FLT_EPSILON)) {
+        return(false);
+    }
+
+    if (fabs((num2 - num1) / num1) <= ERROR_PERCENT) {
+        return(false);
+    }
+    return(false);
+}
+
 #define NUM_DEGREES 5
 /******************************************************************************
@@ -1274,5 +1278,5 @@
 
     #define RADIUS_DEG 30.0
-    #define NUM_ANGLES 20
+    #define NUM_ANGLES 30
     #define MY_DEG_INC ((2.0 * RADIUS_DEG) / NUM_ANGLES)
 
@@ -1291,6 +1295,6 @@
             endCoords = psDeproject(planeCoords, &myProj);
 
-            if ((fabs((endCoords->r - startCoords.r) / startCoords.r) > ERROR_PERCENT) ||
-                    (fabs((endCoords->d - startCoords.d) / startCoords.d) > ERROR_PERCENT)) {
+            if (testNonEqualF32(endCoords->r, startCoords.r) ||
+                    testNonEqualF32(endCoords->d, startCoords.d)) {
                 printf("ERROR: \n");
                 printf("    startCoords (R, D) is (%f, %f)\n", startCoords.r, startCoords.d);
@@ -1307,2 +1311,3 @@
 
 // This code will ...
+
