Index: /trunk/psLib/test/astronomy/tst_psCoord.c
===================================================================
--- /trunk/psLib/test/astronomy/tst_psCoord.c	(revision 3351)
+++ /trunk/psLib/test/astronomy/tst_psCoord.c	(revision 3352)
@@ -6,6 +6,6 @@
 *  @author GLG, MHPCC
 *
-*  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-02-25 22:27:37 $
+*  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-03-01 21:40:28 $
 *
 *  XXX: Must test psSpherePrecess.
@@ -29,4 +29,7 @@
 static psS32 testSphereTransformApply1( void );
 static psS32 testSphereTransformApply2( void );
+static psS32 testSphereTransformApply3( void );
+static psS32 testSphereTransformApply4( void );
+static psS32 testSphereTransformApply5( void );
 static psS32 testSphereTransformICRSToEcliptic( void );
 static psS32 testSphereTransformEclipticToICRS( void );
@@ -45,6 +48,9 @@
                               {test2, 0000, "psPlaneTransformApply()", 0, false},
                               {test3, 0000, "psPlaneDistortApply()", 0, false},
-                              {testSphereTransformApply1, 820, "psPSphereTransformApply()", 0, false},
-                              {testSphereTransformApply2, 820, "psPSphereTransformApply()", 0, false},
+                              {testSphereTransformApply1, 820, "psSphereTransformApply()", 0, false},
+                              {testSphereTransformApply2, 820, "psSphereTransformApply()", 0, false},
+                              {testSphereTransformApply3, 820, "psSphereTransformApply()", 0, false},
+                              {testSphereTransformApply4, 820, "psSphereTransformApply()", 0, false},
+                              {testSphereTransformApply5, 820, "psSphereTransformApply()", 0, false},
                               {testSphereTransformICRSToEcliptic, 821, "psSphereTransformICRSToEcliptic()", 0, false},
                               {testSphereTransformEclipticToICRS, 822, "psSphereTransformEclipticToICRS()", 0, false},
@@ -66,4 +72,10 @@
     return ( ! runTestSuite( stderr, "psCoord", tests, argc, argv ) );
 }
+
+#define MJD_1900  15021.0        // Modified Julian Day 1/1/1900 00:00:00
+#define MJD_2000  51544.0        // Modified Julian Day 1/1/2000 00:00:00
+#define MJD_2100  88069.0        // Modified Julian Day 1/1/2100 00:00:00
+
+#define ERROR_TOL   0.0001
 
 #define MY_TINY 0.0001
@@ -456,9 +468,9 @@
                 return 1;
             }
-            if (FLT_EPSILON < fabs(out->r - in->r)) {
+            if (ERROR_TOL < fabs(out->r - in->r)) {
                 psError(PS_ERR_UNKNOWN,true,"out->r is %f, should be %f\n", out->r, in->r);
                 return 2;
             }
-            if (FLT_EPSILON < fabs(out->d - in->d)) {
+            if (ERROR_TOL < fabs(out->d - in->d)) {
                 psError(PS_ERR_UNKNOWN,true,"out->d is %f, should be %f\n", out->d, in->d);
                 return 3;
@@ -583,7 +595,368 @@
 }
 
-#define MJD_1900  15021.0        // Modified Julian Day 1/1/1900 00:00:00
-#define MJD_2000  51544.0        // Modified Julian Day 1/1/2000 00:00:00
-#define MJD_2100  88069.0        // Modified Julian Day 1/1/2100 00:00:00
+// Test point 1  ADD  ICRS(0,0) to Galactic (96.337272,-60.188553)
+//                              to Ecliptic (0,0) with T=1
+#define SPHERE_COORD_TP1_GAL_R           1.681409       //  96.337272 degrees
+#define SPHERE_COORD_TP1_GAL_D          -1.050488       // -60.188553 degrees
+#define SPHERE_COORD_TP1_ECL_R           0.0
+#define SPHERE_COORD_TP1_ECL_D           0.0
+#define SPHERE_COORD_TP1_INVERSE_R       0.0
+#define SPHERE_COORD_TP1_INVERSE_D       0.0
+
+// Test point 2 ADD  ICRS(0,90) to Galactic (122.93192, 27.12825)
+//                              to Ecliptic (90,66.560719) with T=1
+#define SPHERE_COORD_TP2_GAL_R           2.145567       // 122.93192 degrees
+#define SPHERE_COORD_TP2_GAL_D           0.473477       // 27.12825  degrees
+#define SPHERE_COORD_TP2_ECL_R           1.570796       // 90        degrees
+#define SPHERE_COORD_TP2_ECL_D           1.161704       // 66.560719 degrees
+#define SPHERE_COORD_TP2_INVERSE_R       0.0            // 0         degrees
+#define SPHERE_COORD_TP2_INVERSE_D       1.570796       // 90        degrees
+
+// Test point 3 ADD  ICRS(180,30) to Galactic (195.639488, 78.353806)
+//                                to Ecliptic (167.072470, 27.308813) with T=2
+#define SPHERE_COORD_TP3_GAL_R           3.414553       // 195.639488 degrees
+#define SPHERE_COORD_TP3_GAL_D           1.367532       // 78.353806  degrees
+#define SPHERE_COORD_TP3_ECL_R           2.915965       // 167.07247  degrees
+#define SPHERE_COORD_TP3_ECL_D           0.476629       // 27.308813  degrees
+#define SPHERE_COORD_TP3_INVERSE_R       3.141593       // 180.0      degrees
+#define SPHERE_COORD_TP3_INVERSE_D       0.523599       // 30.0       degrees
+
+psS32 testSphereTransformApply3( void)
+{
+
+    psSphereTransform*  testTransform;
+    psSphere*           inputCoord = psSphereAlloc();
+    psSphere*           outputCoord = NULL;
+    psSphere*           inverseOutputCoord = NULL;
+
+    inputCoord->r = SPHERE_COORD_TP1_INVERSE_R;
+    inputCoord->d = SPHERE_COORD_TP1_INVERSE_D;
+    inputCoord->rErr = 0.0;
+    inputCoord->dErr = 0.0;
+
+    // Set test date time to 1/1/2000 00:00:00
+    psTime* testDateTime = psTimeFromMJD(MJD_2000);
+
+    // Create transform ICRS to Galactic
+    testTransform = psSphereTransformICRSToGalactic();
+
+    // Perform transform from ICRS to Galactic
+    outputCoord = psSphereTransformApply(outputCoord,testTransform,inputCoord);
+    // Verify output not NULL and member values set correctly
+    if(outputCoord == NULL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply returned NULL");
+        return 1;
+    }
+    if(fabs(outputCoord->r - SPHERE_COORD_TP1_GAL_R) > ERROR_TOL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord r %lg not as expected %lg",
+                outputCoord->r, SPHERE_COORD_TP1_GAL_R);
+        return 2;
+    }
+    if(fabs(outputCoord->d - SPHERE_COORD_TP1_GAL_D) > ERROR_TOL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord d %ld not as expected %lg",
+                outputCoord->d, SPHERE_COORD_TP1_GAL_D);
+        return 3;
+    }
+    psFree(testTransform);
+
+    // Create inverse transform Galactic to ICRS
+    testTransform = psSphereTransformGalacticToICRS();
+
+    // Perform transform from Galactic to ICRS
+    inverseOutputCoord = psSphereTransformApply(inverseOutputCoord,testTransform,outputCoord);
+    // Verify output not NULL and member values set correctly
+    if(inverseOutputCoord == NULL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply returned NULL");
+        return 4;
+    }
+
+    if(fabs(inverseOutputCoord->r - SPHERE_COORD_TP1_INVERSE_R) > ERROR_TOL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord r %lg not as expected %lg",
+                inverseOutputCoord->r, SPHERE_COORD_TP1_INVERSE_R);
+        return 5;
+    }
+    if(fabs(inverseOutputCoord->d - SPHERE_COORD_TP1_INVERSE_D) > ERROR_TOL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord d %ld not as expected %lg",
+                inverseOutputCoord->d, SPHERE_COORD_TP1_INVERSE_D);
+        return 6;
+    }
+    psFree(testTransform);
+
+    // Create transform ICRS to Ecliptic
+    testTransform = psSphereTransformICRSToEcliptic(testDateTime);
+
+    // Perform transform from ICRS to Ecliptic
+    outputCoord = psSphereTransformApply(outputCoord,testTransform,inputCoord);
+    // Verify output not NULL and member values set correctly
+    if(outputCoord == NULL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply returned NULL");
+        return 7;
+    }
+    if(fabs(outputCoord->r - SPHERE_COORD_TP1_ECL_R) > ERROR_TOL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord r %lg not as expected %lg",
+                outputCoord->r, SPHERE_COORD_TP1_ECL_R);
+        return 8;
+    }
+    if(fabs(outputCoord->d - SPHERE_COORD_TP1_ECL_D) > ERROR_TOL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord d %ld not as expected %lg",
+                outputCoord->d, SPHERE_COORD_TP1_ECL_D);
+        return 9;
+    }
+    psFree(testTransform);
+
+    // Create inverse transform Ecliptic to ICRS
+    testTransform = psSphereTransformEclipticToICRS(testDateTime);
+
+    // Perform transform from Ecliptic to ICRS
+    inverseOutputCoord = psSphereTransformApply(inverseOutputCoord,testTransform,outputCoord);
+    // Verify output not NULL and member values set correctly
+    if(inverseOutputCoord == NULL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply returned NULL");
+        return 10;
+    }
+    if(fabs(inverseOutputCoord->r - SPHERE_COORD_TP1_INVERSE_R) > ERROR_TOL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord r %lg not as expected %lg",
+                inverseOutputCoord->r, SPHERE_COORD_TP1_INVERSE_R);
+        return 11;
+    }
+    if(fabs(inverseOutputCoord->d - SPHERE_COORD_TP1_INVERSE_D) > ERROR_TOL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord d %ld not as expected %lg",
+                inverseOutputCoord->d, SPHERE_COORD_TP1_INVERSE_D);
+        return 12;
+    }
+    psFree(testTransform);
+
+    psFree(testDateTime);
+    psFree(outputCoord);
+    psFree(inputCoord);
+    psFree(inverseOutputCoord);
+
+    return 0;
+}
+
+psS32 testSphereTransformApply4( void)
+{
+
+    psSphereTransform*  testTransform;
+    psSphere*           inputCoord = psSphereAlloc();
+    psSphere*           outputCoord = NULL;
+    psSphere*           inverseOutputCoord = NULL;
+
+    inputCoord->r = SPHERE_COORD_TP2_INVERSE_R;
+    inputCoord->d = SPHERE_COORD_TP2_INVERSE_D;
+    inputCoord->rErr = 0.0;
+    inputCoord->dErr = 0.0;
+
+    // Set test date time to 1/1/2000 00:00:00
+    psTime* testDateTime = psTimeFromMJD(MJD_2000);
+
+    // Create transform ICRS to Galactic
+    testTransform = psSphereTransformICRSToGalactic();
+
+    // Perform transform from ICRS to Galactic
+    outputCoord = psSphereTransformApply(outputCoord,testTransform,inputCoord);
+    // Verify output not NULL and member values set correctly
+    if(outputCoord == NULL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply returned NULL");
+        return 1;
+    }
+    if(fabs(outputCoord->r - SPHERE_COORD_TP2_GAL_R) > ERROR_TOL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord r %lg not as expected %lg",
+                outputCoord->r, SPHERE_COORD_TP2_GAL_R);
+        return 2;
+    }
+    if(fabs(outputCoord->d - SPHERE_COORD_TP2_GAL_D) > ERROR_TOL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord d %ld not as expected %lg",
+                outputCoord->d, SPHERE_COORD_TP2_GAL_D);
+        return 3;
+    }
+    psFree(testTransform);
+
+    // Create inverse transform Galactic to ICRS
+    testTransform = psSphereTransformGalacticToICRS();
+
+    // Perform transform from Galactic to ICRS
+    inverseOutputCoord = psSphereTransformApply(inverseOutputCoord,testTransform,outputCoord);
+    // Verify output not NULL and member values set correctly
+    if(inverseOutputCoord == NULL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply returned NULL");
+        return 4;
+    }
+    // atan2 function introduces some error with y close to zero, increased error tolerance
+    if(fabs(inverseOutputCoord->r - SPHERE_COORD_TP2_INVERSE_R) > ERROR_TOL+0.1) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord r %lg not as expected %lg",
+                inverseOutputCoord->r, SPHERE_COORD_TP2_INVERSE_R);
+        return 5;
+    }
+    if(fabs(inverseOutputCoord->d - SPHERE_COORD_TP2_INVERSE_D) > ERROR_TOL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord d %ld not as expected %lg",
+                inverseOutputCoord->d, SPHERE_COORD_TP2_INVERSE_D);
+        return 6;
+    }
+    psFree(testTransform);
+
+    // Create transform ICRS to Ecliptic
+    testTransform = psSphereTransformICRSToEcliptic(testDateTime);
+
+    // Perform transform from ICRS to Ecliptic
+    outputCoord = psSphereTransformApply(outputCoord,testTransform,inputCoord);
+    // Verify output not NULL and member values set correctly
+    if(outputCoord == NULL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply returned NULL");
+        return 7;
+    }
+    if(fabs(outputCoord->r - SPHERE_COORD_TP2_ECL_R) > ERROR_TOL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord r %lg not as expected %lg",
+                outputCoord->r, SPHERE_COORD_TP2_ECL_R);
+        return 8;
+    }
+    if(fabs(outputCoord->d - SPHERE_COORD_TP2_ECL_D) > ERROR_TOL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord d %ld not as expected %lg",
+                outputCoord->d, SPHERE_COORD_TP2_ECL_D);
+        return 9;
+    }
+    psFree(testTransform);
+
+    // Create inverse transform Ecliptic to ICRS
+    testTransform = psSphereTransformEclipticToICRS(testDateTime);
+
+    // Perform transform from Ecliptic to ICRS
+    inverseOutputCoord = psSphereTransformApply(inverseOutputCoord,testTransform,outputCoord);
+    // Verify output not NULL and member values set correctly
+    if(inverseOutputCoord == NULL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply returned NULL");
+        return 10;
+    }
+    if(fabs(inverseOutputCoord->r - SPHERE_COORD_TP2_INVERSE_R) > ERROR_TOL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord r %lg not as expected %lg",
+                inverseOutputCoord->r, SPHERE_COORD_TP2_INVERSE_R);
+        return 11;
+    }
+    if(fabs(inverseOutputCoord->d - SPHERE_COORD_TP2_INVERSE_D) > ERROR_TOL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord d %ld not as expected %lg",
+                inverseOutputCoord->d, SPHERE_COORD_TP2_INVERSE_D);
+        return 12;
+    }
+    psFree(testTransform);
+
+    psFree(testDateTime);
+    psFree(outputCoord);
+    psFree(inputCoord);
+    psFree(inverseOutputCoord);
+
+    return 0;
+}
+
+psS32 testSphereTransformApply5( void)
+{
+
+    psSphereTransform*  testTransform;
+    psSphere*           inputCoord = psSphereAlloc();
+    psSphere*           outputCoord = NULL;
+    psSphere*           inverseOutputCoord = NULL;
+
+    inputCoord->r = SPHERE_COORD_TP3_INVERSE_R;
+    inputCoord->d = SPHERE_COORD_TP3_INVERSE_D;
+    inputCoord->rErr = 0.0;
+    inputCoord->dErr = 0.0;
+
+    // Set test date time to 1/1/2100 00:00:00
+    psTime* testDateTime = psTimeFromMJD(MJD_2100);
+
+    // Create transform ICRS to Galactic
+    testTransform = psSphereTransformICRSToGalactic();
+
+    // Perform transform from ICRS to Galactic
+    outputCoord = psSphereTransformApply(outputCoord,testTransform,inputCoord);
+    // Verify output not NULL and member values set correctly
+    if(outputCoord == NULL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply returned NULL");
+        return 1;
+    }
+    if(fabs(outputCoord->r - SPHERE_COORD_TP3_GAL_R) > ERROR_TOL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord r %lg not as expected %lg",
+                outputCoord->r, SPHERE_COORD_TP3_GAL_R);
+        return 2;
+    }
+    if(fabs(outputCoord->d - SPHERE_COORD_TP3_GAL_D) > ERROR_TOL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord d %ld not as expected %lg",
+                outputCoord->d, SPHERE_COORD_TP3_GAL_D);
+        return 3;
+    }
+    psFree(testTransform);
+
+    // Create inverse transform Galactic to ICRS
+    testTransform = psSphereTransformGalacticToICRS();
+
+    // Perform transform from Galactic to ICRS
+    inverseOutputCoord = psSphereTransformApply(inverseOutputCoord,testTransform,outputCoord);
+    // Verify output not NULL and member values set correctly
+    if(inverseOutputCoord == NULL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply returned NULL");
+        return 4;
+    }
+    if(fabs(inverseOutputCoord->r - SPHERE_COORD_TP3_INVERSE_R) > ERROR_TOL+0.1) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord r %lg not as expected %lg",
+                inverseOutputCoord->r, SPHERE_COORD_TP3_INVERSE_R);
+        return 5;
+    }
+    if(fabs(inverseOutputCoord->d - SPHERE_COORD_TP3_INVERSE_D) > ERROR_TOL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord d %ld not as expected %lg",
+                inverseOutputCoord->d, SPHERE_COORD_TP3_INVERSE_D);
+        return 6;
+    }
+    psFree(testTransform);
+
+    // Create transform ICRS to Ecliptic
+    testTransform = psSphereTransformICRSToEcliptic(testDateTime);
+
+    // Perform transform from ICRS to Ecliptic
+    outputCoord = psSphereTransformApply(outputCoord,testTransform,inputCoord);
+    // Verify output not NULL and member values set correctly
+    if(outputCoord == NULL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply returned NULL");
+        return 7;
+    }
+    if(fabs(outputCoord->r - SPHERE_COORD_TP3_ECL_R) > ERROR_TOL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord r %lg not as expected %lg",
+                outputCoord->r, SPHERE_COORD_TP3_ECL_R);
+        return 8;
+    }
+    if(fabs(outputCoord->d - SPHERE_COORD_TP3_ECL_D) > ERROR_TOL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord d %ld not as expected %lg",
+                outputCoord->d, SPHERE_COORD_TP3_ECL_D);
+        return 9;
+    }
+    psFree(testTransform);
+
+    // Create inverse transform Ecliptic to ICRS
+    testTransform = psSphereTransformEclipticToICRS(testDateTime);
+
+    // Perform transform from Ecliptic to ICRS
+    inverseOutputCoord = psSphereTransformApply(inverseOutputCoord,testTransform,outputCoord);
+    // Verify output not NULL and member values set correctly
+    if(inverseOutputCoord == NULL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply returned NULL");
+        return 10;
+    }
+    if(fabs(inverseOutputCoord->r - SPHERE_COORD_TP3_INVERSE_R) > ERROR_TOL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord r %lg not as expected %lg",
+                inverseOutputCoord->r, SPHERE_COORD_TP3_INVERSE_R);
+        return 11;
+    }
+    if(fabs(inverseOutputCoord->d - SPHERE_COORD_TP3_INVERSE_D) > ERROR_TOL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformApply return coord d %ld not as expected %lg",
+                inverseOutputCoord->d, SPHERE_COORD_TP3_INVERSE_D);
+        return 12;
+    }
+    psFree(testTransform);
+
+    psFree(testDateTime);
+    psFree(outputCoord);
+    psFree(inputCoord);
+    psFree(inverseOutputCoord);
+
+    return 0;
+}
 
 // Thes values calculated from ADD-09 equations
