MMOframework
Pourquoi l'IA Playground Bibliothèques Documentation Rechercher Agence
FR EN
Index

UnitVector

MMO\math\helpers · 1 symbole · générée le 27 Oct 2026

class

UnitVector

UnitVector.php:14

Represent a unit with its power and its factor: {factor} * ({unit}^{power})

class MMO\math\helpers\UnitVector implements Stringable, MMO\math\interfaces\iWithUnits
Espace de noms
MMO\math\helpers
Implémente
Stringable, iWithUnits

Index

factor
power
unit
divideBy($factor)
getFactor()
hasUnits()Usefull for polynome to determine if variable (number) has units
isConstant()
isCustom()
isPrimitive()
isSameUnits($unit, $checkPower)
isTime()
multiplyBy($factor)
name()
numberValue()Get the value of this vector.
powerBy($power)
toNumber()
toPrimitives()
unitFactor($unit)
units()Transform this vector into Units Warning: for polynome units, the number's units ius returned
__construct($unit, $power, $factor)
__toString()

Propriétés3

factor

float $factor
Type
float

power

float $power
Type
float

unit

MMO\math\interfaces\iUnit|string $unit
Type
iUnit | string

Méthodes18

hasUnits()

UnitVector.php:36

Usefull for polynome to determine if variable (number) has units

function hasUnits(): bool
retournebool

isSameUnits($unit, $checkPower)

UnitVector.php:118
function isSameUnits( MMO\math\interfaces\iUnit|MMO\math\helpers\Units|self|string $unit, bool $checkPower = true ): bool
$unitiUnit | Units | self | string
$checkPower = truebool
retournebool

numberValue()

UnitVector.php:72

Get the value of this vector.

function numberValue(): int|float|nullUsed by polynome when the unit is a UnitNumber
retourneint | float | null

units()

UnitVector.php:45

Transform this vector into Units Warning: for polynome units, the number's units ius returned

function units(): ?MMO\math\helpers\Units
retournenull | Units

__construct($unit, $power, $factor)

UnitVector.php:20
function __construct( MMO\math\interfaces\iUnit|string $unit, float $power = 1.0, MMO\math\enums\cPrefix|float $factor = 1.0 )
$unitiUnit | string
$power = 1.0float
$factor = 1.0cPrefix | float