Class TemperatureConversion


  • public class TemperatureConversion
    extends Object
    • Constructor Detail

      • TemperatureConversion

        public TemperatureConversion()
    • Method Detail

      • convert

        public static double convert​(TemperatureScale from,
                                     TemperatureScale to,
                                     double temperature)
        Convert a temperature value from one temperature scale to another.
        Parameters:
        from - TemperatureScale
        to - TemperatureScale
        temperature - value
        Returns:
        converted temperature value in the requested to scale
      • convertFromFarenheit

        public static double convertFromFarenheit​(TemperatureScale to,
                                                  double temperature)
        Convert a temperature value from the Farenheit temperature scale to another.
        Parameters:
        to - TemperatureScale
        temperature - value in degrees Farenheit
        Returns:
        converted temperature value in the requested to scale
      • convertToFarenheit

        public static double convertToFarenheit​(TemperatureScale from,
                                                double temperature)
        Convert a temperature value from another temperature scale into the Farenheit temperature scale.
        Parameters:
        from - TemperatureScale
        temperature - value from other scale
        Returns:
        converted temperature value in degrees Farenheit
      • convertFromCelsius

        public static double convertFromCelsius​(TemperatureScale to,
                                                double temperature)
        Convert a temperature value from the Celsius temperature scale to another.
        Parameters:
        to - TemperatureScale
        temperature - value in degrees centigrade
        Returns:
        converted temperature value in the requested to scale
      • convertToCelsius

        public static double convertToCelsius​(TemperatureScale from,
                                              double temperature)
        Convert a temperature value from another temperature scale into the Celsius temperature scale.
        Parameters:
        from - TemperatureScale
        temperature - value from other scale
        Returns:
        converted temperature value in degrees centigrade
      • convertFromKelvin

        public static double convertFromKelvin​(TemperatureScale to,
                                               double temperature)
        Convert a temperature value from the Kelvin temperature scale to another.
        Parameters:
        to - TemperatureScale
        temperature - value in Kelvin
        Returns:
        converted temperature value in the requested to scale
      • convertToKelvin

        public static double convertToKelvin​(TemperatureScale from,
                                             double temperature)
        Convert a temperature value from another temperature scale into the Kelvin temperature scale.
        Parameters:
        from - TemperatureScale
        temperature - value from other scale
        Returns:
        converted temperature value in Kelvin
      • convertFromRankine

        public static double convertFromRankine​(TemperatureScale to,
                                                double temperature)
        Convert a temperature value from the Rankine temperature scale to another.
        Parameters:
        to - TemperatureScale
        temperature - value in degrees Rankine
        Returns:
        converted temperature value in the requested to scale
      • convertToRankine

        public static double convertToRankine​(TemperatureScale from,
                                              double temperature)
        Convert a temperature value from another temperature scale into the Rankine temperature scale.
        Parameters:
        from - TemperatureScale
        temperature - value from other scale
        Returns:
        converted temperature value in degrees Rankine
      • convertFarenheitToCelsius

        public static double convertFarenheitToCelsius​(double temperature)
        Convert temperature from Farenheit to Celsius temperature scale FORMULA = [°C] = ([°F] − 32) × 5/9
        Parameters:
        temperature - value in degrees Farenheit
        Returns:
        converted temperature value in degrees Celsius
      • convertFarenheitToKelvin

        public static double convertFarenheitToKelvin​(double temperature)
        Convert temperature from Farenheit to Kelvin temperature scale FORMULA = [K] = ([°F] + 459.67) × 5/9
        Parameters:
        temperature - value in degrees Farenheit
        Returns:
        converted temperature value in degrees Kelvin
      • convertFarenheitToRankine

        public static double convertFarenheitToRankine​(double temperature)
        Convert temperature from Farenheit to Rankine temperature scale FORMULA = [°R] = [°F] + 459.67
        Parameters:
        temperature - value in degrees Farenheit
        Returns:
        converted temperature value in degrees Rankine
      • convertCelsiusToFarenheit

        public static double convertCelsiusToFarenheit​(double temperature)
        Convert temperature from Celsius to Farenheit temperature scale FORMULA = [°F] = [°C] × 9/5 + 32
        Parameters:
        temperature - value in degrees Celsius
        Returns:
        converted temperature value in degrees Farenheit
      • convertCelsiusToKelvin

        public static double convertCelsiusToKelvin​(double temperature)
        Convert temperature from Celsius to Kelvin temperature scale FORMULA = [K] = [°C] + 273.15
        Parameters:
        temperature - value in degrees Celsius
        Returns:
        converted temperature value in degrees Kelvin
      • convertCelsiusToRankine

        public static double convertCelsiusToRankine​(double temperature)
        Convert temperature from Celsius to Rankine temperature scale FORMULA = [°R] = ([°C] + 273.15) × 9/5
        Parameters:
        temperature - value in degrees Celsius
        Returns:
        converted temperature value in degrees Rankine
      • convertKelvinToCelsius

        public static double convertKelvinToCelsius​(double temperature)
        Convert temperature from Kelvin to Celsius temperature scale FORMULA = [°C] = [K] − 273.15
        Parameters:
        temperature - value in degrees Kelvin
        Returns:
        converted temperature value in degrees Celsius
      • convertKelvinToFarenheit

        public static double convertKelvinToFarenheit​(double temperature)
        Convert temperature from Kelvin to Farenheit temperature scale FORMULA = [°F] = [K] × 9/5 − 459.67
        Parameters:
        temperature - value in degrees Kelvin
        Returns:
        converted temperature value in degrees Farenheit
      • convertKelvinToRankine

        public static double convertKelvinToRankine​(double temperature)
        Convert temperature from Kelvin to Rankine temperature scale FORMULA = [°R] = [K] × 9/5
        Parameters:
        temperature - value in degrees Kelvin
        Returns:
        converted temperature value in degrees Rankine
      • convertRankineToFarenheit

        public static double convertRankineToFarenheit​(double temperature)
        Convert temperature from Rankine to Farenheit temperature scale FORMULA = [°F] = [°R] − 459.67
        Parameters:
        temperature - value in degrees Rankine
        Returns:
        converted temperature value in degrees Farenheit
      • convertRankineToCelsius

        public static double convertRankineToCelsius​(double temperature)
        Convert temperature from Rankine to Celsius temperature scale FORMULA = [°C] = ([°R] − 491.67) × 5/9
        Parameters:
        temperature - value in degrees Rankine
        Returns:
        converted temperature value in degrees Celsius
      • convertRankineToKelvin

        public static double convertRankineToKelvin​(double temperature)
        Convert temperature from Rankine to Kelvin temperature scale FORMULA = [K] = [°R] × 5/9
        Parameters:
        temperature - value in degrees Rankine
        Returns:
        converted temperature value in degrees Kelvin