@@ -593,6 +966,4 @@
 #define EXPECT_SIN_DELTAP_2100    0.397567
 
-#define ERROR_TOL   0.0001
-
 psS32 testSphereTransformICRSToEcliptic( void )
 {
@@ -600,5 +971,5 @@
     psF64  expectedAlphaP = 0.0;
     psF64  expectedCosDeltaP = EXPECT_COS_DELTAP_2000;
-    psF64  expectedSinDeltaP = -EXPECT_SIN_DELTAP_2000;
+    psF64  expectedSinDeltaP = EXPECT_SIN_DELTAP_2000;
 
     // Set test date time to 1/1/2000 00:00:00
@@ -633,5 +1004,5 @@
 
     expectedCosDeltaP = EXPECT_COS_DELTAP_2100;
-    expectedSinDeltaP = -EXPECT_SIN_DELTAP_2100;
+    expectedSinDeltaP = EXPECT_SIN_DELTAP_2100;
 
     // Set test date time to 1/1/2100 00:00:00
@@ -692,5 +1063,5 @@
     psF64  expectedAlphaP = 0.0;
     psF64  expectedCosDeltaP = EXPECT_COS_DELTAP_2000;
-    psF64  expectedSinDeltaP = EXPECT_SIN_DELTAP_2000;
+    psF64  expectedSinDeltaP = -EXPECT_SIN_DELTAP_2000;
 
     // Set test date time to 1/1/2000 00:00:00
@@ -725,5 +1096,5 @@
 
     expectedCosDeltaP = EXPECT_COS_DELTAP_2100;
-    expectedSinDeltaP = EXPECT_SIN_DELTAP_2100;
+    expectedSinDeltaP = -EXPECT_SIN_DELTAP_2100;
 
     // Set test date time to 1/1/2100 00:00:00
@@ -778,8 +1149,8 @@
 }
 
