UnitVector
MMO\math\helpers · 1 symbol · generated 30 Sep 2026
Represent a unit with its power and its factor: {factor} * ({unit}^{power})
class MMO\math\helpers\UnitVector
implements Stringable,
MMO\math\interfaces\iWithUnits- Namespace
MMO\math\helpers- Implements
- Stringable, iWithUnits
Properties3
float $factor- Type
- float
float $power- Type
- float
MMO\math\interfaces\iUnit|string $unit- Type
- iUnit | string
Methods18
function divideBy(
MMO\math\interfaces\iUnit|self|MMO\math\helpers\Units|string|int|float $factor
): self|MMO\math\helpers\Unitsfunction getFactor(): floatUsefull for polynome to determine if variable (number) has units
function hasUnits(): boolfunction isConstant(): boolfunction isCustom(): boolfunction isPrimitive(): boolfunction isSameUnits(
MMO\math\interfaces\iUnit|MMO\math\helpers\Units|self|string $unit,
bool $checkPower = true
): boolfunction isTime(): boolfunction multiplyBy(
MMO\math\interfaces\iUnit|self|MMO\math\helpers\Units|string|int|float $factor
): self|MMO\math\helpers\Unitsfunction name(): stringGet the value of this vector.
function numberValue(): int|float|nullUsed by polynome when the unit is a UnitNumberfunction powerBy(float $power): selffunction toNumber(): MMO\math\operations\ArithmeticOperation|MMO\math\helpers\Number|floatfunction toPrimitives(): arrayfunction unitFactor(MMO\math\interfaces\iUnit|string|null $unit = null): MMO\math\operations\ArithmeticOperation|MMO\math\helpers\Number|floatTransform this vector into Units Warning: for polynome units, the number's units ius returned
function units(): ?MMO\math\helpers\Unitsfunction __construct(
MMO\math\interfaces\iUnit|string $unit,
float $power = 1.0,
MMO\math\enums\cPrefix|float $factor = 1.0
)function __toString(): string