I try to calculate the boundaries for a square with a certain radius and when the center of the square (longitude, latitude) is known. But I come across this.
I tried using the haversine formula from here :

But I start to worry when the radius is quite large.
Currently find 1). latitude delta in radians I use:
- radiusInMeters / EARTH_RADIUS_METERS
2). longitude delta in radians I use:
- 2.0 * | arcsin (| sin (radiusInMeters / (EARTH_RADIUS_METERS * 2.0)) / | cos (latitudeStart) | |) |
I got these formulas from the haversine formula.
Can someone please give me an exact general formula for calculations, which will be good for large and small distances for my case.
Also, how should situations be handled when the radius exceeds -180Λ / 180Λ in longitude or -90Λ / 90Λ in latitude?
UPDATE
Some clarifications. Let's say that I stay at a certain point with the coordinates (lon, lat), where lon is -113Λ and lat 50Λ.
I would like to request points in a certain radius of interest from the database. To do this, I need to calculate the boundaries of the "square". (Then filter out material that is not in an interesting radius). The formula above works great for short distances (say, "up to 100 kilometers (63 miles)). But the more I go from the equatorial point of the poles, the more rounding errors I get.)
Thank you in advance
hades source share