Index: /trunk/psLib/pslib.kdevses
===================================================================
--- /trunk/psLib/pslib.kdevses	(revision 3883)
+++ /trunk/psLib/pslib.kdevses	(revision 3884)
@@ -4,5 +4,5 @@
  <DocsAndViews NumberOfDocuments="6" >
   <Doc0 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/image/psImageManip.h" >
-   <View0 line="32" Type="Source" />
+   <View0 Type="Source" />
   </Doc0>
   <Doc1 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/image/psImageManip.c" >
@@ -10,14 +10,14 @@
   </Doc1>
   <Doc2 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/dataManip/psMatrix.c" >
-   <View0 line="377" Type="Source" />
+   <View0 line="412" Type="Source" />
   </Doc2>
   <Doc3 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/dataManip/psMatrix.h" >
    <View0 line="0" Type="Source" />
   </Doc3>
-  <Doc4 NumberOfViews="1" URL="file:///usr/include/gsl/gsl_linalg.h" >
-   <View0 line="53" Type="Source" />
+  <Doc4 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/test/dataManip/tst_psMatrix06.c" >
+   <View0 line="0" Type="Source" />
   </Doc4>
-  <Doc5 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/dataManip/psConstants.h" >
-   <View0 line="32" Type="Source" />
+  <Doc5 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/test/dataManip/tst_psMinimize06.c" >
+   <View0 line="28" Type="Source" />
   </Doc5>
  </DocsAndViews>
Index: /trunk/psLib/src/astro/psCoord.c
===================================================================
--- /trunk/psLib/src/astro/psCoord.c	(revision 3883)
+++ /trunk/psLib/src/astro/psCoord.c	(revision 3884)
@@ -10,6 +10,6 @@
 *  @author GLG, MHPCC
 *
