Safe Flexibility
Table of Contents
Benefits
 Faster Development
 Cleaner Code

Safe Flexibility
100% Customizable
unitsofmeasure takes a novel, metaprogramming approach to the problem of typesafe dimensional analysis. Because the DSL is autogenerated, unitsofmeasure works great for all engineering and scientific applications.
With just the tweak of a config file, unitsofmeasure can represent any unit or quantity.
Typesafe Math Library
For even greater safety and ease of use, unitsofmeasure ships with a typesafe superset of the kotlin.math
library.
This means, for example, that unitsofmeasure can track units & dimensions even across complex trigonometric expressions.
Lets write a function that uses the law of cosines to solve for m∠C.
Strong Support for Generic Programming
unitsofmeasure allows you to define relationships between quantities at the type level. All you have to do is pass a “proof” (::p
).
Technical Note: “Proof passing” is a novel technique which leverages Kotlin’s type inference and method overloading capabilities. It allows dimensional relationships to be used as bounds for UOM type parameters.
This means, for example, that we can write generic integration, differentiation, & stdev utilities.
Generic Integrator
Generic Differentiator
Generic Standard Deviation Calculator
‹ Benefit: Cleaner Code Install ›