Documentation

ToKelvin extends TemperatureFormula

Formula to convert Celsius values to Kelvin.

Tags
version
1.0.0
since
0.8.1
author

Jordan Brauer 18744334+jordanbrauer@users.noreply.github.com

Table of Contents

FORMULA_STRING  = 'K = °C + 273.15'
FORMULA_TEMPLATE  = '%s K = %s°C + 273.15'
MAGIC_NUMBER  = 273.15
ZERO_C_TO_K  = 273.15
The value of absolute zero degrees Celsius in Kelvin. Useful for converting Kelvin values.
$calculator  : CalculatorInterface
The calculator to run the formula through.
$values  : array<string|int, mixed>
A one-dimensional array of values to plug into the formula template when this formula is casted to a string.
__construct()  : self
Public constructor method.
__toString()  : string
Return the string representation of this object.
describe()  : mixed
{@inheritDoc}
setCalculator()  : FormulaInterface
Explicitly sets the calculator for a formula.
fahrenheit()  : int|float|string
A common method for fahrenheit conversions.
plugVariables()  : void
Set the values (passed _**in order**_) to be used for the template for logging a complete version of the formula.

Constants

FORMULA_STRING

public mixed FORMULA_STRING = 'K = °C + 273.15'

FORMULA_TEMPLATE

public mixed FORMULA_TEMPLATE = '%s K = %s°C + 273.15'

MAGIC_NUMBER

public mixed MAGIC_NUMBER = 273.15

ZERO_C_TO_K

The value of absolute zero degrees Celsius in Kelvin. Useful for converting Kelvin values.

public mixed ZERO_C_TO_K = 273.15

Properties

$values

A one-dimensional array of values to plug into the formula template when this formula is casted to a string.

protected array<string|int, mixed> $values = []

Methods

__toString()

Return the string representation of this object.

public __toString() : string
Return values
string

describe()

{@inheritDoc}

public describe(mixed $value, mixed $fromUnits, mixed $toUnits[, int $precision = null ]) : mixed
Parameters
$value : mixed
$fromUnits : mixed
$toUnits : mixed
$precision : int = null
Return values
mixed

fahrenheit()

A common method for fahrenheit conversions.

protected final fahrenheit(int|float|string $value, int $precision, string $polarity) : int|float|string
Parameters
$value : int|float|string
$precision : int
$polarity : string

A valid calculator method for positive/negative operations.

Return values
int|float|string

plugVariables()

Set the values (passed _**in order**_) to be used for the template for logging a complete version of the formula.

protected plugVariables(mixed ...$variables) : void
Parameters
$variables : mixed

A variadic set of arguments, passed in order to fill the template with.

Return values
void

Search results