Skip to content

Instantly share code, notes, and snippets.

View chris-kobrzak's full-sized avatar

Chris Kobrzak chris-kobrzak

View GitHub Profile
@chris-kobrzak
chris-kobrzak / isWithinRadius.js
Last active February 20, 2020 20:53 — forked from moshmage/withinRadius.js
Compares two points' latitude and longitude and returns true if within provided metres
const {asin, cos, sin, sqrt, PI} = Math
const EARTH_RADIUS_KM = 6371
const METERS_IN_KM = 1000
// const deg2rad = n => Math.tan(n * (Math.PI / 180))
const convertDegToRad = degries => degries * (PI / 180)
/**
* is One Point within Another