Watchmaker Wiki

The ultimate watch maker for Android Wear!

User Tools

Site Tools


tips:windchill

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tips:windchill [2015/01/26 22:49] – [Examples] jt3tips:windchill [2015/01/27 20:59] (current) jt3
Line 1: Line 1:
-====== Caclulating Wind Chill ======+====== Calculating Wind Chill ====== 
 + 
 +Wind-chill is the perceived decrease in air temperature felt by the body on exposed skin due to the flow of air. So this tells you how cold a day "feels".
  
 ===== Examples ===== ===== Examples =====
  
 ====Fahrenheit==== ====Fahrenheit====
-   Text:  ({wt}<80 and {wt} or {wh}<40 and {wt} or math.floor(-42.379+(2.04901523*{wt})+(10.14333127*{wh})+(-0.22475541*{wt}*{wh})+(-.00683783*({wt}^2))+(-.05481717*({wh}^2))+(.00122874*{wh}*({wt}^2))+(.00085282*{wt}*({wh}^2))+(-.00000199*({wt}^2)*({wh}^2))+.5)) .. "ᵒF" 
  
 +   Text:  ({wt}>50 and {wt} or {wws}<3.1 and {wt} or math.floor(35.74+(0.6215*{wt})-(35.75*({wws}^0.16))+(0.4275*({wt}*({wws}^0.16)))+.5)) .. "ᵒF"
  
-===== Examples ===== 
-Yeah right... you expect me to explain all that?!?  Okay, okay, I'll try my best. 
- 
-The example shows the text field of a text object displaying Heat Index in the following format:  129ᵒF 
- 
-This is done by first calculating heat index using the current temperature ({wt}) and the current humidity ({wh}).   
- 
-Once we've done the calculation, we need to concatenate the "ᵒF" or "ᵒC" to the formula.  To do this, we need to fool LUA into thinking that we're dealing exclusively with strings (for some stupid reason... LUA isn't the smartest of languages sometimes).  We do this by encapsulating the entire formula within a single set of parentheses.  So, yes, the first and last parentheses **are** required.  Then, we simply add the concatenation symbol ".." followed by the desired display in quotes ("ᵒF" or even just "ᵒ").  Just be sure to include a single space on either side of the concatenation symbol. 
- 
-I'm sure some of you are wondering why I didn't include a Celsius formula.  The reason is simple.  I couldn't find a formula for Celsius!  I'm guessing that nobody wanted to duplicate that madness for another temperature scale, so they just do it in Fahrenheit, and convert the result to Celsius using the standard Fahrenheit to Celsius conversion formula of (F-32)*5/9. 
-====Fahrenheit==== 
-   Text:  ({wt}>50 and {wt} or {wws}<3.1 and {wt} or math.floor(35.74+(0.6215*{wt})-(35.75*({wws}^0.16))+(0.4275*({wt}*({wws}^0.16)))+.5)) .. "ᵒF" 
-    
 ====Celsius==== ====Celsius====
    Text:  ({wt}>10 and {wt} or {wws}<3.1 and {wt} or math.floor(13.12+(0.6215*{wt})-(11.37*(({wws}*1.61)^0.16))+(0.3965*({wt}*(({wws}*1.61)^0.16)))+.5)) .. "ᵒC"    Text:  ({wt}>10 and {wt} or {wws}<3.1 and {wt} or math.floor(13.12+(0.6215*{wt})-(11.37*(({wws}*1.61)^0.16))+(0.3965*({wt}*(({wws}*1.61)^0.16)))+.5)) .. "ᵒC"
-   +
 ===== Explanation ===== ===== Explanation =====
 The examples show the text fields of a text object displaying wind chill in the following formats:  12ᵒF or 1ᵒC The examples show the text fields of a text object displaying wind chill in the following formats:  12ᵒF or 1ᵒC
  
-This is done by first calculating wind chill using the current temperature ({wt}) and the wind speed in MPH ({wws}).  Please note that while WatchMaker says it's outputting wind speed in Meters per Second (mps), it's **always** shown in MPH.  Thus, we must also convert that to Km/h in the Celsius formula.+This is done by first calculating wind chill using the current temperature ({wt}) and the wind speed in MPH ({wws}).  Please note that while WatchMaker says it's outputting wind speed in Meters per Second (mps), it's **always** shown in MPH.  Thus, we must also convert that to Km/h in the Celsius formula.  Also note that Wind Chill is only calculated if the temperature is equal to or less than 50ᵒF (10ᵒC) and wind speed is greater than 3 MPH.
  
 Once we've done the calculation, we need to concatenate the "ᵒF" or "ᵒC" to the formula.  To do this, we need to fool LUA into thinking that we're dealing exclusively with strings (for some stupid reason... LUA isn't the smartest of languages sometimes).  We do this by encapsulating the entire formula within a single set of parentheses.  So, yes, the first and last parentheses **are** required.  Then, we simply add the concatenation symbol ".." followed by the desired display in quotes ("ᵒF", "ᵒC", or even just "ᵒ").  Just be sure to include a single space on either side of the concatenation symbol. Once we've done the calculation, we need to concatenate the "ᵒF" or "ᵒC" to the formula.  To do this, we need to fool LUA into thinking that we're dealing exclusively with strings (for some stupid reason... LUA isn't the smartest of languages sometimes).  We do this by encapsulating the entire formula within a single set of parentheses.  So, yes, the first and last parentheses **are** required.  Then, we simply add the concatenation symbol ".." followed by the desired display in quotes ("ᵒF", "ᵒC", or even just "ᵒ").  Just be sure to include a single space on either side of the concatenation symbol.
tips/windchill.1422312555.txt.gz · Last modified: 2015/01/26 22:49 by jt3