Index: /trunk/psLib/src/dataManip/psFunctions.c
===================================================================
--- /trunk/psLib/src/dataManip/psFunctions.c	(revision 792)
+++ /trunk/psLib/src/dataManip/psFunctions.c	(revision 793)
@@ -16,5 +16,6 @@
 #include "float.h"
 #include <math.h>
-#define PI 3.14
+#include <gsl/gsl_rng.h>
+#include <gsl/gsl_randist.h>
 /*****************************************************************************
     Evaluate a non-normalized Gaussian with the given mean and sigma at the
@@ -31,5 +32,5 @@
 
     if (normal == 1) {
-        tmp = 1.0 / sqrtf(2.0 * PI * (stddev * stddev));
+        tmp = 1.0 / sqrtf(2.0 * M_PI * (stddev * stddev));
         return(tmp * exp(-((x-mean) * (x-mean)) / (2.0 * stddev * stddev)));
     } else {
@@ -38,5 +39,13 @@
 }
 
-/*
+/*****************************************************************************
+    psGaussianDev()
+ 
+ This routine creates a psVector of the specified size and type F32
+ and fils it with a random Gaussiang distribution of numbers with
+ the specified meand and sigma.  This routine makes use of the GSL
+ routines for generating both uniformly distributed numbers and the
+ Gaussian distribution as well.
+ *****************************************************************************/
 psVector *psGaussianDev(float mean,
                         float sigma,
@@ -44,8 +53,19 @@
 {
     psVector *gauss = NULL;
- 
+    const gsl_rng_type *T = NULL;
+    gsl_rng *r = NULL;
+    int i = 0;
+
     gauss = psVectorAlloc(Npts, PS_TYPE_FLOAT);
-}
-*/
+    gsl_rng_env_setup();
+    T = gsl_rng_default;
+    r = gsl_rng_alloc(T);
+
+    for (i = 0; i < Npts; i++) {
+        gauss->vec.f[i] = mean + gsl_ran_gaussian(r, sigma);
+    }
+    return(gauss);
+}
+
 
 /*****************************************************************************
Index: /trunk/psLib/src/math/psPolynomial.c
===================================================================
--- /trunk/psLib/src/math/psPolynomial.c	(revision 792)
+++ /trunk/psLib/src/math/psPolynomial.c	(revision 793)
@@ -16,5 +16,6 @@
 #include "float.h"
 #include <math.h>
-#define PI 3.14
+#include <gsl/gsl_rng.h>
+#include <gsl/gsl_randist.h>
 /*****************************************************************************
     Evaluate a non-normalized Gaussian with the given mean and sigma at the
@@ -31,5 +32,5 @@
 
     if (normal == 1) {
-        tmp = 1.0 / sqrtf(2.0 * PI * (stddev * stddev));
+        tmp = 1.0 / sqrtf(2.0 * M_PI * (stddev * stddev));
         return(tmp * exp(-((x-mean) * (x-mean)) / (2.0 * stddev * stddev)));
     } else {
@@ -38,5 +39,13 @@
 }
 
-/*
+/*****************************************************************************
+    psGaussianDev()
+ 
+ This routine creates a psVector of the specified size and type F32
+ and fils it with a random Gaussiang distribution of numbers with
+ the specified meand and sigma.  This routine makes use of the GSL
+ routines for generating both uniformly distributed numbers and the
+ Gaussian distribution as well.
+ *****************************************************************************/
 psVector *psGaussianDev(float mean,
                         float sigma,
@@ -44,8 +53,19 @@
 {
     psVector *gauss = NULL;
- 
+    const gsl_rng_type *T = NULL;
+    gsl_rng *r = NULL;
+    int i = 0;
+
     gauss = psVectorAlloc(Npts, PS_TYPE_FLOAT);
-}
-*/
+    gsl_rng_env_setup();
+    T = gsl_rng_default;
+    r = gsl_rng_alloc(T);
+
+    for (i = 0; i < Npts; i++) {
+        gauss->vec.f[i] = mean + gsl_ran_gaussian(r, sigma);
+    }
+    return(gauss);
+}
+
 
 /*****************************************************************************
Index: /trunk/psLib/src/math/psSpline.c
===================================================================
--- /trunk/psLib/src/math/psSpline.c	(revision 792)
+++ /trunk/psLib/src/math/psSpline.c	(revision 793)
@@ -16,5 +16,6 @@
 #include "float.h"
 #include <math.h>
-#define PI 3.14
+#include <gsl/gsl_rng.h>
+#include <gsl/gsl_randist.h>
 /*****************************************************************************
     Evaluate a non-normalized Gaussian with the given mean and sigma at the
@@ -31,5 +32,5 @@
 
     if (normal == 1) {
-        tmp = 1.0 / sqrtf(2.0 * PI * (stddev * stddev));
+        tmp = 1.0 / sqrtf(2.0 * M_PI * (stddev * stddev));
         return(tmp * exp(-((x-mean) * (x-mean)) / (2.0 * stddev * stddev)));
     } else {
@@ -38,5 +39,13 @@
 }
 
-/*
+/*****************************************************************************
+    psGaussianDev()
+ 
+ This routine creates a psVector of the specified size and type F32
+ and fils it with a random Gaussiang distribution of numbers with
+ the specified meand and sigma.  This routine makes use of the GSL
+ routines for generating both uniformly distributed numbers and the
+ Gaussian distribution as well.
+ *****************************************************************************/
 psVector *psGaussianDev(float mean,
                         float sigma,
@@ -44,8 +53,19 @@
 {
     psVector *gauss = NULL;
- 
+    const gsl_rng_type *T = NULL;
+    gsl_rng *r = NULL;
+    int i = 0;
+
     gauss = psVectorAlloc(Npts, PS_TYPE_FLOAT);
-}
-*/
+    gsl_rng_env_setup();
+    T = gsl_rng_default;
+    r = gsl_rng_alloc(T);
+
+    for (i = 0; i < Npts; i++) {
+        gauss->vec.f[i] = mean + gsl_ran_gaussian(r, sigma);
+    }
+    return(gauss);
+}
+
 
 /*****************************************************************************
