Answer the question
In order to leave comments, you need to log in
[Geodata] What library can be used to determine the occurrence of the current coordinates in a circle with a certain radius?
Hello.
Problem
There is a point A with known coordinates. There is a radius B(A), starting at point A, which is given in meters/feet/km/etc. There is a device with current coordinates.
It is necessary to determine whether the device with current coordinates enters a circle with radius B(A).
Example. The city center is given by coordinates (longitude, latitude), the radius is set to 30 meters around the city center. It is necessary to determine whether the current location of the mobile device is included in this circle or not.
Need a link to a library, tutorial or manual, or lesson. Read, understand and learn.
If someone can explain step by step the principle of determining the entry into a circle, I will also be glad.
Thanks in advance!
Sincerely.
Answer the question
In order to leave comments, you need to log in
www.movable-type.co.uk/scripts/latlong-db.html
briefly
d = acos( sin(lat1)*sin(lat2) + cos(lat1)*cos(lat2)*cos(lon2-lon1) ) * R
is the distance between two points (latitude and longitude must be converted to radians)
R- 6371km the radius of the earth
on the page is sql for selecting points within a radius of the current one, I think the current sqlite will pull it.
I don't know libraries for android, sorry
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question