Some GIS utility functions I have used in multiple projects.
npm install gis-utils --save
deg2rad(degrees)
rad2deg(angle)
haversineKm(fromLocation, toLocation)
calculateRadiusFromMapBounds(bounds)
getNESWBoundsFromRadiusAndCenter(radius, center)
getNWSEBoundsFromRadiusAndCenter(radius, center)
computeDestinationPoint(lat, lon, distance, bearing, radius)
isLatAndLngInRectBoundary(point, boundary)