コード例 #1
0
        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));
        }
コード例 #2
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);
        }
コード例 #3
0
        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);
        }
コード例 #4
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));
        }