The names of the types follow the following convention. They are composed
by four parts, one for each dimension. Each part, in turn, is composed
of two subparts, a distinctive letter and a representation
of the exponent for this dimension, as follows.
- m exponent for length
- k exponent for mass
- s exponent for time
- a exponent for electric charge
where exponents are prefixed by '_' instead of '-' if they are negative.
For example, type
m_2k0s1a0 represents dimension
L-2T.
Some types have more conventional names. The current such list is shown
in the sidebar. Note that only those types that are inside the bounds
set when the library was generated will be found in it.
The standard download offers types that exist between the following bounds:
- length between -2 and 2, inclusive
- mass between -1 and 1, inclusive
- time between -2 and 1, inclusive
- electric charge between -1 and 1, inclusive
There is a slight bias in favor of mechanics, which means that some
interesting types in electromagnetics are not inside the library. This was
inevitable, in order to keep the size of the library under control
If one wishes a different set of types, one can generate it with a different
set of bounds, and even include other dimensions I left out, like temperature.
Operations that are implemented are:
- multiplication by numbers (doubles)
- addition and subtraction of same types
- multiplication and division where the other type and the resulting type
both exist in the library
The types have an operation to return a string that represents the
correspoding units of measurement. Where available, specific units are
used. For example, instead of
m·kg·s-2, one will see
N (Newton). The current such list is shown in the sidebar.
Types implement interface
DimensionedValue. Its precise
definition of it is bound to change, but currently it offers the following operations:
- retrieve value as double
- retrieve exponent of any dimension
- retrieve units as a string
- find out if the units is a derived unit (see sidebar)
The library for C# corresponds to an assembly containing all the types.
The types themselves are structs that define operator overloads
for arithmetic operations and conversions to double. All types
are in namespace Dimenso.
The library for Java corresponds to a JAR containing all the types.
The types themselves are classes that define operations as methods,
with the same names as the corresponding operations of BigDecimal.
All types are in package org.dimenso.