Ok I'm stumped,
Trying to convert a formula from "C" to lisp. The formula converts coordinates in Google EPSG4326 (WGS 84) to NOAA Data Viewer coordinates EPSG3857 (WGS 84).
The resultant points will be used to define an AOI (Area Of Interest) window. So they can be a "little off".
Below is what I've got so far, the 2nd to last line is the culprit, I know nothing about "C" programing.
Any assistance in getting this line right would be great.
(defun EPSG4326
->EPSG3857
( vertex
/ smRadius smRange smLonToX smRadiansOverDegrees vertex1 vertex2 y tan
)
smRadius 6378136.98
smRange (* smRadius pi 2.0)
smLonToX (/ smRange 360.0)
smRadiansOverDegrees (/ pi 180.0)
vertex1
(*(car vertex
) smLonToX
) )
((> y 86.0)
)
((< y -86.0)
)
(T
y (* y smRadiansOverDegrees)
y
(log (+ (tan y
) (/ 1.0 (cos y
)))) vertex2 (* y smRadius)
)
)
)
);defun
"C" Code - y = Math.Log(Math.Tan(y) + (1.0 / Math.Cos(y)), Math.E);
This (setq test (EPSG4326->EPSG3857 (list -72.5 42.6)))
Should return this - (-8070663.08251234 5251284.60483522)
edit - This is now solved, posted code works fine.....
Thanks,
Bruce