Example #1
0
        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);
        }
Example #2
0
        public double AnalizeSpeedInKilometerPerHour(WayPoint[] wayPoints)
        {
            double extremumSpeed = _extremumSpeedAnalizer.InitialSpeed;

            for (int i = 0, j = 1; j < wayPoints.Length; i++, j++)
            {
                double distanceInKm = _distanceLocationsAnalizer.GetDistanceInKm(
                    wayPoints[i].Latitude,
                    wayPoints[i].Longitude,
                    wayPoints[j].Latitude,
                    wayPoints[j].Longitude);

                double timeInSeconds = _timeLocationsAnalizer.GetTimeInSeconds(wayPoints[i].Time, wayPoints[j].Time);

                extremumSpeed = _extremumSpeedAnalizer.GetExtremumSpeed(
                    extremumSpeed,
                    _speedCalculator.CalculateInKilometerPerHour(
                        distanceInKm,
                        timeInSeconds));
            }
            return(extremumSpeed);
        }
Example #3
0
        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));
        }