-#define ITG_EXPECT_PHIP        4.93683
-#define ITG_EXPECT_SINDELTAP  -0.88999
+#define ITG_EXPECT_ALPHAP      4.93683
+#define ITG_EXPECT_SINDELTAP   0.88999
 #define ITG_EXPECT_COSDELTAP   0.45598
-#define ITG_EXPECT_ALPHAP      0.57477
+#define ITG_EXPECT_PHIP        0.57477
 
 psS32 testSphereTransformICRSToGalactic( void )
@@ -820,8 +1191,8 @@
 }
 
-#define GTI_EXPECT_ALPHAP      4.93683
-#define GTI_EXPECT_SINDELTAP   0.88999
+#define GTI_EXPECT_PHIP        4.93683
+#define GTI_EXPECT_SINDELTAP  -0.88999
 #define GTI_EXPECT_COSDELTAP   0.45598
-#define GTI_EXPECT_PHIP        0.57477
+#define GTI_EXPECT_ALPHAP      0.57477
 
 psS32 testSphereTransformGalacticToICRS( void )
Index: /trunk/psLib/test/astronomy/verified/tst_psCoord.stderr
===================================================================
--- /trunk/psLib/test/astronomy/verified/tst_psCoord.stderr	(revision 3351)
+++ /trunk/psLib/test/astronomy/verified/tst_psCoord.stderr	(revision 3352)
@@ -74,5 +74,5 @@
 /***************************** TESTPOINT ******************************************\
 *             TestFile: tst_psCoord.c                                              *
-*            TestPoint: psCoord{psPSphereTransformApply()}                         *
+*            TestPoint: psCoord{psSphereTransformApply()}                          *
 *             TestType: Positive                                                   *
 \**********************************************************************************/
@@ -87,14 +87,41 @@
     Unallowable operation: coord is NULL.
 
----> TESTPOINT PASSED (psCoord{psPSphereTransformApply()} | tst_psCoord.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psCoord.c                                              *
-*            TestPoint: psCoord{psPSphereTransformApply()}                         *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (psCoord{psPSphereTransformApply()} | tst_psCoord.c)
+---> TESTPOINT PASSED (psCoord{psSphereTransformApply()} | tst_psCoord.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psCoord.c                                              *
+*            TestPoint: psCoord{psSphereTransformApply()}                          *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psCoord{psSphereTransformApply()} | tst_psCoord.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psCoord.c                                              *
+*            TestPoint: psCoord{psSphereTransformApply()}                          *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psCoord{psSphereTransformApply()} | tst_psCoord.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psCoord.c                                              *
+*            TestPoint: psCoord{psSphereTransformApply()}                          *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psCoord{psSphereTransformApply()} | tst_psCoord.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psCoord.c                                              *
+*            TestPoint: psCoord{psSphereTransformApply()}                          *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psCoord{psSphereTransformApply()} | tst_psCoord.c)
 
 /***************************** TESTPOINT ******************************************\
