# Derived dimensions

DimensionfulAngles.jl also defines derived dimensions that include angle. These are:

This allows, among other things, dispatching on these derived dimensions.

Several units are defined for these derived dimensions, including the steradian for solid angle and RPM for angular velocity.

DimensionfulAngles.jl also provides Periodic a UnitfulEquivalences.jl Equivalence to convert between period, frequency, and angular frequency of a periodic response.

## Solid Angle

Solid angle is a two-dimensional angle subtended at a point. In the SI system it has units of $m²/m²=1$ and is non-dimensional. Here, following several proposed systems, it has dimensions of angle squared, 𝐀². See Relation to proposed SI extensions. The SI unit of solid angle is the steradian, which here is defined as $sr=rad²$. The steradian takes SI prefixes and therefore defines many other units (e.g., the millisteradian DimensionfulAngles.msrᵃ). These are documented in Prefixed units.

DimensionfulAngles.SolidAngleType
DimensionfulAngles.SolidAngle{T, U}

A supertype for quantities and levels of dimension 𝐀 * 𝐀 with a value of type T and units U.

See also: Unitful.Quantity, Unitful.Level.

DimensionfulAngles.srᵃConstant
srᵃ

The steradian, a unit of spherical angle.

There are 4π sr in a sphere. The steradian is the SI unit of solid angle. Unlike Unitful.sr, which follows SI and is therefor dimensionless, srᵃ has dimensions of Angle squared. Accepts SI prefixes.

Dimension: 𝐀²."

## Luminous flux and illuminance

Luminous flux is a measure of perceived power of light and has dimensions of $𝐉*𝐀²$. The SI unit lumen (lm) = candela x steradian is provided as DimensionfulAngles.lmᵃ.

Illuminance is luminous flux per unit surface area and has dimensions of $𝐉*𝐀²*𝐋⁻²$. The SI unit lux (lx) = lumen / meter^2 is provided as DimensionfulAngles.lxᵃ.

DimensionfulAngles.LuminousFluxType
DimensionfulAngles.LuminousFlux{T, U}

A supertype for quantities and levels of dimension 𝐉 * 𝐀 ^ 2 with a value of type T and units U.

See also: Unitful.Quantity, Unitful.Level.

DimensionfulAngles.IlluminanceType
DimensionfulAngles.Illuminance{T, U}

A supertype for quantities and levels of dimension 𝐉 * 𝐀 ^ 2 * 𝐋 ^ -2 with a value of type T and units U.

See also: Unitful.Quantity, Unitful.Level.

DimensionfulAngles.lmᵃConstant
lmᵃ

The lumen, an SI unit of luminous flux.

Defined as 1 cd × sr. Accepts SI prefixes.

Dimension: 𝐉𝐀²."

DimensionfulAngles.lxᵃConstant
lxᵃ

The lux, an SI unit of illuminance.

Defined as 1 lm / m^2. Accepts SI prefixes.

Dimension: 𝐉𝐀²𝐋⁻²."

## Angular velocity and acceleration

Angular velocity has dimensions of angle over time 𝐀/𝐓 and can be used to measure different quantities such as rotational velocity, rotational speed, and angular frequency of a phase angle. Two units of angular velocity are defined: the revolutions per second (RPS) and the revolutions per minute (RPM), provided as DimensionfulAngles.rpsᵃ and DimensionfulAngles.rpmᵃ respectively.

Angular acceleration is the time rate of change of angular velocity and has dimensions of angle over time squared 𝐀/𝐓². No units are defined specifically for this derived dimension.

See also: Periodic.

DimensionfulAngles.AngularVelocityType
DimensionfulAngles.AngularVelocity{T, U}

A supertype for quantities and levels of dimension 𝐀 * 𝐓 ^ -1 with a value of type T and units U.

See also: Unitful.Quantity, Unitful.Level.

DimensionfulAngles.AngularAccelerationType
DimensionfulAngles.AngularAcceleration{T, U}

A supertype for quantities and levels of dimension 𝐀 * 𝐓 ^ -2 with a value of type T and units U.

See also: Unitful.Quantity, Unitful.Level.

## Angular period, wavenumber, and wavelength

Angular wavenumber has dimensions of angle over length 𝐀/𝐋 and is the spatial analogue of (temporal) angular frequency. It is used to describe responses that are periodic in space.

The angular period (dimensions of time over angle, 𝐓/𝐀) and angular wavelength (𝐋/𝐀) are define as the reciprocal of angular frequency and angular wavenumber, respectively.

No units are defined specifically for these derived dimensions.

See also: Periodic.

DimensionfulAngles.AngularWavelengthType
DimensionfulAngles.AngularWavelength{T, U}

A supertype for quantities and levels of dimension 𝐋 * 𝐀 ^ -1 with a value of type T and units U.

See also: Unitful.Quantity, Unitful.Level.

DimensionfulAngles.AngularPeriodType
DimensionfulAngles.AngularPeriod{T, U}

