The map widget I'm using gives me click locations in lat/long. I need to convert those coordinates to EPSG:3857 to query a database.
Most of the solutions I've found use the formula described in this gist: convert from long/lat to google mercator (or EPSG:4326 to EPSG:900913) . But I'm in doubt about the constant
90 used in the
var y = Math.log(Math.tan((90 + lat) * Math.PI / 360)) / (Math.PI / 180);
Which is correct, and why?