I have an Openlayers application where I can input a centre point, width and height in meters from which I can generate a bounding box to display on the map. The problem I'm having is calculating the box with the correct length sides. The input data is as follows:
Latitude: 53.3530563113 Longitude: -6.45723718258 Height: 50 meters Width: 50 meters
The lats and longs are converted to EPSG:900913 (3857) and the box creation maths performed to output the following coordinates, shown in both EPSG:900913 & EPSG:4326.
Centre Point X/Y: -718816.355096198/7048572.675410685 Bottom Left Point: x: -718841.355096198, y: 7048547.675410685 Long: -6.45746176140103, Lat: 53.35292226393439 Top Left Point: x: -718841.355096198, y: 7048597.675410685 Long: -6.45746176140103, Lat: 53.35319035824405 Top Right Point: x: -718791.355096198, y: 7048597.675410685 Long: -6.45701260375897, Lat: 53.35319035824405 Bottom Right Point: x: -718791.355096198, y: 7048547.675410685 Long: -6.45701260375897, Lat: 53.35292226393439
The distance between any of the EPSG:900913 vertex points, or the length of any of the vertex is 50 meters (as set) but the distance between the Lat Long transforms is closer to 30 meters.
I'm aware of Cartesian and projected coordinate etc. systems but should the difference be this big or should I do my calculations some other way instead of transforming to 900913 and back to 4326, i.e. only in Lats and Longs to try and get the 50 meters correct in the 4326 system.
Any links/info or maths to get this right?