I'm using/learning geodjango + postgis, and I'm trying to calculate distance between 2 cities in Poland. First using WGS84/4326 I define 2 points, and then after transforming this points into spherical mercator 900913 i get distance which is about 40km too long. Which map projection should I use then? Where can I find proper srid's for different countries?
That's what picking a decent map projection is all about. I don't know your lat/long range but you can query projections relevant to a lat/long bounding box at the EPSG Geodetic Parameter Dataset. This should give some codes to test out.
EDIT: Thanks for posting your coordinates. When you just calculate a cartesian distance between these points in a Plate Carree or something similar projection, you get something like 90km which is obviously the wrong result from a wrong method.
Others have explained the 'math route' using a spherical calculation, so I took the 'tool route' and retrieved the ETRS89 projection from the EPSG database based on your coordinates, measuring in this coordinate system I get about 63km, which is the considerable difference we're seeing.
Based on the 2 points in your comments:
I used two different approaches. The formula given in The Aviation Formulary I ended up with a distance of 63.116745 KM
I also used this tool Calculate distance, bearing and more between Latitude/Longitude points. I ended up with an answer of 63.16 km.
Both methods use a "cue ball" earth, they do not use WGS84, or any projection.