physical library

Default suggested library containing all core functionality and dimension-specific Quantity types.

Classes

AnonymousUnit
An anonymous Unit with no specific name or symbol.
DerivedUnit
A Unit derived from some combination of other units.
Dimensions
Representation of the nature of a physical quantity, defined as a map of base Dimension to their exponents.
Magnitude
A Unit representing a pure numerical/dimensionless magnitude.
NamedUnit
A known Unit with a specific name and symbol.
Quantity
An immutable numerical quantity with an associated Unit.
QuantityOrigin
An origin point for a QuantityPoint, representing a Quantity away from the absolute zero point.
QuantityPoint
A immutable Quantity relative to a QuantityOrigin.
QuantityPointOrOrigin
Common interface for QuantityPoint and QuantityOrigin.
SiNamedUnit
A known Unit with a specific name and symbol that can be prefixed with SI prefixes.
Unit
Representation of a physical unit, including its underlying Dimensions and a scale factor relative to the SI-MKS base units.

Enums

Dimension
Base physical dimensions.

Functions

numToScalar(Object value) Quantity
Converts raw num values to Quantity scalars, or passes through Quantity objects.
qty(num value, Unit unit) Quantity
Convenience function for creating a Quantity
scalarToNum(Object value) num
Converts scalar Quantity objects to raw num values, or passes through num values.

Exceptions / Errors

DimensionsException
Thrown when an attempt is made to perform an operation on a Quantity with mismatched Dimensions.
QuantityException
Base class for all exceptions thrown in relation to quantities.