Un-average temperatures!

Python, 63 bytes

def f(a):x=(a+183.205)*5/7;m=x*9/5;return x-273.15,m-459.67,x,m

a is the average, returns a tuple of the results as (celsius, fahrenheit, kelvin, rankine)

Math involved:

kelvin = x
celsius = x - 273.15
fahrenheit = x * 9/5 - 459.67
rankine = x * 9/5

a = (x + x - 273.15 + x * 9/5 - 459.67 + x * 9/5) / 4 = x * 7/5 - 183.205
x = (a + 183.205) * 5/7

JavaScript (ES6), 49 bytes

f=
a=>[a=(a-199.205)/1.4,a+=273.15,a*=1.8,a-=459.67]
<input oninput=f(this.value).map(function(x,i){o.rows[i].cells[1].textContent=x})>
<table id=o>
<tr><th>Celsius:</th><td></td></tr>
<tr><th>Kelvin:</th><td></td></tr>
<tr><th>Rankine:</th><td></td></tr>
<tr><th>Fahrenheit:</th><td></td></tr>
</table>


Pyth, 40 37 36 bytes

-BJ+c36641 280c*5Q7 273.15-B*J1.8 459.67
-BJc+916.025*5Q7 273.15-B*J1.8 459.67
-BJc+916.025*5Q7 273.15-B*1.8J459.67

Try it online!

Specs

  • Input: 100
  • Output: [Kelvin, Celcius]\n[Rankine, Fahrenheit]

Math

kelvin = (average*5+916.025)/7

Tags:

Math

Code Golf