Averages/Mean time of day: Difference between revisions
→{{header|AutoHotkey}}
m (→{{header|C#}}: Changing the section header so that task shows up under the language properly) |
|||
Line 11:
=={{header|AutoHotkey}}==
{{works with|
<lang AutoHotkey>MsgBox, % "The mean time is: " MeanTime(["23:00:17", "23:40:20", "00:12:45", "00:17:19"])
MeanTime(t, x=0, y=0) {
static c := ATan(1) / 45
for k, v in t {
n := StrSplit(v, ":")
}
r := atan2(x, y) / c
r := (r < 0 ? r + 360 : r) / 15
Line 31 ⟶ 32:
atan2(x, y) {
return dllcall("msvcrt\atan2", "Double",y, "Double",x, "CDECL Double")
}</lang>
{{out}}
<pre>The mean time is: 23:47:43</pre>
|