Ideas to track the user, determine his location and see if the user is in the area I specify between two specific latitudes and two specific longitude

As you`ve read, I want ideas to track the user, determine his location and see if the user is in the area I specify between two specific latitudes and two specific longitudes.

this is how i was using in my school app and allow the teachers to mark attendance within specific range compared with school main office geolocation. Like this you also can check up