Defines the class for physical quantities.
Create a new instance of a quantity.
The value of the quantity
The units attached to the value
Readonly
Convert this quantity to another set of units. Will throw an error if dimensions do not match.
The unit to convert to
An equivalent quantity with new units
Determine whether the dimensions of this quantity matches the input object.
Another quantity, unit, attribute, or dimension
True if the dimensions match, false otherwise
Subtract another quantity from this one and return the difference.
Another quantity of like dimensions
The difference, with the units of the first quantity
Divide this quantity by another and return the quotient.
Another quantity (any dimension)
An optional exponent to apply on the other quantity
The quotient, with combined units (some may cancel)
Add this quantity to another and return the sum.
The sum, with the units of the first quantity
Raise this quantity to an exponent and return the power.
The exponent to raise this unit to
The power, with appropriate units
Multiply this quantity by a constant scalar factor and return the result.
Any scalar value
A scaled quantity with the same units
Multiply this quantity by another and return the product.
The product, with combined units (some may cancel)
Generate valid LaTeX code representing this quantity.
A valid LaTeX equation
Defines the class for physical quantities.