Index: trunk/psLib/src/astro/psCoord.c
===================================================================
--- trunk/psLib/src/astro/psCoord.c	(revision 4953)
+++ trunk/psLib/src/astro/psCoord.c	(revision 4957)
@@ -10,6 +10,6 @@
 *  @author GLG, MHPCC
 *
-*  @version $Revision: 1.84 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-08-30 01:14:10 $
+*  @version $Revision: 1.85 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-09-07 21:33:48 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -73,4 +73,6 @@
 XXX: Since there is now a general psPlaneTransformInvert() function, we
 should rename this.
+ 
+XXX: Use the ADD version which is based on determinants.
  *****************************************************************************/
 psPlaneTransform *p_psPlaneTransformLinearInvert(psPlaneTransform *transform)
@@ -897,4 +899,72 @@
 }
 
+psPlane *psPlaneTransformDeriv(
+    psPlane *out,
+    const psPlaneTransform *transformation,
+    const psPlane *coord
+)
+{
+    /*
+        PS_ASSERT_PTR_NON_NULL(transformation, NULL);
+        PS_ASSERT_POLY_NON_NULL(transformation->x, NULL);
+        PS_ASSERT_POLY_NON_NULL(transformation->y, NULL);
+        PS_ASSERT_PTR_NON_NULL(coord, NULL);
+     
+        if (out == NULL) {
+            out = psPlaneAlloc();
+        }
+     
+        out->x = 0.0;
+        out->y = 0.0;
+        out->xErr = 0.0;
+        out->yErr = 0.0;
+     
+        psPolynomial2D *xPoly = transformation->x;
+        psPolynomial2D *yPoly = transformation->y;
+     
+        //
+        // Calculate the derivative with respect to x.
+        //
+        psF32 xSum = 1.0;
+        psF32 ySum = 1.0;
+     
+        // This loop starts at loop_x=1 since the derivative of the loop_x=0 terms are all 0.0
+        for (psS32 loop_x = 1; loop_x < xPoly->nX; loop_x++) {
+            ySum = 1.0;
+            for (psS32 loop_y = 0; loop_y < xPoly->nY; loop_y++) {
+                //
+                // For each iteration of the loop, we multiple the (x, y) coefficient
+                // by (coord->x^(loop_x-1) * coord->y^loop_y)
+                //
+     
+                out->x+= xPoly->coeff[loop_x][loop_y] * xSum * ySum;
+                ySum*= coord->y;
+            }
+            xSum*= coord->x;
+        }
+     
+        //
+        // Calculate the derivative with respect to x.
+        //
+        xSum = 1.0;
+     
+        // This loop starts at loop_y=1 since the derivative of the loop_y=0 terms are all 0.0
+        for (psS32 loop_x = 0; loop_x < yPoly->nX; loop_x++) {
+            ySum = 1.0;
+            for (psS32 loop_y = 1; loop_y < yPoly->nY; loop_y++) {
+                //
+                // For each iteration of the loop, we multiple the (x, y) coefficient
+                // by (coord->x^(loop_x-1) * coord->y^loop_y)
+                //
+     
+                out->y+= yPoly->coeff[loop_x][loop_y] * xSum * ySum;
+                ySum*= coord->y;
+            }
+            xSum*= coord->x;
+        }
+    */
+    return(out);
+}
+
 psCube *psSphereToCube(const psSphere *sphere)
 {
Index: trunk/psLib/src/astro/psCoord.h
===================================================================
--- trunk/psLib/src/astro/psCoord.h	(revision 4953)
+++ trunk/psLib/src/astro/psCoord.h	(revision 4957)
@@ -10,6 +10,6 @@
 *  @author GLG, MHPCC
 *
-*  @version $Revision: 1.43 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-08-31 22:28:35 $
+*  @version $Revision: 1.44 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-09-07 21:33:48 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -404,4 +404,14 @@
 
 
+/** Calculates the derivative of the specified psPlaneTransform with respect to x and y.
+ *
+ *  @return psPlane*         The derivative.
+ */
+psPlane *psPlaneTransformDeriv(
+    psPlane *out,
+    const psPlaneTransform *transformation,
+    const psPlane *coord
+);
+
 /// @}
 
