Index: /issm/trunk/src/c/modules/Ll2xyx/Ll2xyx.cpp
===================================================================
--- /issm/trunk/src/c/modules/Ll2xyx/Ll2xyx.cpp	(revision 8714)
+++ /issm/trunk/src/c/modules/Ll2xyx/Ll2xyx.cpp	(revision 8715)
@@ -22,21 +22,9 @@
 %                               -1 : south latitude (default is mer=0  lat=71)
 */
-	double  delta,slat;
-	bool    flag=true;
+	double  central_meridian,standard_parallel;
 
-	/*  Get central_meridian and standard_parallel depending on hemisphere  */
-	if (sgn ==  1) {
-		delta= 45;
-		slat = 70;
-		_printf_(flag,"Info: creating coordinates in polar stereographic (Std Latitude: 70N Meridian: 45).\n");
-	}
-	else if (sgn == -1) {
-		delta= 0;
-		slat = 71;
-		_printf_(flag,"Info: creating coordinates in polar stereographic (Std Latitude: 71S Meridian: 0).\n");
-	}
-	else _error_("Sign should be either +1 or -1.\n");
+	Ll2xydef(&central_meridian,&standard_parallel,sgn);
 
-	return(Ll2xyx(x,y, lat,lon,ncoord, sgn,delta,slat));
+	return(Ll2xyx(x,y,lat,lon,ncoord,sgn,central_meridian,standard_parallel));
 }
 
@@ -59,5 +47,5 @@
 	int     i,iret=0;
 	double  delta,slat;
-	double  cde,re,ex2,ex,pi;
+	double  cde,re,ex2,ex;
 	double  latitude,longitude;
 	double  T,rho,sl,tc,mc;
@@ -105,2 +93,35 @@
 	return(iret);
 }
+
+void Ll2xydef(double* pdelta, double* pslat, int sgn){
+/*  This is a cpp conversion of the following:
+%LL2XY - converts lat long to polar stereographic
+%
+%   Converts from geodetic latitude and longitude to Polar 
+%   Stereographic (X,Y) coordinates for the polar regions.
+%   Author: Michael P. Schodlok, December 2003 (map2ll)
+%
+%   Usage:
+%      [x,y] = ll2xy(lat,lon,sgn)
+%      [x,y] = ll2xy(lat,lon,sgn,central_meridian,standard_parallel)
+%
+%      - sgn = Sign of latitude +1 : north latitude (default is mer=45 lat=70)
+%                               -1 : south latitude (default is mer=0  lat=71)
+*/
+	bool    flag=true;
+
+	/*  Get central_meridian and standard_parallel depending on hemisphere  */
+	if (sgn ==  1) {
+		*pdelta= 45;
+		*pslat = 70;
+		_printf_(flag,"Info: creating coordinates in polar stereographic (Std Latitude: 70N Meridian: 45).\n");
+	}
+	else if (sgn == -1) {
+		*pdelta= 0;
+		*pslat = 71;
+		_printf_(flag,"Info: creating coordinates in polar stereographic (Std Latitude: 71S Meridian: 0).\n");
+	}
+	else _error_("Sign should be either +1 or -1.\n");
+
+	return;
+}
Index: /issm/trunk/src/c/modules/Ll2xyx/Ll2xyx.h
===================================================================
--- /issm/trunk/src/c/modules/Ll2xyx/Ll2xyx.h	(revision 8714)
+++ /issm/trunk/src/c/modules/Ll2xyx/Ll2xyx.h	(revision 8715)
@@ -9,4 +9,5 @@
 int Ll2xyx(double* x, double* y, double* lat, double* lon, int ncoord, int sgn);
 int Ll2xyx(double* x, double* y, double* lat, double* lon, int ncoord, int sgn, double central_meridian, double standard_parallel);
+void Ll2xydef(double* pdelta, double* pslat, int sgn);
 
 #endif  /* _LL2XYX_H */
