Exemple #1
0
 public StatisticInfo CalculateWindSpeedStatisticInfo(int countAcc, WeatherInfo weatherInfo)
 {
     UpdateMinMaxValue(weatherInfo.windInfo.windSpeed);
     _accSpeedValue += weatherInfo.windInfo.windSpeed;
     return(new StatisticInfo("wind speed")
     {
         MaxValue = _maxSpeedValue,
         MinValue = _minSpeedValue,
         AverageValue = _accSpeedValue / countAcc
     });
 }
Exemple #2
0
 public StatisticInfo CalculateWindDirectionStatisticInfo(int countAcc, WeatherInfo weatherInfo)
 {
     _accYValue += Math.Sin(weatherInfo.windInfo.windDirection * (Math.PI / 180)) * weatherInfo.windInfo.windSpeed;
     _accXValue += Math.Cos(weatherInfo.windInfo.windDirection * (Math.PI / 180)) * weatherInfo.windInfo.windSpeed;
     return(new StatisticInfo("wind direction")
     {
         MaxValue = null,
         MinValue = null,
         AverageValue = GetAverangeDirectionFromVector(countAcc)
     });
 }