Compare coordinates, and detect if it is in a certain area

I was starting a project, to automate certain functions that I do daily in my cell phone, and I decided to use SSIDS for wifi and locations for this.

I’d like to know if it’s possible to compare locations.
For example, compare my current location and see if I’m within a certain area, I tried doing this using the polygnes or a certain range of coordinates, but it’s always flawed, does makeroid have any function to compare coordinates? or maybe there is some other way to do it?

Sorry if my English is not very good, thank you in advance for your help.