[GIS] Converting latitude, longitude (epsg:4326) into EPSG:3857

cconvertcoordinate systemmathematicspython

I'm looking to study the math involved to see how a given latitude and longitude in decimal degrees can be converted to EPSG:3857. Can anybody point to a good reference or a possible Ppython/C/C++/Java library source code for checking the math?

Best Answer

from pyproj import Proj, transform

P3857 = Proj(init='epsg:3857')
P4326 = Proj(init='epsg:4326')

x,y = transform(P4326, P3857, lon, lat)