예제 #1
0
파일: ETAService.cs 프로젝트: cimey/LogicX
        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));
        }
예제 #2
0
 public IHttpActionResult CalculateETA(CalculateETAInput input)
 {
     return(Ok(_etaService.CalculateETA(input)));
 }