Index: /issm/trunk/src/c/modules/Xy2llx/Xy2llx.cpp
===================================================================
--- /issm/trunk/src/c/modules/Xy2llx/Xy2llx.cpp	(revision 8714)
+++ /issm/trunk/src/c/modules/Xy2llx/Xy2llx.cpp	(revision 8715)
@@ -23,22 +23,9 @@
 %                               -1 : south latitude (default is mer=0  lat=71)
 */
+	double  central_meridian,standard_parallel;
 
-	double  delta,slat;
-	bool    flag=true;
+	Xy2lldef(&central_meridian,&standard_parallel,sgn);
 
-	/*  Get central_meridian and standard_parallel depending on hemisphere  */
-	if (sgn == 1) {
-		delta= 45;
-		slat = 70;
-		_printf_(flag,"Warning: expecting coordinates in polar stereographic (Std Latitude: 70N Meridian: 45).\n");
-	}
-	else if (sgn == -1) {
-		delta= 0;
-		slat = 71;
-		_printf_(flag,"Warning: expecting coordinates in polar stereographic (Std Latitude: 71S Meridian: 0).\n");
-	}
-	else _error_("Sign should be either +1 or -1.\n");
-
-	return(Xy2llx(lat,lon,x,y,ncoord,sgn,delta,slat));
+	return(Xy2llx(lat,lon,x,y,ncoord,sgn,central_meridian,standard_parallel));
 }
 
@@ -62,5 +49,5 @@
 	int     i,iret=0;
 	double  delta,slat;
-	double  cde,re,ex2,ex,pi;
+	double  cde,re,ex2,ex;
 	double  sl,rho,cm,T,chi;
 
@@ -106,6 +93,6 @@
 		}
 
-		lon[i] = lon[i] * 180. / pi;
-		lat[i] = lat[i] * 180. / pi;
+		lon[i] = lon[i] * 180. / PI;
+		lat[i] = lat[i] * 180. / PI;
 		lon[i] = lon[i] - delta; 
 	}
@@ -113,2 +100,36 @@
 	return(iret);
 }
+
+void Xy2lldef(double* pdelta, double* pslat, int sgn){
+/*  This is a cpp conversion of the following:
+%XY2LL - converts xy to lat long
+%
+%   Converts Polar  Stereographic (X,Y) coordinates for the polar regions to
+%   latitude and longitude Stereographic (X,Y) coordinates for the polar
+%   regions.
+%   Author: Michael P. Schodlok, December 2003 (map2xy.m)
+%
+%   Usage:
+%      [lat,lon] = xy2ll(x,y,sgn);
+%      [lat,lon] = xy2ll(x,y,sgn,central_meridian,standard_parallel);
+%
+%      - sgn = Sign of latitude +1 : north latitude (default is mer=45 lat=70)
+%                               -1 : south latitude (default is mer=0  lat=71)
+*/
+	bool    flag=true;
+
+	/*  Get central_meridian and standard_parallel depending on hemisphere  */
+	if (sgn == 1) {
+		*pdelta= 45;
+		*pslat = 70;
+		_printf_(flag,"Warning: expecting coordinates in polar stereographic (Std Latitude: 70N Meridian: 45).\n");
+	}
+	else if (sgn == -1) {
+		*pdelta= 0;
+		*pslat = 71;
+		_printf_(flag,"Warning: expecting coordinates in polar stereographic (Std Latitude: 71S Meridian: 0).\n");
+	}
+	else _error_("Sign should be either +1 or -1.\n");
+
+	return;
+}
Index: /issm/trunk/src/c/modules/Xy2llx/Xy2llx.h
===================================================================
--- /issm/trunk/src/c/modules/Xy2llx/Xy2llx.h	(revision 8714)
+++ /issm/trunk/src/c/modules/Xy2llx/Xy2llx.h	(revision 8715)
@@ -9,4 +9,5 @@
 int Xy2llx(double* lat, double* lon, double* x, double* y, int ncoord, int sgn);
 int Xy2llx(double* lat, double* lon, double* x, double* y, int ncoord, int sgn, double central_meridian, double standard_parallel);
+void Xy2lldef(double* pdelta, double* pslat, int sgn);
 
 #endif  /* _XY2LLX_H */
