Index: trunk/psLib/test/astro/tst_psEarthOrientation.c
===================================================================
--- trunk/psLib/test/astro/tst_psEarthOrientation.c	(revision 5749)
+++ trunk/psLib/test/astro/tst_psEarthOrientation.c	(revision 5771)
@@ -5,6 +5,6 @@
 *  @author d-Rob, MHPCC
 *
-*  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-12-08 02:49:04 $
+*  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-12-13 01:31:54 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -344,4 +344,6 @@
         yy = -0.0287618408203125;
         ss = 0.0;
+        xx = SEC_TO_RAD(xx) * 1e-6;
+        yy = SEC_TO_RAD(yy) * 1e-6;
         if ( fabs(pcorr->x - xx) > DBL_EPSILON || fabs(pcorr->y - yy) > DBL_EPSILON
                 || fabs(pcorr->s - ss) > DBL_EPSILON) {
@@ -599,4 +601,8 @@
     //    in->y += -0.0287618408203125;
     //    in->s += 0.0;
+    //    in->x += 3.05224300720406e-7;
+    //    in->y += -1.39441339235822e-7;
+    in->s += 0.0;
+
     double q0,q1,q2,q3;
     q0 = -1.1984522406756289e-5;
@@ -619,13 +625,28 @@
     }
 
-    //    psCube *tempCube = psCubeAlloc();
-    //    tempCube->x = -0.35963388069046304;
-    //    tempCube->y = 0.5555192509816625;
-    //    tempCube->z = 0.749078321908413;
-    //    obj = psCubeToSphere(tempCube);
-    //    psFree(tempCube);
-    obj = psSphereAlloc();
-    obj->r = objR;
-    obj->d = objD;
+    if (fabs(rot->q0-q0) > DBL_EPSILON || fabs(rot->q1-q1) > DBL_EPSILON ||
+            fabs(rot->q2-q2) > DBL_EPSILON || fabs(rot->q3-q3) > DBL_EPSILON) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psSphereRot_CEOtoGCRS failed to return expected values.\n");
+        printf("\n  Output sphere rotation   = %.13g,%.13g,%.13g,%.13g\n",
+               rot->q0, rot->q1, rot->q2, rot->q3);
+        printf("  Expected sphere rotation = %.13g,%.13g,%.13g,%.13g\n", q0,q1,q2,q3);
+        printf("  a difference:   %.13g, %.13g, %.13g, %.13g \n", (rot->q0-q0), (rot->q1-q1),
+               (rot->q2-q2), (rot->q3-q3) );
+        printf("  abs difference:   %.13g, %.13g, %.13g, %.13g \n\n", (rot->q0+q0), (rot->q1+q1),
+               (rot->q2+q2), (rot->q3+q3) );
+        //        return 3;
+    }
+
+
+    psCube *tempCube = psCubeAlloc();
+    tempCube->x = -0.35963388069046304;
+    tempCube->y = 0.5555192509816625;
+    tempCube->z = 0.7497078321908413;
+    obj = psCubeToSphere(tempCube);
+    psFree(tempCube);
+    //    obj = psSphereAlloc();
+    //    obj->r = objR;
+    //    obj->d = objD;
     psSphereRot *precessionNutation = psSphereRotConjugate(NULL, rot);
     psSphere *result = psSphereRotApply(NULL, precessionNutation, obj);
@@ -639,20 +660,20 @@
     printf("A difference of:   %.13g, %.13g, %.13g\n\n",
            (x-cube->x), (y-cube->y), (z-cube->z));
+
+    //great sphere difference between result and expected
+    //Re = 6.38x10^6m
+    psCube *expect = psCubeAlloc();
+    expect->x = x;
+    expect->y = y;
+    expect->z = z;
+    psSphere *expected = psCubeToSphere(expect);
+    psFree(expect);
+    double d = (6.38e6) * acos(cos(result->r)*cos(expected->r)*cos(result->d-expected->d) + sin(result->r)*sin(expected->r));
+    printf("\n\nGreat circle difference of:  %.13g \n", d);
+
+    psFree(expected);
     psFree(obj);
 
 
-    if (fabs(rot->q0-q0) > DBL_EPSILON || fabs(rot->q1-q1) > DBL_EPSILON ||
-            fabs(rot->q2-q2) > DBL_EPSILON || fabs(rot->q3-q3) > DBL_EPSILON) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psSphereRot_CEOtoGCRS failed to return expected values.\n");
-        printf("\n  Output sphere rotation   = %.13g,%.13g,%.13g,%.13g\n",
-               rot->q0, rot->q1, rot->q2, rot->q3);
-        printf("  Expected sphere rotation = %.13g,%.13g,%.13g,%.13g\n", q0,q1,q2,q3);
-        printf("  a difference:   %.13g, %.13g, %.13g, %.13g \n", (rot->q0-q0), (rot->q1-q1),
-               (rot->q2-q2), (rot->q3-q3) );
-        printf("  abs difference:   %.13g, %.13g, %.13g, %.13g \n\n", (rot->q0+q0), (rot->q1+q1),
-               (rot->q2+q2), (rot->q3+q3) );
-        return 3;
-    }
 
     psSphere *test = psSphereAlloc();
@@ -708,9 +729,9 @@
         psError(PS_ERR_BAD_PARAMETER_VALUE, false,
                 "psSphereRot_ITRStoTEO failed to return expected values.\n");
-        printf("\n  Output sphere rotation   = %.13g,%.13g,%.13g,%.13g\n",
+        printf("\n  Output sphere rotation   = %.13g, %.13g, %.13g, %.13g\n",
                rot->q0, rot->q1, rot->q2, rot->q3);
-        printf("  Expected sphere rotation = %.13g,%.13g,%.13g,%.13g\n", q0,q1,q2,q3);
-        printf("  a difference:   %.13g, %.13g, %.13g, %.13g \n", (rot->q0-q0), (rot->q1-q1),
-               (rot->q2-q2), (rot->q3-q3) );
+        printf("  Expected sphere rotation = %.13g, %.13g, %.13g, %.13g\n", q0,q1,q2,q3);
+        //        printf("  a difference:   %.13g, %.13g, %.13g, %.13g \n", (rot->q0-q0), (rot->q1-q1),
+        //               (rot->q2-q2), (rot->q3-q3) );
         return 3;
     }
