This program convert the C+ math source onto LISP (or GIMP),
- I need help from you, you transform your'images to math script like as "pp_utm_watermocasin"
- This program transform the math script on Lisp-Script (example output)
#region
pp_utm_watermocasin
//Inf: UTM to LatLon test
//Eg1: (pp_utmirneb 451602.19 4519076.99 "33N")
//ByA: Water Moccasin
(defun pp_utm_watermocasin( utmX utmY utmZone / rr latitude longitude len isnorthhemisphere diflat diflon c_sa c_sb e2 e2cuadrada c x y s v a1 a2 j2 j4 j6 alfa beta gama bm epsi eps nab senoheps delt tao zone)
/*c2s:
latitude = 0,
longitude = 0;
len=_tcslen(utmZone);
// Changed from utmZone.Last as the Linq version is much slower than simply indexing
// the last position in the string's array of characters
if (len>1)
{ isNorthHemisphere = substr(utmZone,len,1),
diflat = -0.00066286966871111111111111111111111111,
diflon = -0.0003868060578,
utmZone = substr(utmZone,1,len-1);
c_sa = 6378137.000000;
c_sb = 6356752.314245;
e2 = math_pow((math_Pow(c_sa, 2) - Math_Pow(c_sb, 2)), 0.5) / c_sb;
e2cuadrada = Math_Pow(e2, 2);
c = math_pow(c_sa, 2) / c_sb;
x = utmX - 500000;
isNorthHemisphere =(isNorthHemisphere >"N")?T:nil;
y = isNorthHemisphere ? utmY : utmY - 10000000;
zone=atoi(utmZone);
s = ((zone * 6.0) - 183.0);
lat = y / (6366197.724 * 0.9996); // Change c_sa for 6366197.724
v = (c / math_pow(1 + (e2cuadrada * math_pow(cos(lat), 2)), 0.5)) * 0.9996;
a = x / v;
a1 = sin(2 * lat);
a2 = a1 * math_pow((cos(lat)), 2);
j2 = lat + (a1 / 2.0);
j4 = ((3 * j2) + a2) / 4.0;
j6 = (5 * j4 + a2 * math_pow((cos(lat)), 2)) / 3.0; // saque a2 de multiplicar por el coseno de lat y elevar al cuadrado
alfa = (3.0 / 4.0) * e2cuadrada;
beta = (5.0 / 3.0) * math_pow(alfa, 2);
gama = (35.0 / 27.0) * math_pow(alfa, 3);
bm = 0.9996 * c * (lat - alfa * j2 + beta * j4 - gama * j6);
b = (y - bm) / v;
epsi = ((e2cuadrada * math_pow(a, 2)) / 2.0) * math_pow((cos(lat)), 2);
eps = a * (1 - (epsi / 3.0));
nab = (b * (1 - epsi)) + lat;
senoheps = (math_exp(eps) - Math_Exp(-eps)) / 2.0;
delt = atan(senoheps / (cos(nab)));
tao = atan(cos(delt) * sin(nab) / cos(nab));
longitude = (delt / Math_PI) * 180 + s;
latitude = (((lat + (1 + e2cuadrada * math_pow(cos(lat), 2) - (3.0 / 2.0) * e2cuadrada * sin(lat) * cos(lat) * (tao - lat)) * (tao - lat))) / Math_PI) * 180.0; // era incorrecto el calculo
str_princ(list("\nLatitud: " ,latitude,
"\nLongitud: " , longitude));
rr=list(latitude,longitude);
};
*/
rr)
%include=_tcslen
%include=math_exp
%include=math_pi
%include=math_pow
%include=str_princ
#endregion
(defun;;;{$N+}
pp_utm_watermocasin
( utmX utmY utmZone / rr latitude longitude len isnorthhemisphere diflat diflon c_sa c_sb e2 e2cuadrada c x y s v a1 a2 j2 j4 j6 alfa beta gama bm epsi eps nab senoheps delt tao zone)
(setq;|a21124|;
latitude 0
longitude 0) (setq;|a21178|;
len (_tcslen utmZone)) (if (> len 1) (progn (setq;|a21287|;
isNorthHemisphere (substr utmZone len 1)
diflat (- 0.00066286966871111111111111111111111111)
diflon (- 0.0003868060578)
utmZone (substr utmZone 1 (- len 1))) (setq;|a21481|;
c_sa 6378137.000000) (setq;|a21508|;
c_sb 6356752.314245) (setq;|a21535|;
e2 (/ (math_pow (- (math_Pow c_sa 2) (Math_Pow c_sb 2)) 0.5) c_sb)) (setq;|a21650|;
e2cuadrada (Math_Pow e2 2)) (setq;|a21697|;
c (/ (math_pow c_sa 2) c_sb)) (setq;|a21758|;
x (- utmX 500000)) (setq;|a21799|;
isNorthHemisphere (if (> isNorthHemisphere "N") T nil)) (setq;|a21863|;
y (if isNorthHemisphere utmY (- utmY 10000000))) (setq;|a21926|;
zone (atoi utmZone)) (setq;|a21964|;
s (- (* zone 6.0) 183.0)) (setq;|a22019|;
lat (/ y (* 6366197.724 0.9996))) (setq;|a22074|;
v (* (/ c (math_pow (+ 1 (* e2cuadrada (math_pow (cos lat) 2))) 0.5)) 0.9996)) (setq;|a22204|;
a (/ x v)) (setq;|a22245|;
a1 (sin (* 2 lat))) (setq;|a22293|;
a2 (* a1 (math_pow (cos lat) 2))) (setq;|a22361|;
j2 (+ lat (/ a1 2.0))) (setq;|a22416|;
j4 (/ (+ (* 3 j2) a2) 4.0)) (setq;|a22485|;
j6 (/ (+ (* 5 j4) (* a2 (math_pow (cos lat) 2))) 3.0)) (setq;|a22595|;
alfa (* (/ 3.0 4.0) e2cuadrada)) (setq;|a22650|;
beta (* (/ 5.0 3.0) (math_pow alfa 2))) (setq;|a22725|;
gama (* (/ 35.0 27.0) (math_pow alfa 3))) (setq;|a22800|;
bm (* 0.9996 c (- (+ (- lat (* alfa j2)) (* beta j4)) (* gama j6)))) (setq;|a22933|;
b (/ (- y bm) v)) (setq;|a22988|;
epsi (* (/ (* e2cuadrada (math_pow a 2)) 2.0) (math_pow (cos lat) 2))) (setq;|a23104|;
eps (* a (- 1 (/ epsi 3.0)))) (setq;|a23173|;
nab (+ (* b (- 1 epsi)) lat)) (setq;|a23242|;
senoheps (/ (- (math_exp eps) (Math_Exp (- eps))) 2.0)) (setq;|a23326|;
delt (atan (/ senoheps (cos nab)))) (setq;|a23381|;
tao (atan (/ (* (cos delt) (sin nab)) (cos nab)))) (setq;|a23464|;
longitude (+ (* (/ delt Math_PI) 180) s)) (setq;|a23533|;
latitude (* (/ (+ lat (* (- (+ 1 (* e2cuadrada (math_pow (cos lat) 2))) (* (/ 3.0 2.0) e2cuadrada (sin lat) (cos lat) (- tao lat))) (- tao lat))) Math_PI) 180.0)) (str_princ (list "\nLatitud: " latitude "\nLongitud: " longitude)) (setq;|a23835|;
rr (list latitude longitude))))
rr)
;;;{$E}
;Lib:free
You do not have time to learn Vla*ComTransformer.exe,
a) You care