Reputation: 161
I want to Draw a circle with given latitude and longitude
["lat":51.41714046916216,"lng":-2.3588300000000095] in google map with 22 miles area.
How can i find radius from given miles/kilometer Any help will be appreciated.
Upvotes: 1
Views: 2110
Reputation: 51933
Circle area:
area=PI*radius^2
so:
radius=sqrt(area/PI)
PI = 3.1415926535897932384626433832795
area is in the same units as radius !!!
Well if you have already 2D orthonormal coordinate system then this is OK but if not (X axis units are different then Y axis units and nonlinear) then this formula will not work properly. In that case the circle area must be projected from orthonormal space back to your Ellipsoid surface projection.
For that you have to add more info. However for small enough surfaces it can be simplified by ellipse. Also the target accuracy is a relevant information for this.
Upvotes: 1
Reputation: 208052
The formula for the area of a circle is
A = Pi * radius * radius
so the radius is
r = sqrt(area/Pi)
so in your case
r = sqrt(22/3.1415)
so
r = 2.64 miles or 4.25 km
Note that this is approximate because the formula is based on flat surfaces, and the Earth's surface obviously isn't flat, but it will not be that great a difference for relatively small areas like yours.
Upvotes: 0