Skip to content

Dimension

Dimension is a family of monovalue types representing equivalence classes of units. Each class defines a collection of units which can be meaningfully added, subtracted, and compared with each other. Familiar examples of Dimension include length, time, temperature, speed, and so on.

Dimensions form a vector space. We choose certain “base dimensions” as the basis vectors for this space. As with other vector spaces in our library, Dimension values can be multiplied, divided, and raised to (rational) powers, and this arithmetic always takes place at compile time.

Dimension is an implementation detail. Most end users will never name dimensions in their code, and never see them in their compiler errors. Instead, users will work with units, which each carry their own dimension information. The main situation where an end user would use Dimension directly is to define the first unit for a novel base dimension.

Included base dimensions

Au includes the following base dimensions:

  • Length
  • Mass
  • Time
  • Current
  • Temperature
  • Angle
  • Information
  • AmountOfSubstance
  • LuminousIntensity

These comprise each of the seven base dimensions in the SI, with the addition of Angle and Information.