I have a calculate function and the latlng values but how do I calculate the distance between the first and the last?
function calculate() {
//poo abbreviation for point of origin not poo=shit
var poolat = locations[0].lat;
var poolng = locations[0].lng;
var destlat = locations[locations.length - 1].lat;
var destlng = locations[locations.length - 1].lng;