Main
Vectors
Matrix
Matrix Manipulation
Transformation Matrices
Angles
Random
Bezier Curve
Equations
Path Movement
Color
Linear Interpolation
Derivatives
Collision Detection
Animation
Circle And Ellipse
Sequence
Combinatorics
Other

Temperature Conversions

These functions allow conversion between different temperature scales. They accept a temperature value in one scale and return the equivalent temperature in another scale, with optional rounding to a specified number of decimal places.

import { celsiusToFahrenheit } from 'mz-math';

const fahrenheit = celsiusToFahrenheit(0); // 32

const fahrenheitRoundedTo2 = celsiusToFahrenheit(32.698034, 2); // 90.86;
import { celsiusToKelvin } from 'mz-math';

const kelvin = celsiusToKelvin(-273.15); // 0
import { fahrenheitToCelsius } from 'mz-math';

const celsius = fahrenheitToCelsius(32); // 0
import { fahrenheitToKelvin } from 'mz-math';

const kelvin = fahrenheitToKelvin(32); // 273.15
import { kelvinToCelsius } from 'mz-math';

const celsius = kelvinToCelsius(273.15); // 0
import { kelvinToFahrenheit } from 'mz-math';

const fahrenheit = kelvinToFahrenheit(273.15); // 32