1
/***************************************************************************
2
* Copyright (C) 2007 by Shawn Starr <shawn.starr@rogers.com> *
4
* This program is free software; you can redistribute it and/or modify *
5
* it under the terms of the GNU General Public License as published by *
6
* the Free Software Foundation; either version 2 of the License, or *
7
* (at your option) any later version. *
9
* This program is distributed in the hope that it will be useful, *
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12
* GNU General Public License for more details. *
14
* You should have received a copy of the GNU General Public License *
15
* along with this program; if not, write to the *
16
* Free Software Foundation, Inc., *
17
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
18
***************************************************************************/
21
#include "weather_formula.h"
23
WeatherFormula::WeatherFormula()
27
WeatherFormula::~WeatherFormula()
31
float WeatherFormula::celsiusToF(float temperature) const
33
return (temperature * 9 / 5 + 32);
36
float WeatherFormula::fahrenheitToC(float temperature) const
38
return (temperature - 32) * 5 / 9;
41
float WeatherFormula::milesToKM(float miles) const
43
return (1.609344 * miles);
46
float WeatherFormula::kilometersToMI(float km) const
48
return (0.621371192 * km);
51
float WeatherFormula::kilopascalsToInches(float kpa) const
53
return ((0.02952997 * kpa) * 10);
56
float WeatherFormula::inchesToKilopascals(float inches) const
58
return (inches * 3.386389);
61
float WeatherFormula::centimetersToIN(float cm) const
63
return (cm * 0.393700787);
66
float WeatherFormula::inchesToCM(float inch) const
71
float WeatherFormula::millimetersToIN(float mm) const
73
return (mm * 0.0393700787);
76
float WeatherFormula::inchesToMM(float inch) const
81
float WeatherFormula::kilometersToMS(float km) const
83
return (km * 0.277778);
86
float WeatherFormula::milesToMS(float miles) const
88
return (miles * 0.44704);