A supertype for quantities and levels of dimension 𝐓 * 𝐀 ^ -1 with a value of type T and units U.

See also: Unitful.Quantity, Unitful.Level.

DimensionfulAngles.AngularWavenumberType
DimensionfulAngles.AngularWavenumber{T, U}

A supertype for quantities and levels of dimension 𝐀 * 𝐋 ^ -1 with a value of type T and units U.

See also: Unitful.Quantity, Unitful.Level.

## Periodic and Dispersion equivalences

For periodic responses there are several analogous ways to measure the repeat period: period T (𝐓, s), frequency f (1/𝐓, Hz=1/s), or angular frequency ω (𝐀/𝐓, rad/s). These are related by

$f = 1/T = ω/2π$.

Analogously, spatial period and frequency are related by

$ν = 1/λ = k/2π$

between wavelength λ (𝐋, m), wavenumber ν (1/𝐋, 1/m), and angular wavenumber k (𝐀/𝐋, rad/m). Additionally an angular period and angular wavelength can be defined analogously as the reciprocal of angular frequency and angular wavenumber.

image-source: Waldir, CC BY-SA 4.0 https://creativecommons.org/licenses/by-sa/4.0, via Wikimedia Commons

DimensionfulAngles.jl provides Periodic, a UnitfulEquivalences.jl Equivalence to convert between temporal or spatial period, frequency, angular frequency, and angular period of a periodic response.

It also provides Dispersion, which extends Periodic to convert between temporal and spatial values using a specific dispersion relation (or equivalently a phase velocity as used in the image above)).

DimensionfulAngles.PeriodicType
Periodic()

Equivalence to convert between temporal or spatial period, frequency, angular frequency, and angular period.

These quantities are related by $f = ω/2π = 1/T = 1/(2πT̅)$, where

• $f$ is the (temporal) frequency,
• $ω$ is the (temporal) angular frequency,
• $T$ is the (temporal) period,
• $T̄$ is the (temporal) angular period,

and $ν = k/2π = 1/λ = 1/(2πλ̄)$, where

• $ν$ is the (spatial) frequency (linear wavenumber),
• $k$ is the (spatial) angular frequency (angular wavenumber),
• $λ$ is the (spatial) period (linear wavelength), and
• $λ̄$ is the (spatial) angular period (angular wavelength).

Example

julia> using Unitful

julia> using DimensionfulAngles

julia> uconvert(u"s", 10u"Hz", Periodic())
0.1 s

6.283185307179586 rad s⁻¹
DimensionfulAngles.DispersionType
Dispersion(; dispersion=nothing, dispersion_inverse=nothing)

Equivalence to convert between temporal and spatial frequencies using a specific dispersion relation.

This extends the Periodic() equivalence to convert between spatial and temporal quantities based on the provided dispersion relation.

Example

julia> using DimensionfulAngles, Unitful

julia> g = Unitful.gn  # gravitational acceleration
9.80665 m s⁻²

julia> deepwater = Dispersion(
dispersion = (k -> √(g*k*θ₀)), dispersion_inverse = (ω -> ω^2/(g*θ₀))
);

0.004025678249387654 rad mm⁻¹

Some dispersion relations do not have an expressible inverse. In such cases using Roots.jl might be beneficial. For example, here is how we could use the linear water wave dispersion without deep water approximation:

julia> using DimensionfulAngles, Unitful, Roots

julia> g = Unitful.gn  # gravitational acceleration
9.80665 m s⁻²

julia> k0 = (2π)u"radᵃ/m"  # initial guess: 1m wavelength

julia> h = 0.5u"m"  # water depth
0.5 m

julia> waterwaves = Dispersion(
dispersion = (k -> √(k*θ₀*g*tanh(k*h/θ₀))),
dispersion_inverse = (ω -> solve(ZeroProblem(k -> k - ω^2/(g*tanh(k*h/θ₀))/θ₀, k0)))
);

0.9823052153509486 Hz

julia> h = (Inf)u"m"  # water depth
Inf m

julia> waterwaves = Dispersion(
dispersion = ( k -> √(k*θ₀*g*tanh(k*h/θ₀)) ),
dispersion_inverse = (ω -> solve(ZeroProblem(k -> k - ω^2/(g*tanh(k*h/θ₀))/θ₀, k0)))
);

julia> uconvert(u"Hz", 0.004025678249387654u"radᵃ/mm", waterwaves) ≈ 1u"Hz"
true

## Syntax

Contents:

### Syntax provided by Unitful.jl

DimensionfulAngles.AngularVelocityUnitsType
DimensionfulAngles.AngularVelocityUnits{U}

A supertype for units of dimension 𝐀 * 𝐓 ^ -1. Equivalent to Unitful.Units{U, 𝐀 * 𝐓 ^ -1}.

See also: Unitful.Units.

