Class: Toji::Swvp::Sonntag
- Inherits:
-
Object
- Object
- Toji::Swvp::Sonntag
- Includes:
- Singleton, Base
- Defined in:
- lib/toji/swvp/sonntag.rb
Overview
Sonntagの式
Constant Summary collapse
- A =
-6096.9385- B =
21.2409642- C =
2.711193 * 10**-2
- D =
1.673852 * 10**-5
- E =
2.433502
Instance Method Summary collapse
Instance Method Details
#calc(temp) ⇒ Object
17 18 19 20 |
# File 'lib/toji/swvp/sonntag.rb', line 17 def calc(temp) temp = temp.to_f (Math.exp(A * ((temp + 273.15)**-1) + B - C * (temp + 273.15) + D * ((temp + 273.15)**2) + E * Math.log(temp + 273.15))) / 100 end |