Elex.Dimension (Elex v0.4.2)

View Source

A category formula as a canonical monomial of category atoms.

Validate returns this for unitful results (category atoms → exponents). All-base formulas store base category atoms (length | time, length^2, length | mass * time^2). A formula that names a derived category stores that atom (volume | length). Inspect uses the same formula language as units.

Fields

  • :monomial - A map of category atoms to integer exponents. A key may name a base category or a derived category.

Examples

%Elex.Dimension{monomial: %{length: 1}}
%Elex.Dimension{monomial: %{length: 1, time: -1}}
%Elex.Dimension{monomial: %{volume: 1, length: -1}}

Summary

Types

A monomial of category atoms to integer exponents. A key may name a base category or a derived category.

t()

A category formula as a canonical monomial.

Functions

Formats the category formula (length | time, length^2).

Types

monomial()

@type monomial() :: %{optional(atom()) => integer()}

A monomial of category atoms to integer exponents. A key may name a base category or a derived category.

t()

@type t() :: %Elex.Dimension{monomial: monomial()}

A category formula as a canonical monomial.

Functions

formula(dimension)

@spec formula(t()) :: String.t()

Formats the category formula (length | time, length^2).

An empty monomial is number.