Other units of angle
While the radian (DimensionfulAngles.radᵃ
) and the degree (DimensionfulAngles.°ᵃ
) should cover must use cases, there are many other units of angle. Based on this table and UnitfulAngles.jl, the following units are also provided:
DimensionfulAngles.arcminuteᵃ
DimensionfulAngles.arcsecondᵃ
DimensionfulAngles.diameterPartᵃ
DimensionfulAngles.turnᵃ
DimensionfulAngles.doubleTurnᵃ
DimensionfulAngles.halfTurnᵃ
DimensionfulAngles.quadrantᵃ
DimensionfulAngles.sextantᵃ
DimensionfulAngles.octantᵃ
DimensionfulAngles.clockPositionᵃ
DimensionfulAngles.hourAngleᵃ
DimensionfulAngles.compassPointᵃ
DimensionfulAngles.hexacontadeᵃ
DimensionfulAngles.bradᵃ
DimensionfulAngles.gradᵃ
The documentation for these are found in Syntax.
Astronomical units
In astronomy it is common to measure angles in prefixed arcseconds with the symbol for arcsecond as
, i.e., milliarcsecond is mas
. DimensionfulAngles.jl provides this alternate, prefixable, version of the arcsecond.
DimensionfulAngles.asᵃ
— Constantasₐ
The arcsecond, a unit of angle defined as 1°/3600.
This is an alternative symbol for DimensionfulAngles.arcsecondᵃ
common in astronomy. Unlike arcsecondᵃ
, asᵃ
accepts SI prefixes. UnitfulAngles
has similar implementation for μas
, mas
, and pas
; this differs in that it contains units of angle.
To avoid abbreviation conflicts between attoseconds (as
) and arcseconds, and decaseconds (das
) and deciarcseconds, the astronomical arcsecond is abbreviated as asₐ
instead.
Dimension: 𝐀.
See also DimensionfulAngles.arcsecondᵃ
.
The prefixed units are documented in Prefixed units.
Another set of units of angle used in astronomy is the hour, minutes, and seconds. Note that these are minutes and seconds of hour, not degree (e.g., like the arcsecond). The hour is defined as $1/24$ of a full revolution. These are usually displayed as, e.g. 10ʰ 5ᵐ 13.2ˢ
(see Display).
minutes/seconds of a degree are distinct from minutes/seconds of an hour.
DimensionfulAngles.ʰᵃ
— Constantʰᵃ
The hour, a unit of angle defined as 1/24 turn.
Equivalent to hourAngleᵃ
. This differs from UnitfulAngles.ʰ
in that it contains units of angle. Does not accepts SI prefixes.
Dimension: 𝐀.
See also DimensionfulAngles.turnᵃ
.
DimensionfulAngles.ᵐᵃ
— Constantᵐᵃ
The minute, a unit of angle defined as 1ʰ/60.
This differs from UnitfulAngles.ᵐ
in that it contains units of angle. Does not accepts SI prefixes.
Dimension: 𝐀.
See also DimensionfulAngles.ʰᵃ
.
DimensionfulAngles.ˢᵃ
— Constantˢᵃ
The second, a unit of angle defined as 1ʰ/3600.
This differs from UnitfulAngles.ˢ
in that it contains units of angle. Does not accepts SI prefixes.
Dimension: 𝐀.
See also DimensionfulAngles.ʰᵃ
.
Display
Most of the time we want to express an angle in a single unit. However, in some fields it is common to express them in a sexagesimal system. Dimensionful.jl provides the function show_sexagesimal
to display an angle in two different sexagesimal systems. The function sexagesimal
returns these values rather than displaying them.
DimensionfulAngles.sexagesimal
— Functionsexagesimal(x::Angle; base_unit::AngleUnits=°ᵃ)
Convert an angle to the triple (unit, minutes of unit, seconds of unit), where unit is either degree (°ᵃ
) or hour angle (ʰᵃ
).
Minutes and seconds of a degree are different from minutes and seconds of an hour angle. In both cases a minute is 1/60ᵗʰ of the base unit and a second is 1/60ᵗʰ of that.
Example
julia> using DimensionfulAngles
julia> sexagesimal(20.2ua"°")
(20°, 11′, 59.99999999999746″)
julia> sexagesimal(20.2ua"°"; base_unit = ua"ʰ")
(1ʰ, 20ᵐ, 48.000000000000256ˢ)
DimensionfulAngles.show_sexagesimal
— Functionshow_sexagesimal(x::Angle; base_unit::AngleUnits=°ᵃ)
Print an angle in units (u), minutes of unit (m), and seconds of unit (s) where unit is either degree (°ᵃ
) or hour angle (ʰ
). For degrees it is printed as u° m′ s″
and for hour angle as uʰ mᵐ sˢ
.
Example
julia> using DimensionfulAngles
julia> show_sexagesimal(20.2ua"°")
20° 11′ 59.99999999999746″
julia> show_sexagesimal(20.2ua"°"; base_unit = ua"ʰ")
1ʰ 20ᵐ 48.000000000000256ˢ
For most units, a space is inserted between the value and the unit, which is the default behavior from Unitful.jl. For the following units, this space is removed (e.g., 10°
not 10 °
):
°
′
″
ʰ
ᵐ
ˢ
Syntax
Contents:
DimensionfulAngles.arcminuteᵃ
— Constantarcminuteᵃ
The minute of arc, a unit of angle defined as 1°/60.
This differs from UnitfulAngles.arcminute
in that it contains units of angle. Does not accepts SI prefixes.
Dimension: 𝐀.
See also DimensionfulAngles.°ᵃ
.
DimensionfulAngles.arcsecondᵃ
— Constantarcsecondᵃ
The second of arc, a unit of angle defined as 1°/3600.
This differs from UnitfulAngles.arcsecond
in that it contains units of angle. Does not accepts SI prefixes.
Dimension: 𝐀.
See also DimensionfulAngles.°ᵃ
.
DimensionfulAngles.diameterPartᵃ
— ConstantdiameterPartᵃ
The diameter part, a unit of angle defined as 1/60 rad.
This differs from UnitfulAngles.diameterPart
in that it contains units of angle. Does not accepts SI prefixes.
Dimension: 𝐀.
See also DimensionfulAngles.radᵃ
.
DimensionfulAngles.turnᵃ
— Constantturnᵃ
The turn, a unit of angle defined as 2π rad.
Equivalent to a full cycle, revolution, or rotation. This differs from UnitfulAngles.turn
in that it contains units of angle. Does not accepts SI prefixes.
Dimension: 𝐀.
See also DimensionfulAngles.radᵃ
.
DimensionfulAngles.doubleTurnᵃ
— ConstantdoubleTurnᵃ
The double turn, a unit of angle defined as 2 turn.
This differs from UnitfulAngles.doubleTurn
in that it contains units of angle. Does not accepts SI prefixes.
Dimension: 𝐀.
See also DimensionfulAngles.turnᵃ
.
DimensionfulAngles.halfTurnᵃ
— ConstanthalfTurnᵃ
The half turn, a unit of angle defined as 1/2 turn.
This differs from UnitfulAngles.halfTurn
in that it contains units of angle. Does not accepts SI prefixes.
Dimension: 𝐀.
See also DimensionfulAngles.turnᵃ
.
DimensionfulAngles.quadrantᵃ
— Constantquadrantᵃ
The quadrant, a unit of angle defined as 1/4 turn.
This differs from UnitfulAngles.quadrant
in that it contains units of angle. Does not accepts SI prefixes.
Dimension: 𝐀.
See also DimensionfulAngles.turnᵃ
.
DimensionfulAngles.sextantᵃ
— Constantsextantᵃ
The sextant, a unit of angle defined as 1/6 turn.
This differs from UnitfulAngles.sextant
in that it contains units of angle. Does not accepts SI prefixes.
Dimension: 𝐀.
See also DimensionfulAngles.turnᵃ
.
DimensionfulAngles.octantᵃ
— Constantoctantᵃ
The octant, a unit of angle defined as 1/8 turn.
This differs from UnitfulAngles.octant
in that it contains units of angle. Does not accepts SI prefixes.
Dimension: 𝐀.
See also DimensionfulAngles.turnᵃ
.
DimensionfulAngles.clockPositionᵃ
— ConstantclockPositionᵃ
The clock position, a unit of angle defined as 1/12 turn.
This differs from UnitfulAngles.clockPosition
in that it contains units of angle. Does not accepts SI prefixes.
Dimension: 𝐀.
See also DimensionfulAngles.turnᵃ
.
DimensionfulAngles.hourAngleᵃ
— ConstanthourAngleᵃ
The hour angle, a unit of angle defined as 1/24 turn.
This differs from UnitfulAngles.hourAngle
in that it contains units of angle. Does not accepts SI prefixes.
Dimension: 𝐀.
See also DimensionfulAngles.turnᵃ
.
DimensionfulAngles.compassPointᵃ
— ConstantcompassPointᵃ
The compass point, a unit of angle defined as 1/32 turn.
Other compass point definitions also exist. This differs from UnitfulAngles.compassPoint
in that it contains units of angle. Does not accepts SI prefixes.
Dimension: 𝐀.
See also DimensionfulAngles.turnᵃ
.
DimensionfulAngles.hexacontadeᵃ
— Constanthexacontadeᵃ
The hexacontade, a unit of angle defined as 1/60 turn.
This differs from UnitfulAngles.hexacontade
in that it contains units of angle. Does not accepts SI prefixes.
Dimension: 𝐀.
See also DimensionfulAngles.turnᵃ
.
DimensionfulAngles.bradᵃ
— Constantbradᵃ
The binary radian, a unit of angle defined as 1/256 turn.
Also known as the binary degree. This differs from UnitfulAngles.brad
in that it contains units of angle. Does not accepts SI prefixes.
Dimension: 𝐀.
See also DimensionfulAngles.turnᵃ
.
DimensionfulAngles.gradᵃ
— Constantgradᵃ
The gradian, a unit of angle defined as 1/400 turn.
This differs from UnitfulAngles.grad
in that it contains units of angle. Does not accepts SI prefixes.
Dimension: 𝐀.
See also DimensionfulAngles.turnᵃ
.
Prefixed units
DimensionfulAngles.Easᵃ
— ConstantDimensionfulAngles.Easᵃ
A prefixed unit, equal to 10^18 asᵃ.
Dimension: 𝐀
See also: DimensionfulAngles.asᵃ
.
DimensionfulAngles.Gasᵃ
— ConstantDimensionfulAngles.Gasᵃ
A prefixed unit, equal to 10^9 asᵃ.
Dimension: 𝐀
See also: DimensionfulAngles.asᵃ
.
DimensionfulAngles.Masᵃ
— ConstantDimensionfulAngles.Masᵃ
A prefixed unit, equal to 10^6 asᵃ.
Dimension: 𝐀
See also: DimensionfulAngles.asᵃ
.
DimensionfulAngles.Pasᵃ
— ConstantDimensionfulAngles.Pasᵃ
A prefixed unit, equal to 10^15 asᵃ.
Dimension: 𝐀
See also: DimensionfulAngles.asᵃ
.
DimensionfulAngles.Tasᵃ
— ConstantDimensionfulAngles.Tasᵃ
A prefixed unit, equal to 10^12 asᵃ.
Dimension: 𝐀
See also: DimensionfulAngles.asᵃ
.
DimensionfulAngles.Yasᵃ
— ConstantDimensionfulAngles.Yasᵃ
A prefixed unit, equal to 10^24 asᵃ.
Dimension: 𝐀
See also: DimensionfulAngles.asᵃ
.
DimensionfulAngles.Zasᵃ
— ConstantDimensionfulAngles.Zasᵃ
A prefixed unit, equal to 10^21 asᵃ.
Dimension: 𝐀
See also: DimensionfulAngles.asᵃ
.
DimensionfulAngles.aasᵃ
— ConstantDimensionfulAngles.aasᵃ
A prefixed unit, equal to 10^-18 asᵃ.
Dimension: 𝐀
See also: DimensionfulAngles.asᵃ
.
DimensionfulAngles.casᵃ
— ConstantDimensionfulAngles.casᵃ
A prefixed unit, equal to 10^-2 asᵃ.
Dimension: 𝐀
See also: DimensionfulAngles.asᵃ
.
DimensionfulAngles.daasᵃ
— ConstantDimensionfulAngles.daasᵃ
A prefixed unit, equal to 10^1 asᵃ.
Dimension: 𝐀
See also: DimensionfulAngles.asᵃ
.
DimensionfulAngles.dasᵃ
— ConstantDimensionfulAngles.dasᵃ
A prefixed unit, equal to 10^-1 asᵃ.
Dimension: 𝐀
See also: DimensionfulAngles.asᵃ
.
DimensionfulAngles.fasᵃ
— ConstantDimensionfulAngles.fasᵃ
A prefixed unit, equal to 10^-15 asᵃ.
Dimension: 𝐀
See also: DimensionfulAngles.asᵃ
.
DimensionfulAngles.hasᵃ
— ConstantDimensionfulAngles.hasᵃ
A prefixed unit, equal to 10^2 asᵃ.
Dimension: 𝐀
See also: DimensionfulAngles.asᵃ
.
DimensionfulAngles.kasᵃ
— ConstantDimensionfulAngles.kasᵃ
A prefixed unit, equal to 10^3 asᵃ.
Dimension: 𝐀
See also: DimensionfulAngles.asᵃ
.
DimensionfulAngles.masᵃ
— ConstantDimensionfulAngles.masᵃ
A prefixed unit, equal to 10^-3 asᵃ.
Dimension: 𝐀
See also: DimensionfulAngles.asᵃ
.
DimensionfulAngles.nasᵃ
— ConstantDimensionfulAngles.nasᵃ
A prefixed unit, equal to 10^-9 asᵃ.
Dimension: 𝐀
See also: DimensionfulAngles.asᵃ
.
DimensionfulAngles.pasᵃ
— ConstantDimensionfulAngles.pasᵃ
A prefixed unit, equal to 10^-12 asᵃ.
Dimension: 𝐀
See also: DimensionfulAngles.asᵃ
.
DimensionfulAngles.yasᵃ
— ConstantDimensionfulAngles.yasᵃ
A prefixed unit, equal to 10^-24 asᵃ.
Dimension: 𝐀
See also: DimensionfulAngles.asᵃ
.
DimensionfulAngles.zasᵃ
— ConstantDimensionfulAngles.zasᵃ
A prefixed unit, equal to 10^-21 asᵃ.
Dimension: 𝐀
See also: DimensionfulAngles.asᵃ
.
DimensionfulAngles.μasᵃ
— ConstantDimensionfulAngles.μasᵃ
A prefixed unit, equal to 10^-6 asᵃ.
Dimension: 𝐀
See also: DimensionfulAngles.asᵃ
.