ronaldkwandy

Untitled

Jul 10th, 2019
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Celcius.js
  2. export class Celcius {
  3.     static order = 0;
  4.     static toFahrenheit = (celcius = 1) => {
  5.         return (celcius * 9 / 5) + 32;
  6.     }
  7.     static toKelvin = (celcius = 1) => {
  8.         return celcius + 273.15;
  9.     }
  10. }
  11.  
  12. // Kelvin.js
  13. export class Kelvin {
  14.     static order = 2;
  15.     static toFahrenheit = (kelvin = 1) => {
  16.         return ((kelvin - 273.15) * 9 / 5) + 32;
  17.     }
  18.     static toCelcius = (kelvin = 1) => {
  19.         return kelvin - 273.15;
  20.     }
  21. }
  22.  
  23. // Fahrenheit.js
  24. export class Fahrenheit {
  25.     static order = 1;
  26.     static toKelvin = (fahrenheit = 1) => {
  27.         return ((fahrenheit - 32) * 5 / 9) + 273.15;
  28.     }
  29.     static toCelcius = (fahrenheit = 1) => {
  30.         return (fahrenheit - 32) * 5 / 9;
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment