-2

I have a google map in my android application. and I have drawn a circle on specific latitude and longitude on the map, and the circle's radius is 500 meters. I want to find the maximum and minimum latitudes and longitudes in that circle, how to do this?

to explain my idea further, see the picture below:

The picture

I want to calculate all of the possible latitudes and longitudes on that red circle, can someone please tell me how to do it?

LamaTat
  • 65
  • 5

1 Answers1

1

A single max and min for latitude and longitude is going to give you a squarish shape, which is not what the image suggests you're looking for. Furthermore, there will be infinite latitudes and longitudes within that area depending on how precise you want to get, so getting all of them is going to be a problem.

What I suspect you're after is a way to check if a specific latitude and longitude is within that circle. You can use the Pythagorean theorem for that:

enter image description here

Where 0.005 is based on a general approximation of 500 meters being 0.005 degrees on Earth.

Jacob See
  • 755
  • 6
  • 17
  • 1
    Note: this math only works near equator because there 1 lon degree has a distance of 111km at the poles the distance is 0km. – Roland Starke Apr 23 '16 at 10:07