# How to calculate new coordinates by given distance, angle and altitude

I'm using C function to calculate new coordinates by given distance and angle to download google static maps tile by tile to create small map at given zoom. I have troubles because this code works only at specific area e.g Melbourne but in Prague I have to add 6 meters to distance to work it properly. I don't know if the problem is in my calculating function, google use different scale in different areas or someting else.

``````if (move_to_east)
{

dx = distance*sin(M_PI/2);

dy = distance*cos(M_PI/2);

delta_longitude = dx/(111320*cos(Latitude*M_PI/180));

o_PositionData.NewLong = Longitude + delta_longitude;

delta_latitude = dy/110540;

o_PositionData.NewLat = Latitude + delta_latitude;

}
else if (move_to_south)
{
dx = distance*sin(M_PI);

dy = distance*cos(M_PI);

delta_longitude = dx/(111320*cos(Latitude*M_PI/180));

o_PositionData.NewLong = Longitude + delta_longitude;

delta_latitude = dy/110540;

o_PositionData.NewLat = Latitude + delta_latitude;

}
``````
-
Where do the magic numbers come from? –  BradHards Mar 19 '13 at 11:06