Location based login - ionic 1

Hello, I am new on Ionic and searching for solution where user can login if the users login with a circle area distance of predefined co-ordinates. For example, predefined location co-ordinates is 37.476553,-122.2251151 and user can login with the 200 meter of circle distance of that co-ordinates. Hover I want use user GPS co-ordinates. I know there was a cordova plugin to get user co-ordinates cordova-plugin-geolocation but don’t know how to calculate the distance form predefined co-ordinates using it. I am suing ionic 1 version. If any one know please let me know.
Thanks in advance.

What you are describing is known as a “geofence” and there are multiple Cordova plugins for that. One of them is this: https://github.com/cowbell/cordova-plugin-geofence