From de7ce1dd45661e3f366b6fc988626420f686604c Mon Sep 17 00:00:00 2001 From: Kenneth van Ewijk Date: Mon, 13 Oct 2014 14:34:41 +0200 Subject: [PATCH] Changed to avarage windspeed --- Calculator.java | 7 +++++-- Measurement.java | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Calculator.java b/Calculator.java index 24dc9f2..a34e148 100644 --- a/Calculator.java +++ b/Calculator.java @@ -157,9 +157,12 @@ public class Calculator { //windchill in graden Celcius //Janco en Keneth - public static double windChill(short gradenFahrenheit, short mijlPerUur) + public static double windChill(short grdnFh, short mph) { - short windChill = (short) (35.74 + (0.6215*gradenFahrenheit) - 35.75*Math.pow(mijlPerUur, 0.16) + 0.4275*gradenFahrenheit*Math.pow(mijlPerUur, 0.16)); + double gradenFahrenheit = grdnFh; + double mijlPerUur = mph; + double windChill2 = (35.74 + (0.6215*gradenFahrenheit) - 35.75*Math.pow(mijlPerUur, 0.16) + 0.4275*gradenFahrenheit*Math.pow(mijlPerUur, 0.16)); + short windChill = (short) windChill2; return temperatuur(windChill); } diff --git a/Measurement.java b/Measurement.java index de7f7a3..9baedec 100644 --- a/Measurement.java +++ b/Measurement.java @@ -110,7 +110,7 @@ public class Measurement public String getSunset () { return Calculator.sunSet(sunset); }; // windChill - public double getWindChill () { return round(Calculator.windChill(outsideTemp, windSpeed),2); }; + public double getWindChill () { return round(Calculator.windChill(outsideTemp, avgWindSpeed),2); }; // heatIndex public double getHeatIndex () { return round(Calculator.heatIndex(outsideHum, outsideTemp),0); };