DimensionfulAngles.AngularVelocityFreeUnitsType
DimensionfulAngles.AngularVelocityFreeUnits{U}

A supertype for Unitful.FreeUnits of dimension 𝐀 * 𝐓 ^ -1. Equivalent to Unitful.FreeUnits{U, 𝐀 * 𝐓 ^ -1}.

DimensionfulAngles.AngularAccelerationUnitsType
DimensionfulAngles.AngularAccelerationUnits{U}

A supertype for units of dimension 𝐀 * 𝐓 ^ -2. Equivalent to Unitful.Units{U, 𝐀 * 𝐓 ^ -2}.

See also: Unitful.Units.

DimensionfulAngles.AngularAccelerationFreeUnitsType
DimensionfulAngles.AngularAccelerationFreeUnits{U}

A supertype for Unitful.FreeUnits of dimension 𝐀 * 𝐓 ^ -2. Equivalent to Unitful.FreeUnits{U, 𝐀 * 𝐓 ^ -2}.

DimensionfulAngles.SolidAngleUnitsType
DimensionfulAngles.SolidAngleUnits{U}

A supertype for units of dimension 𝐀 * 𝐀. Equivalent to Unitful.Units{U, 𝐀 * 𝐀}.

See also: Unitful.Units.

DimensionfulAngles.SolidAngleFreeUnitsType
DimensionfulAngles.SolidAngleFreeUnits{U}

A supertype for Unitful.FreeUnits of dimension 𝐀 * 𝐀. Equivalent to Unitful.FreeUnits{U, 𝐀 * 𝐀}.

DimensionfulAngles.AngularWavenumberUnitsType
DimensionfulAngles.AngularWavenumberUnits{U}

A supertype for units of dimension 𝐀 * 𝐋 ^ -1. Equivalent to Unitful.Units{U, 𝐀 * 𝐋 ^ -1}.

See also: Unitful.Units.

DimensionfulAngles.AngularWavenumberFreeUnitsType
DimensionfulAngles.AngularWavenumberFreeUnits{U}

A supertype for Unitful.FreeUnits of dimension 𝐀 * 𝐋 ^ -1. Equivalent to Unitful.FreeUnits{U, 𝐀 * 𝐋 ^ -1}.

DimensionfulAngles.AngularPeriodUnitsType
DimensionfulAngles.AngularPeriodUnits{U}

A supertype for units of dimension 𝐓 * 𝐀 ^ -1. Equivalent to Unitful.Units{U, 𝐓 * 𝐀 ^ -1}.

See also: Unitful.Units.

DimensionfulAngles.AngularPeriodFreeUnitsType
DimensionfulAngles.AngularPeriodFreeUnits{U}

A supertype for Unitful.FreeUnits of dimension 𝐓 * 𝐀 ^ -1. Equivalent to Unitful.FreeUnits{U, 𝐓 * 𝐀 ^ -1}.

DimensionfulAngles.AngularWavelengthUnitsType
DimensionfulAngles.AngularWavelengthUnits{U}

A supertype for units of dimension 𝐋 * 𝐀 ^ -1. Equivalent to Unitful.Units{U, 𝐋 * 𝐀 ^ -1}.

See also: Unitful.Units.

DimensionfulAngles.AngularWavelengthFreeUnitsType
DimensionfulAngles.AngularWavelengthFreeUnits{U}

A supertype for Unitful.FreeUnits of dimension 𝐋 * 𝐀 ^ -1. Equivalent to Unitful.FreeUnits{U, 𝐋 * 𝐀 ^ -1}.

DimensionfulAngles.LuminousFluxUnitsType
DimensionfulAngles.LuminousFluxUnits{U}

A supertype for units of dimension 𝐉 * 𝐀 ^ 2. Equivalent to Unitful.Units{U, 𝐉 * 𝐀 ^ 2}.

See also: Unitful.Units.

DimensionfulAngles.LuminousFluxFreeUnitsType
DimensionfulAngles.LuminousFluxFreeUnits{U}

A supertype for Unitful.FreeUnits of dimension 𝐉 * 𝐀 ^ 2. Equivalent to Unitful.FreeUnits{U, 𝐉 * 𝐀 ^ 2}.

DimensionfulAngles.IlluminanceUnitsType
DimensionfulAngles.IlluminanceUnits{U}

A supertype for units of dimension 𝐉 * 𝐀 ^ 2 * 𝐋 ^ -2. Equivalent to Unitful.Units{U, 𝐉 * 𝐀 ^ 2 * 𝐋 ^ -2}.

See also: Unitful.Units.

DimensionfulAngles.IlluminanceFreeUnitsType
DimensionfulAngles.IlluminanceFreeUnits{U}

A supertype for Unitful.FreeUnits of dimension 𝐉 * 𝐀 ^ 2 * 𝐋 ^ -2. Equivalent to Unitful.FreeUnits{U, 𝐉 * 𝐀 ^ 2 * 𝐋 ^ -2}.