-*  @version $Revision: 1.65 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-04-19 05:46:24 $
+*  @version $Revision: 1.66 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-05-11 22:02:15 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -326,9 +326,9 @@
 {
     while (angle < FLT_EPSILON) {
-        angle+=PS_PI*2;
-    }
-
-    while (angle >= (PS_PI*2)) {
-        angle-=PS_PI*2;
+        angle+=M_PI*2;
+    }
+
+    while (angle >= (M_PI*2)) {
+        angle-=M_PI*2;
     }
     return(angle);
@@ -509,5 +509,5 @@
     } else if ( projection->type == PS_PROJ_PAR) {
         out->x = phi*(2.0*cos(2.0*theta/3.0) - 1.0);
-        out->y = PS_PI*sin(theta/3.0);
+        out->y = M_PI*sin(theta/3.0);
     } else {
         psError(PS_ERR_BAD_PARAMETER_TYPE, true,
@@ -558,5 +558,5 @@
         // Parabolic deprojection
     } else if ( projection->type == PS_PROJ_PAR) {
-        psF64 rho = y/PS_PI;
+        psF64 rho = y/M_PI;
         phi = x/(1.0 - 4.0*rho*rho);
         theta = 3.0*asin(rho);
@@ -647,6 +647,6 @@
         // Wrap these to an acceptable range.  This assumes that all
         // angles are in radians.
-        tmp->r = fmod(tmp->r, 2*PS_PI);
-        tmp->d = fmod(tmp->d, 2*PS_PI);
+        tmp->r = fmod(tmp->r, 2*M_PI);
+        tmp->d = fmod(tmp->d, 2*M_PI);
         tmp->rErr = 0.0;
         tmp->dErr = 0.0;
@@ -760,7 +760,7 @@
         // Add offset and wrap to 0 to 2PI if necessary
         tmp->r = position->r + tmpR;
-        tmp->r = fmod(tmp->r, 2.0*PS_PI);
+        tmp->r = fmod(tmp->r, 2.0*M_PI);
         tmp->d = position->d + tmpD;
-        tmp->d = fmod(tmp->d, 2.0*PS_PI);
+        tmp->d = fmod(tmp->d, 2.0*M_PI);
         tmp->rErr = 0.0;
         tmp->dErr = 0.0;
Index: /trunk/psLib/src/astro/psTime.c
===================================================================
--- /trunk/psLib/src/astro/psTime.c	(revision 3883)
+++ /trunk/psLib/src/astro/psTime.c	(revision 3884)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.59 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-04-19 02:13:53 $
+ *  @version $Revision: 1.60 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-05-11 22:02:15 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -43,8 +43,8 @@
 
 /** Two times pi with double precision accuracy */
-#define TWOPI (2.0*PS_PI)
+#define TWOPI (2.0*M_PI)
 
 /** Conversion from radians to degrees */
-#define R2DEG = (180.0/PS_PI)
+#define R2DEG = (180.0/M_PI)
 
                 /** Maximum length of time string */
@@ -563,5 +563,5 @@
 
         t = 2000.0 + (mjd - 51544.03)/365.2422;
-        dut2ut1 = 0.022*sin(TWOPI*t) - 0.012*cos(TWOPI*t) - 0.006*sin(4.0*PS_PI*t) + 0.007*cos(4.0*PS_PI*t);
+        dut2ut1 = 0.022*sin(TWOPI*t) - 0.012*cos(TWOPI*t) - 0.006*sin(4.0*M_PI*t) + 0.007*cos(4.0*M_PI*t);
         result = dut->data.F64[0] + dut->data.F64[1]*(mjd - dut->data.F64[2]) - dut2ut1;
 
@@ -692,8 +692,8 @@
     }
 
-    // Create output sphere and convert arcsec to radians (i.e. x/60/60*PS_PI/180)
+    // Create output sphere and convert arcsec to radians (i.e. x/60/60*M_PI/180)
     output = psAlloc(sizeof(psSphere));
-    output->r = x * PS_PI / 648000.0;
-    output->d = y * PS_PI / 648000.0;
+    output->r = x * M_PI / 648000.0;
+    output->d = y * M_PI / 648000.0;
 
     return output;
Index: /trunk/psLib/src/astronomy/psCoord.c
===================================================================
--- /trunk/psLib/src/astronomy/psCoord.c	(revision 3883)
+++ /trunk/psLib/src/astronomy/psCoord.c	(revision 3884)
@@ -10,6 +10,6 @@
 *  @author GLG, MHPCC
 *
-*  @version $Revision: 1.65 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-04-19 05:46:24 $
+*  @version $Revision: 1.66 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-05-11 22:02:15 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -326,9 +326,9 @@
 {
     while (angle < FLT_EPSILON) {
-        angle+=PS_PI*2;
-    }
-
-    while (angle >= (PS_PI*2)) {
-        angle-=PS_PI*2;
+        angle+=M_PI*2;
+    }
+
+    while (angle >= (M_PI*2)) {
+        angle-=M_PI*2;
     }
     return(angle);
@@ -509,5 +509,5 @@
     } else if ( projection->type == PS_PROJ_PAR) {
         out->x = phi*(2.0*cos(2.0*theta/3.0) - 1.0);
-        out->y = PS_PI*sin(theta/3.0);
+        out->y = M_PI*sin(theta/3.0);
     } else {
         psError(PS_ERR_BAD_PARAMETER_TYPE, true,
@@ -558,5 +558,5 @@
         // Parabolic deprojection
     } else if ( projection->type == PS_PROJ_PAR) {
-        psF64 rho = y/PS_PI;
+        psF64 rho = y/M_PI;
         phi = x/(1.0 - 4.0*rho*rho);
         theta = 3.0*asin(rho);
@@ -647,6 +647,6 @@
         // Wrap these to an acceptable range.  This assumes that all
         // angles are in radians.
-        tmp->r = fmod(tmp->r, 2*PS_PI);
-        tmp->d = fmod(tmp->d, 2*PS_PI);
+        tmp->r = fmod(tmp->r, 2*M_PI);
+        tmp->d = fmod(tmp->d, 2*M_PI);
         tmp->rErr = 0.0;
         tmp->dErr = 0.0;
@@ -760,7 +760,7 @@
         // Add offset and wrap to 0 to 2PI if necessary
         tmp->r = position->r + tmpR;
-        tmp->r = fmod(tmp->r, 2.0*PS_PI);
+        tmp->r = fmod(tmp->r, 2.0*M_PI);
         tmp->d = position->d + tmpD;
-        tmp->d = fmod(tmp->d, 2.0*PS_PI);
+        tmp->d = fmod(tmp->d, 2.0*M_PI);
         tmp->rErr = 0.0;
         tmp->dErr = 0.0;
Index: /trunk/psLib/src/astronomy/psTime.c
===================================================================
--- /trunk/psLib/src/astronomy/psTime.c	(revision 3883)
+++ /trunk/psLib/src/astronomy/psTime.c	(revision 3884)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.59 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-04-19 02:13:53 $
+ *  @version $Revision: 1.60 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-05-11 22:02:15 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -43,8 +43,8 @@
 
 /** Two times pi with double precision accuracy */
-#define TWOPI (2.0*PS_PI)
+#define TWOPI (2.0*M_PI)
 
 /** Conversion from radians to degrees */
-#define R2DEG = (180.0/PS_PI)
+#define R2DEG = (180.0/M_PI)
 
                 /** Maximum length of time string */
@@ -563,5 +563,5 @@
 
         t = 2000.0 + (mjd - 51544.03)/365.2422;
-        dut2ut1 = 0.022*sin(TWOPI*t) - 0.012*cos(TWOPI*t) - 0.006*sin(4.0*PS_PI*t) + 0.007*cos(4.0*PS_PI*t);
+        dut2ut1 = 0.022*sin(TWOPI*t) - 0.012*cos(TWOPI*t) - 0.006*sin(4.0*M_PI*t) + 0.007*cos(4.0*M_PI*t);
         result = dut->data.F64[0] + dut->data.F64[1]*(mjd - dut->data.F64[2]) - dut2ut1;
 
@@ -692,8 +692,8 @@
     }
 
-    // Create output sphere and convert arcsec to radians (i.e. x/60/60*PS_PI/180)
+    // Create output sphere and convert arcsec to radians (i.e. x/60/60*M_PI/180)
     output = psAlloc(sizeof(psSphere));
-    output->r = x * PS_PI / 648000.0;
-    output->d = y * PS_PI / 648000.0;
+    output->r = x * M_PI / 648000.0;
+    output->d = y * M_PI / 648000.0;
 
     return output;
Index: /trunk/psLib/src/dataManip/psConstants.h
===================================================================
--- /trunk/psLib/src/dataManip/psConstants.h	(revision 3883)
+++ /trunk/psLib/src/dataManip/psConstants.h	(revision 3884)
@@ -6,6 +6,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.65 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-05-11 02:29:39 $
+ *  @version $Revision: 1.66 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-05-11 22:02:16 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -20,4 +20,6 @@
  */
 
+#include<math.h> // for M_PI
+
 /*****************************************************************************
 These constants are used by various functions in the psLib.
@@ -31,16 +33,18 @@
 These are common mathimatical constants used by various functions in the psLib.
  *****************************************************************************/
-#define PS_PI   3.1415926535897932384626433832795029  /* pi */
-#define PS_PI_2 1.5707963267948966192313216916397514  /* pi/2 */
-#define PS_PI_4 0.7853981633974483096156608458198757  /* pi/4 */
-#define PS_1_PI 0.3183098861837906715377675267450287  /* 1/pi */
-#define PS_2_PI 0.6366197723675813430755350534900574  /* 2/pi */
-
-#define DEG_TO_RAD(DEGREES) ((DEGREES) * PS_PI / 180.0)
-#define MIN_TO_RAD(MINUTES) ((MINUTES) * PS_PI / (180.0 * 60.0))
-#define SEC_TO_RAD(SECONDS) ((SECONDS) * PS_PI / (180.0 * 60.0 * 60.0))
-#define RAD_TO_DEG(RADIANS) ((RADIANS) * 180.0 / PS_PI)
-#define RAD_TO_MIN(RADIANS) ((RADIANS) * 180.0 * 60.0 / PS_PI)
-#define RAD_TO_SEC(RADIANS) ((RADIANS) * 180.0 * 60.0 * 60.0 / PS_PI)
+#ifndef M_PI
+#define M_PI   3.1415926535897932384626433832795029  /* pi */
+#define M_PI_2 1.5707963267948966192313216916397514  /* pi/2 */
+#define M_PI_4 0.7853981633974483096156608458198757  /* pi/4 */
+#define M_1_PI 0.3183098861837906715377675267450287  /* 1/pi */
+#define M_2_PI 0.6366197723675813430755350534900574  /* 2/pi */
+#endif
+
+#define DEG_TO_RAD(DEGREES) ((DEGREES) * M_PI / 180.0)
+#define MIN_TO_RAD(MINUTES) ((MINUTES) * M_PI / (180.0 * 60.0))
+#define SEC_TO_RAD(SECONDS) ((SECONDS) * M_PI / (180.0 * 60.0 * 60.0))
+#define RAD_TO_DEG(RADIANS) ((RADIANS) * 180.0 / M_PI)
+#define RAD_TO_MIN(RADIANS) ((RADIANS) * 180.0 * 60.0 / M_PI)
+#define RAD_TO_SEC(RADIANS) ((RADIANS) * 180.0 * 60.0 * 60.0 / M_PI)
 
 /*****************************************************************************
Index: /trunk/psLib/src/dataManip/psFunctions.c
===================================================================
--- /trunk/psLib/src/dataManip/psFunctions.c	(revision 3883)
+++ /trunk/psLib/src/dataManip/psFunctions.c	(revision 3884)
@@ -7,6 +7,6 @@
  *  polynomials.  It also contains a Gaussian functions.
  *
- *  @version $Revision: 1.100 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-05-05 22:33:14 $
+ *  @version $Revision: 1.101 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-05-11 22:02:16 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -1001,5 +1001,5 @@
 
     if (normal == true) {
-        tmp = 1.0 / PS_SQRT_F32(2.0 * PS_PI * (sigma * sigma));
+        tmp = 1.0 / PS_SQRT_F32(2.0 * M_PI * (sigma * sigma));
     }
 
Index: /trunk/psLib/src/dataManip/psMinimize.c
===================================================================
--- /trunk/psLib/src/dataManip/psMinimize.c	(revision 3883)
+++ /trunk/psLib/src/dataManip/psMinimize.c	(revision 3884)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.115 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-05-10 01:57:47 $
+ *  @version $Revision: 1.116 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-05-11 22:02:16 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -541,5 +541,5 @@
         psF64 flux = normalization * exp(-( u*u/(2.0 * sigmaX * sigmaX) +
                                             v*v/(2.0 * sigmaY * sigmaY)))/
-                     (2.0 * PS_PI * sigmaX * sigmaY);
+                     (2.0 * M_PI * sigmaX * sigmaY);
         out->data.F32[i] = flux;
 
@@ -1204,5 +1204,5 @@
     for (psS32 i=0;i<n;i++) {
         // NR 5.8.4
-        psF64 Y = cos(PS_PI * (0.5 + ((psF32) i)) / ((psF32) n));
+        psF64 Y = cos(M_PI * (0.5 + ((psF32) i)) / ((psF32) n));
         psF64 X = (Y + bma + bpa) - 1.0;
         tmpScalar.data.F64 = X;
@@ -1232,5 +1232,5 @@
         for (k=0;k<n;k++) {
             sum+= f->data.F64[k] *
-                  cos(PS_PI * ((psF32) j) * (0.5 + ((psF32) k)) / ((psF32) n));
+                  cos(M_PI * ((psF32) j) * (0.5 + ((psF32) k)) / ((psF32) n));
         }
 
Index: /trunk/psLib/src/image/psImageManip.c
===================================================================
--- /trunk/psLib/src/image/psImageManip.c	(revision 3883)
+++ /trunk/psLib/src/image/psImageManip.c	(revision 3884)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-05-11 02:29:39 $
+ *  @version $Revision: 1.41 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-05-11 22:02:16 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -679,7 +679,7 @@
     }
     // put the angle in the range of 0...2PI.
-    angle = (float)((double)angle - (2.0*PS_PI) * floor(angle / (2.0*PS_PI)));
-
-    if (fabsf(angle - PS_PI_2) < FLT_EPSILON) {
+    angle = (float)((double)angle - (2.0*M_PI) * floor(angle / (2.0*M_PI)));
+
+    if (fabsf(angle - M_PI_2) < FLT_EPSILON) {
         // perform 1/4 rotate counter-clockwise
         psS32 numRows = in->numCols;
@@ -726,5 +726,5 @@
             }
         }
-    } else if (fabsf(angle - PS_PI) < FLT_EPSILON) {
+    } else if (fabsf(angle - M_PI) < FLT_EPSILON) {
         // perform 1/2 rotate
         psS32 numRows = in->numRows;
@@ -772,5 +772,5 @@
             }
         }
-    } else if (fabsf(angle - (PS_PI+PS_PI_2)) < FLT_EPSILON) {
+    } else if (fabsf(angle - (M_PI+M_PI_2)) < FLT_EPSILON) {
         // perform 1/4 rotate clockwise
         psS32 numRows = in->numCols;
Index: /trunk/psLib/src/image/psImageStats.c
===================================================================
--- /trunk/psLib/src/image/psImageStats.c	(revision 3883)
+++ /trunk/psLib/src/image/psImageStats.c	(revision 3884)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.72 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-04-19 04:16:02 $
+ *  @version $Revision: 1.73 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-05-11 22:02:16 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -207,5 +207,5 @@
     for (i = 0; i < n; i++) {
         tmp = (double)(n - i);
-        tmp = (PS_PI * (tmp - 0.5)) / ((double)n);
+        tmp = (M_PI * (tmp - 0.5)) / ((double)n);
         scalingFactors[i] = cos(tmp);
     }
@@ -416,10 +416,10 @@
     // Chebyshev polynomials are 0.
     for (x = 0; x < input->numRows; x++) {
-        double xTmp = cos(PS_PI * (0.5 + ((float) x)) / ((float) input->numRows));
+        double xTmp = cos(M_PI * (0.5 + ((float) x)) / ((float) input->numRows));
         double xNode = - ((xTmp + bma + bpa) - 1.0);
         double xOrig = ((float) input->numRows) * (xNode - min) / (max - min);
 
         for (y = 0; y < input->numCols; y++) {
-            double yTmp = cos(PS_PI * (0.5 + ((float) y)) / ((float) input->numCols));
+            double yTmp = cos(M_PI * (0.5 + ((float) y)) / ((float) input->numCols));
             double yNode = - ((yTmp + bma + bpa) - 1.0);
             double yOrig = ((float) input->numCols) * (yNode - min) / (max - min);
Index: /trunk/psLib/src/imageops/psImageStats.c
===================================================================
--- /trunk/psLib/src/imageops/psImageStats.c	(revision 3883)
+++ /trunk/psLib/src/imageops/psImageStats.c	(revision 3884)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.72 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-04-19 04:16:02 $
+ *  @version $Revision: 1.73 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-05-11 22:02:16 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -207,5 +207,5 @@
     for (i = 0; i < n; i++) {
         tmp = (double)(n - i);
-        tmp = (PS_PI * (tmp - 0.5)) / ((double)n);
+        tmp = (M_PI * (tmp - 0.5)) / ((double)n);
         scalingFactors[i] = cos(tmp);
     }
@@ -416,10 +416,10 @@
     // Chebyshev polynomials are 0.
     for (x = 0; x < input->numRows; x++) {
-        double xTmp = cos(PS_PI * (0.5 + ((float) x)) / ((float) input->numRows));
+        double xTmp = cos(M_PI * (0.5 + ((float) x)) / ((float) input->numRows));
         double xNode = - ((xTmp + bma + bpa) - 1.0);
         double xOrig = ((float) input->numRows) * (xNode - min) / (max - min);
 
         for (y = 0; y < input->numCols; y++) {
-            double yTmp = cos(PS_PI * (0.5 + ((float) y)) / ((float) input->numCols));
+            double yTmp = cos(M_PI * (0.5 + ((float) y)) / ((float) input->numCols));
             double yNode = - ((yTmp + bma + bpa) - 1.0);
             double yOrig = ((float) input->numCols) * (yNode - min) / (max - min);
Index: /trunk/psLib/src/math/psConstants.h
===================================================================
--- /trunk/psLib/src/math/psConstants.h	(revision 3883)
+++ /trunk/psLib/src/math/psConstants.h	(revision 3884)
@@ -6,6 +6,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.65 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-05-11 02:29:39 $
+ *  @version $Revision: 1.66 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-05-11 22:02:16 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -20,4 +20,6 @@
  */
 
+#include<math.h> // for M_PI
+
 /*****************************************************************************
 These constants are used by various functions in the psLib.
@@ -31,16 +33,18 @@
 These are common mathimatical constants used by various functions in the psLib.
  *****************************************************************************/
-#define PS_PI   3.1415926535897932384626433832795029  /* pi */
-#define PS_PI_2 1.5707963267948966192313216916397514  /* pi/2 */
-#define PS_PI_4 0.7853981633974483096156608458198757  /* pi/4 */
-#define PS_1_PI 0.3183098861837906715377675267450287  /* 1/pi */
-#define PS_2_PI 0.6366197723675813430755350534900574  /* 2/pi */
-
-#define DEG_TO_RAD(DEGREES) ((DEGREES) * PS_PI / 180.0)
-#define MIN_TO_RAD(MINUTES) ((MINUTES) * PS_PI / (180.0 * 60.0))
-#define SEC_TO_RAD(SECONDS) ((SECONDS) * PS_PI / (180.0 * 60.0 * 60.0))
-#define RAD_TO_DEG(RADIANS) ((RADIANS) * 180.0 / PS_PI)
-#define RAD_TO_MIN(RADIANS) ((RADIANS) * 180.0 * 60.0 / PS_PI)
-#define RAD_TO_SEC(RADIANS) ((RADIANS) * 180.0 * 60.0 * 60.0 / PS_PI)
+#ifndef M_PI
+#define M_PI   3.1415926535897932384626433832795029  /* pi */
+#define M_PI_2 1.5707963267948966192313216916397514  /* pi/2 */
+#define M_PI_4 0.7853981633974483096156608458198757  /* pi/4 */
+#define M_1_PI 0.3183098861837906715377675267450287  /* 1/pi */
+#define M_2_PI 0.6366197723675813430755350534900574  /* 2/pi */
+#endif
+
+#define DEG_TO_RAD(DEGREES) ((DEGREES) * M_PI / 180.0)
+#define MIN_TO_RAD(MINUTES) ((MINUTES) * M_PI / (180.0 * 60.0))
+#define SEC_TO_RAD(SECONDS) ((SECONDS) * M_PI / (180.0 * 60.0 * 60.0))
+#define RAD_TO_DEG(RADIANS) ((RADIANS) * 180.0 / M_PI)
+#define RAD_TO_MIN(RADIANS) ((RADIANS) * 180.0 * 60.0 / M_PI)
+#define RAD_TO_SEC(RADIANS) ((RADIANS) * 180.0 * 60.0 * 60.0 / M_PI)
 
 /*****************************************************************************
Index: /trunk/psLib/src/math/psMinimize.c
===================================================================
--- /trunk/psLib/src/math/psMinimize.c	(revision 3883)
+++ /trunk/psLib/src/math/psMinimize.c	(revision 3884)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.115 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-05-10 01:57:47 $
+ *  @version $Revision: 1.116 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-05-11 22:02:16 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -541,5 +541,5 @@
         psF64 flux = normalization * exp(-( u*u/(2.0 * sigmaX * sigmaX) +
                                             v*v/(2.0 * sigmaY * sigmaY)))/
-                     (2.0 * PS_PI * sigmaX * sigmaY);
+                     (2.0 * M_PI * sigmaX * sigmaY);
         out->data.F32[i] = flux;
 
@@ -1204,5 +1204,5 @@
     for (psS32 i=0;i<n;i++) {
         // NR 5.8.4
-        psF64 Y = cos(PS_PI * (0.5 + ((psF32) i)) / ((psF32) n));
+        psF64 Y = cos(M_PI * (0.5 + ((psF32) i)) / ((psF32) n));
         psF64 X = (Y + bma + bpa) - 1.0;
         tmpScalar.data.F64 = X;
@@ -1232,5 +1232,5 @@
         for (k=0;k<n;k++) {
             sum+= f->data.F64[k] *
-                  cos(PS_PI * ((psF32) j) * (0.5 + ((psF32) k)) / ((psF32) n));
+                  cos(M_PI * ((psF32) j) * (0.5 + ((psF32) k)) / ((psF32) n));
         }
 
Index: /trunk/psLib/src/math/psPolynomial.c
===================================================================
--- /trunk/psLib/src/math/psPolynomial.c	(revision 3883)
+++ /trunk/psLib/src/math/psPolynomial.c	(revision 3884)
@@ -7,6 +7,6 @@
  *  polynomials.  It also contains a Gaussian functions.
  *
- *  @version $Revision: 1.100 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-05-05 22:33:14 $
+ *  @version $Revision: 1.101 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-05-11 22:02:16 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -1001,5 +1001,5 @@
 
     if (normal == true) {
-        tmp = 1.0 / PS_SQRT_F32(2.0 * PS_PI * (sigma * sigma));
+        tmp = 1.0 / PS_SQRT_F32(2.0 * M_PI * (sigma * sigma));
     }
 
Index: /trunk/psLib/src/math/psSpline.c
===================================================================
--- /trunk/psLib/src/math/psSpline.c	(revision 3883)
+++ /trunk/psLib/src/math/psSpline.c	(revision 3884)
@@ -7,6 +7,6 @@
  *  polynomials.  It also contains a Gaussian functions.
  *
- *  @version $Revision: 1.100 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-05-05 22:33:14 $
+ *  @version $Revision: 1.101 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-05-11 22:02:16 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -1001,5 +1001,5 @@
 
     if (normal == true) {
-        tmp = 1.0 / PS_SQRT_F32(2.0 * PS_PI * (sigma * sigma));
+        tmp = 1.0 / PS_SQRT_F32(2.0 * M_PI * (sigma * sigma));
     }
 
Index: /trunk/psLib/test/dataManip/tst_psMatrixVectorArithmetic02.c
===================================================================
--- /trunk/psLib/test/dataManip/tst_psMatrixVectorArithmetic02.c	(revision 3883)
+++ /trunk/psLib/test/dataManip/tst_psMatrixVectorArithmetic02.c	(revision 3884)
@@ -10,6 +10,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.12 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2005-04-07 20:27:42 $
+ *  @version $Revision: 1.13 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2005-05-11 22:02:16 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -131,8 +131,8 @@
     testUnaryOpM( log, F64, 1000.0, 0.0, 3, 2, 3 );
     testUnaryOpM( log, C32, 1000.0 + 0.0i, 0.0 + 0.0i, 3, 2, 3 );
-    testUnaryOpM( sin, S32, PS_PI_2, 0, 3, 2, 1 );
-    testUnaryOpM( sin, F32, PS_PI_2, 0.0, 3, 2, 1.0 );
-    testUnaryOpM( sin, F64, PS_PI_2, 0.0, 3, 2, 1.0 );
-    testUnaryOpM( sin, C32, PS_PI_2 + 0.0i, 0.0 + 0.0i, 3, 2, 1.0 );
+    testUnaryOpM( sin, S32, M_PI_2, 0, 3, 2, 1 );
+    testUnaryOpM( sin, F32, M_PI_2, 0.0, 3, 2, 1.0 );
+    testUnaryOpM( sin, F64, M_PI_2, 0.0, 3, 2, 1.0 );
+    testUnaryOpM( sin, C32, M_PI_2 + 0.0i, 0.0 + 0.0i, 3, 2, 1.0 );
     testUnaryOpM( dsin, S32, 90, 0, 3, 2 , 1);
     testUnaryOpM( dsin, F32, 90.0, 0.0, 3, 2, 1.0 );
@@ -147,32 +147,32 @@
     testUnaryOpM( dcos, F64, 0.0, 0.0, 3, 2, 1.0 );
     testUnaryOpM( dcos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, 2, 1.0 );
-    testUnaryOpM( tan, S32, PS_PI_4, 0, 3, 2, 1);
-    testUnaryOpM( tan, F32, PS_PI_4, 0.0, 3, 2, 1.0 );
-    testUnaryOpM( tan, F64, PS_PI_4, 0.0, 3, 2, 1.0 );
-    testUnaryOpM( tan, C32, PS_PI_4 + 0.0i, 0.0 + 0.0i, 3, 2, 1 );
+    testUnaryOpM( tan, S32, M_PI_4, 0, 3, 2, 1);
+    testUnaryOpM( tan, F32, M_PI_4, 0.0, 3, 2, 1.0 );
+    testUnaryOpM( tan, F64, M_PI_4, 0.0, 3, 2, 1.0 );
+    testUnaryOpM( tan, C32, M_PI_4 + 0.0i, 0.0 + 0.0i, 3, 2, 1 );
     testUnaryOpM( dtan, S32, 45, 0, 3, 2, 1 );
     testUnaryOpM( dtan, F32, 45.0, 0.0, 3, 2, 1.0 );
     testUnaryOpM( dtan, F64, 45.0, 0.0, 3, 2, 1.0 );
     testUnaryOpM( dtan, C32, 45.0 + 45.0i, 0.0 + 0.0i, 3, 2, 1.0 );
-    testUnaryOpM( asin, S32, 1, 0, 3, 2, PS_PI_2);
-    testUnaryOpM( asin, F32, 1.0, 0.0, 3, 2, PS_PI_2  );
-    testUnaryOpM( asin, F64, 1.0, 0.0, 3, 2, PS_PI_2);
-    testUnaryOpM( asin, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3, 2, PS_PI_2);
+    testUnaryOpM( asin, S32, 1, 0, 3, 2, M_PI_2);
+    testUnaryOpM( asin, F32, 1.0, 0.0, 3, 2, M_PI_2  );
+    testUnaryOpM( asin, F64, 1.0, 0.0, 3, 2, M_PI_2);
+    testUnaryOpM( asin, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3, 2, M_PI_2);
     testUnaryOpM( dasin, S32, 1.0, 0, 3, 2, 90 );
     testUnaryOpM( dasin, F32, 1.0, 0.0, 3, 2, 90.0 );
     testUnaryOpM( dasin, F64, 1.0, 0.0, 3, 2, 90.0 );
     testUnaryOpM( dasin, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3, 2, 90.0 );
-    testUnaryOpM( acos, S32, 0, 0, 3, 2, PS_PI_2);
-    testUnaryOpM( acos, F32, 0.0, 0.0, 3, 2, PS_PI_2 );
-    testUnaryOpM( acos, F64, 0.0, 0.0, 3, 2, PS_PI_2 );
-    testUnaryOpM( acos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, 2, PS_PI_2 );
+    testUnaryOpM( acos, S32, 0, 0, 3, 2, M_PI_2);
+    testUnaryOpM( acos, F32, 0.0, 0.0, 3, 2, M_PI_2 );
+    testUnaryOpM( acos, F64, 0.0, 0.0, 3, 2, M_PI_2 );
+    testUnaryOpM( acos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, 2, M_PI_2 );
     testUnaryOpM( dacos, S32, 0, 0, 3, 2, 90 );
     testUnaryOpM( dacos, F32, 0.0, 0.0, 3, 2, 90.0 );
     testUnaryOpM( dacos, F64, 0.0, 0.0, 3, 2, 90.0 );
     testUnaryOpM( dacos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, 2, 90.0 );
-    testUnaryOpM( atan, S32, 1, 0, 3, 2, PS_PI_4);
-    testUnaryOpM( atan, F32, 1.0, 0.0, 3, 2, PS_PI_4 );
-    testUnaryOpM( atan, F64, 1.0, 0.0, 3, 2, PS_PI_4);
-    testUnaryOpM( atan, C32, 1.0 + 0.0i, 0.0 + 0.0i, 3, 2, PS_PI_4);
+    testUnaryOpM( atan, S32, 1, 0, 3, 2, M_PI_4);
+    testUnaryOpM( atan, F32, 1.0, 0.0, 3, 2, M_PI_4 );
+    testUnaryOpM( atan, F64, 1.0, 0.0, 3, 2, M_PI_4);
+    testUnaryOpM( atan, C32, 1.0 + 0.0i, 0.0 + 0.0i, 3, 2, M_PI_4);
     testUnaryOpM( datan, S32, 1, 0, 3, 2, 45 );
     testUnaryOpM( datan, F32, 1.0, 0.0, 3, 2, 45.0 );
@@ -216,8 +216,8 @@
     testUnaryOpV( log, F64, 1000.0, 0.0, 3, 3 );
     testUnaryOpV( log, C32, 1000.0 + 0.0i, 0.0 + 0.0i, 3, 3 );
-    testUnaryOpV( sin, S32, PS_PI_2, 0, 3, 1 );
-    testUnaryOpV( sin, F32, PS_PI_2, 0.0, 3, 1.0 );
-    testUnaryOpV( sin, F64, PS_PI_2, 0.0, 3, 1.0 );
-    testUnaryOpV( sin, C32, PS_PI_2 + 0.0i, 0.0 + 0.0i, 3, 1.0 );
+    testUnaryOpV( sin, S32, M_PI_2, 0, 3, 1 );
+    testUnaryOpV( sin, F32, M_PI_2, 0.0, 3, 1.0 );
+    testUnaryOpV( sin, F64, M_PI_2, 0.0, 3, 1.0 );
+    testUnaryOpV( sin, C32, M_PI_2 + 0.0i, 0.0 + 0.0i, 3, 1.0 );
     testUnaryOpV( dsin, S32, 90, 0, 3, 1);
     testUnaryOpV( dsin, F32, 90.0, 0.0, 3, 1.0 );
@@ -232,32 +232,32 @@
     testUnaryOpV( dcos, F64, 0.0, 0.0, 3, 1.0 );
     testUnaryOpV( dcos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, 1.0 );
-    testUnaryOpV( tan, S32, PS_PI_4, 0, 3, 1);
-    testUnaryOpV( tan, F32, PS_PI_4, 0.0, 3, 1.0 );
-    testUnaryOpV( tan, F64, PS_PI_4, 0.0, 3, 1.0 );
-    testUnaryOpV( tan, C32, PS_PI_4 + 0.0i, 0.0 + 0.0i, 3, 1 );
+    testUnaryOpV( tan, S32, M_PI_4, 0, 3, 1);
+    testUnaryOpV( tan, F32, M_PI_4, 0.0, 3, 1.0 );
+    testUnaryOpV( tan, F64, M_PI_4, 0.0, 3, 1.0 );
+    testUnaryOpV( tan, C32, M_PI_4 + 0.0i, 0.0 + 0.0i, 3, 1 );
     testUnaryOpV( dtan, S32, 45, 0, 3, 1 );
     testUnaryOpV( dtan, F32, 45.0, 0.0, 3, 1.0 );
     testUnaryOpV( dtan, F64, 45.0, 0.0, 3, 1.0 );
     testUnaryOpV( dtan, C32, 45.0 + 45.0i, 0.0 + 0.0i, 3, 1.0 );
-    testUnaryOpV( asin, S32, 1, 0, 3, PS_PI_2);
-    testUnaryOpV( asin, F32, 1.0, 0.0, 3, PS_PI_2  );
-    testUnaryOpV( asin, F64, 1.0, 0.0, 3, PS_PI_2);
-    testUnaryOpV( asin, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3, PS_PI_2);
+    testUnaryOpV( asin, S32, 1, 0, 3, M_PI_2);
+    testUnaryOpV( asin, F32, 1.0, 0.0, 3, M_PI_2  );
+    testUnaryOpV( asin, F64, 1.0, 0.0, 3, M_PI_2);
+    testUnaryOpV( asin, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3, M_PI_2);
     testUnaryOpV( dasin, S32, 1.0, 0, 3, 90 );
     testUnaryOpV( dasin, F32, 1.0, 0.0, 3, 90.0 );
     testUnaryOpV( dasin, F64, 1.0, 0.0, 3, 90.0 );
     testUnaryOpV( dasin, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3, 90.0 );
-    testUnaryOpV( acos, S32, 0, 0, 3, PS_PI_2);
-    testUnaryOpV( acos, F32, 0.0, 0.0, 3, PS_PI_2 );
-    testUnaryOpV( acos, F64, 0.0, 0.0, 3, PS_PI_2 );
-    testUnaryOpV( acos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, PS_PI_2 );
+    testUnaryOpV( acos, S32, 0, 0, 3, M_PI_2);
+    testUnaryOpV( acos, F32, 0.0, 0.0, 3, M_PI_2 );
+    testUnaryOpV( acos, F64, 0.0, 0.0, 3, M_PI_2 );
+    testUnaryOpV( acos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, M_PI_2 );
     testUnaryOpV( dacos, S32, 0, 0, 3, 90 );
     testUnaryOpV( dacos, F32, 0.0, 0.0, 3, 90.0 );
     testUnaryOpV( dacos, F64, 0.0, 0.0, 3, 90.0 );
     testUnaryOpV( dacos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, 90.0 );
-    testUnaryOpV( atan, S32, 1, 0, 3, PS_PI_4);
-    testUnaryOpV( atan, F32, 1.0, 0.0, 3, PS_PI_4 );
-    testUnaryOpV( atan, F64, 1.0, 0.0, 3, PS_PI_4);
-    testUnaryOpV( atan, C32, 1.0 + 0.0i, 0.0 + 0.0i, 3, PS_PI_4);
+    testUnaryOpV( atan, S32, 1, 0, 3, M_PI_4);
+    testUnaryOpV( atan, F32, 1.0, 0.0, 3, M_PI_4 );
+    testUnaryOpV( atan, F64, 1.0, 0.0, 3, M_PI_4);
+    testUnaryOpV( atan, C32, 1.0 + 0.0i, 0.0 + 0.0i, 3, M_PI_4);
     testUnaryOpV( datan, S32, 1, 0, 3, 45 );
     testUnaryOpV( datan, F32, 1.0, 0.0, 3, 45.0 );
Index: /trunk/psLib/test/dataManip/tst_psVectorFFT.c
===================================================================
--- /trunk/psLib/test/dataManip/tst_psVectorFFT.c	(revision 3883)
+++ /trunk/psLib/test/dataManip/tst_psVectorFFT.c	(revision 3884)
@@ -6,6 +6,6 @@
 *  @author Robert DeSonia, MHPCC
 *
-*  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-04-07 20:27:42 $
+*  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-05-11 22:02:16 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -68,5 +68,5 @@
     vec->n = vec->nalloc;
     for ( psU32 n = 0; n < 100; n++ ) {
-        vec->data.F32[ n ] = sinf( ( psF32 ) n / 50.0f * PS_PI );
+        vec->data.F32[ n ] = sinf( ( psF32 ) n / 50.0f * M_PI );
     }
 
@@ -111,5 +111,5 @@
     }
     for ( psU32 n = 0; n < 100; n++ ) {
-        psF32 val = sinf( ( psF32 ) n / 50.0f * PS_PI );
+        psF32 val = sinf( ( psF32 ) n / 50.0f * M_PI );
         psF32 vecVal = crealf( vec3->data.C32[ n ] ) / 100;
         if ( fabsf( vecVal - val ) > 0.1f ) {
@@ -548,6 +548,6 @@
     vec3->n = vec3->nalloc;
     for ( psU32 n = 0; n < 100; n++ ) {
-        vec->data.C32[ n ] = n + I * sinf( ( ( psF32 ) n ) / 50.f * PS_PI );
-        vec3->data.C64[ n ] = n + I * sinf( ( ( psF64 ) n ) / 50.f * PS_PI );
+        vec->data.C32[ n ] = n + I * sinf( ( ( psF32 ) n ) / 50.f * M_PI );
+        vec3->data.C64[ n ] = n + I * sinf( ( ( psF64 ) n ) / 50.f * M_PI );
     }
 
Index: /trunk/psLib/test/image/tst_psImageFFT.c
===================================================================
--- /trunk/psLib/test/image/tst_psImageFFT.c	(revision 3883)
+++ /trunk/psLib/test/image/tst_psImageFFT.c	(revision 3884)
@@ -6,6 +6,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-04-15 00:12:09 $
+ *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-05-11 22:02:16 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -68,5 +68,5 @@
 
     // 1. assign a image to a radial sinisoid
-    GENIMAGE(img,m,n,F32, sinf((32.0f-row)/32.0f*PS_PI)+sinf((64.0f-col)/64.0f*PS_PI));
+    GENIMAGE(img,m,n,F32, sinf((32.0f-row)/32.0f*M_PI)+sinf((64.0f-col)/64.0f*M_PI));
 
     // 2. perform a forward transform
Index: /trunk/psLib/test/image/tst_psImageManip.c
===================================================================
--- /trunk/psLib/test/image/tst_psImageManip.c	(revision 3883)
+++ /trunk/psLib/test/image/tst_psImageManip.c	(revision 3884)
@@ -6,6 +6,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.41 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-04-07 20:27:42 $
+ *  @version $Revision: 1.42 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-05-11 22:02:16 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -1315,11 +1315,11 @@
 
         if (rot == 90) {
-            radianRot = PS_PI_2;
+            radianRot = M_PI_2;
         } else if (rot == -90) {
-            radianRot = PS_PI+PS_PI_2;
+            radianRot = M_PI+M_PI_2;
         } else if (rot == 180 || rot == -180) {
-            radianRot = PS_PI;
+            radianRot = M_PI;
         } else {
-            radianRot = ((float)rot)*PS_PI/180.0;
+            radianRot = ((float)rot)*M_PI/180.0;
         }
 
