public double AnalizeElevationInM(WayPoint[] wayPoints) { double result = 0; for (int i = 0, j = 1; j < wayPoints.Length; i++, j++) { if (_areaAnalizer.IsArea(wayPoints[i].Elevation, wayPoints[j].Elevation)) { result += wayPoints[i].Elevation - wayPoints[j].Elevation; } } return(_areaAnalizer.GetTotalElevation(result)); }
public double AnalizeTimeInSeconds(WayPoint[] wayPoints) { double result = 0; for (int i = 0, j = 1; j < wayPoints.Length; i++, j++) { if (_areaAnalizer.IsArea(wayPoints[i].Elevation, wayPoints[j].Elevation)) { result += _timeLocationsAnalizer.GetTimeInSeconds(wayPoints[i].Time, wayPoints[j].Time); } } return(result); }
public double AnalizeDistanceInKm(WayPoint[] wayPoints) { double result = 0; for (int i = 0, j = 1; j < wayPoints.Length; i++, j++) { if (_areaAnalizer.IsArea(wayPoints[i].Elevation, wayPoints[j].Elevation)) { result += _distanceLocationsAnalizer.GetDistanceInKm( wayPoints[i].Latitude, wayPoints[i].Longitude, wayPoints[j].Latitude, wayPoints[j].Longitude ); } } return(result); }
public double AnalizeSpeedInKilometerPerHour(WayPoint[] wayPoints) { double sumSpeed = 0; double wayPointsCount = 0; for (int i = 0, j = 1; j < wayPoints.Length; i++, j++) { if (!_areaAnalizer.IsArea(wayPoints[i].Elevation, wayPoints[j].Elevation)) { continue; } sumSpeed += _speedCalculator.CalculateInKilometerPerHour( _distanceLocationsAnalizer.GetDistanceInKm( wayPoints[i].Latitude, wayPoints[i].Longitude, wayPoints[j].Latitude, wayPoints[j].Longitude), _timeLocationsAnalizer.GetTimeInSeconds(wayPoints[i].Time, wayPoints[j].Time)); wayPointsCount++; } return(GetAverageSpeed(sumSpeed, wayPointsCount)); }