Using the Distance Formula with Angular

getRadarStationClosest(observationStations: {}, lat: string, long: string): string { const radarStations = <any> observationStations; let closestStation = ''; let firstTime = true; let minDistance = 0; const x1: number = parseFloat(long); const y1: number = parseFloat(lat); radarStations.forEach((element) => { // when calculating distance use the distance formula // sqrt of (x2-x1)^2 + (y2-y1)^2 // long = … Continue reading Using the Distance Formula with Angular