# Getting a "square" of lat/lon for database query [duplicate]

So I want to get the square formed by a single point of lat/lons, my plan was to take that point's latitude, divide by 360, and multiply by the circumference of earth. Giving us the distance from the equator.

Now I will take 1/4 the circumference of earth, and subtract by the distance from the equator, giving us the height of triangle T. I can the find the base because I know the initial height, truncated height, and the original base.

Now using the base and height I can use trig to find the minimum and maximum longitude, and the latitude is easy because lets are evenly spaced. Does this sound right?

EDIT:

Let me simplify this question.

How can I find the distance between two points of longitude, at a single point of latitude?

• The range of latitude values is not from 0->360. Apr 8, 2013 at 0:48
• I think you need to work with Projected coordinate system and not geographic lat/lng since you cannot perfrom measurements with lat/lng. Apr 8, 2013 at 1:03
• Not sure what you are asking for exactly but maybe a look at Great-circle distance, the Haversine formula, and Vincenty's formulae will get you closer. Apr 8, 2013 at 1:25
• Can you turn this into a comprehensive answer to the original question, paste it in below ("Your Answer") and click the tick (check) icon to make it "the answer"? Thanks Apr 8, 2013 at 3:10
• ya I can do that Apr 8, 2013 at 3:12