public DateTime CalculateETA(CalculateETAInput input) { var sCoord = new GeoCoordinate(input.Lattitude, input.Longitude); var eCoord = new GeoCoordinate(_coffeeShopLattitude, _coffeeShopLongitude); var distance = sCoord.GetDistanceTo(eCoord); //an average person walk 1.4 meters in one second //so if we divide distance to speed we get the time in seconds return(DateTime.Now.AddSeconds(distance / 1.4)); }
public IHttpActionResult CalculateETA(CalculateETAInput input) { return(Ok(_etaService.CalculateETA(input))); }