diff --git a/src/include/units/physical/iau/length.h b/src/include/units/physical/iau/length.h index fd7a92b7..f7acbd76 100644 --- a/src/include/units/physical/iau/length.h +++ b/src/include/units/physical/iau/length.h @@ -27,9 +27,14 @@ namespace units::iau { -struct light_year : named_scaled_unit,si::metre> {}; -struct parsec : named_scaled_unit,si::metre> {}; -struct angstrom : named_scaled_unit,si::metre> {}; +// https://en.wikipedia.org/wiki/Light-year +struct light_year : named_scaled_unit, si::metre> {}; + +// https://en.wikipedia.org/wiki/Parsec +struct parsec : named_scaled_unit, si::metre> {}; + +// https://en.wikipedia.org/wiki/Angstrom +struct angstrom : named_scaled_unit, si::metre> {}; inline namespace literals { diff --git a/src/include/units/physical/imperial/length.h b/src/include/units/physical/imperial/length.h index 4ece6b44..3e049898 100644 --- a/src/include/units/physical/imperial/length.h +++ b/src/include/units/physical/imperial/length.h @@ -22,12 +22,15 @@ #pragma once -#include +#include namespace units::imperial { -struct chain : named_scaled_unit, si::metre> {}; -struct rod : named_scaled_unit,si::metre> {}; +// https://en.wikipedia.org/wiki/Chain_(unit) +struct chain : named_scaled_unit, international::yard> {}; + +// https://en.wikipedia.org/wiki/Rod_(unit) +struct rod : named_scaled_unit, chain> {}; inline namespace literals { @@ -37,7 +40,6 @@ constexpr auto operator"" ch(long double l) { return si::length(l); } constexpr auto operator"" rd(long double l) { return si::length(l); } - } // namespace literals -} // namespace units::si +} // namespace units::imperial diff --git a/src/include/units/physical/international/length.h b/src/include/units/physical/international/length.h index 328ac9f6..adf6b984 100644 --- a/src/include/units/physical/international/length.h +++ b/src/include/units/physical/international/length.h @@ -25,41 +25,38 @@ #include -/* - international units of length are defined in terms of the si metre -*/ - namespace units::international { -//international yard -//https://en.wikipedia.org/wiki/International_yard_and_pound -struct yard : named_scaled_unit, si::metre> {}; +// international yard +// https://en.wikipedia.org/wiki/International_yard_and_pound +struct yard : named_scaled_unit, si::metre> {}; -//international foot -//https://en.wikipedia.org/wiki/Foot_(unit)#International_foot -struct foot : named_scaled_unit, si::metre> {}; +// international foot +// https://en.wikipedia.org/wiki/Foot_(unit)#International_foot +struct foot : named_scaled_unit, yard> {}; -//https://en.wikipedia.org/wiki/Fathom#International_fathom -struct fathom : named_scaled_unit,si::metre > {}; +// https://en.wikipedia.org/wiki/Fathom#International_fathom +struct fathom : named_scaled_unit, yard> {}; -//international inch -//https://en.wikipedia.org/wiki/Inch#Equivalences -struct inch : named_scaled_unit, si::metre> {}; +// international inch +// https://en.wikipedia.org/wiki/Inch#Equivalences +struct inch : named_scaled_unit, yard> {}; -//intrnational mile -//https://en.wikipedia.org/wiki/Mile#International_mile -struct mile : named_scaled_unit, si::metre> {}; +// intrnational mile +// https://en.wikipedia.org/wiki/Mile#International_mile +struct mile : named_scaled_unit, si::kilometre> {}; -//international nautical mile -//https://en.wikipedia.org/wiki/Mile#Nautical_mile -struct nautical_mile : named_scaled_unit,si::metre> {}; +// international nautical mile +// https://en.wikipedia.org/wiki/Nautical_mile +struct nautical_mile : named_scaled_unit, si::metre> {}; -//TODO thou -//https://en.wikipedia.org/wiki/Thousandth_of_an_inch -//struct thou : named_scaled_unit,si::metre> {}; -// different name for thou -//https://en.wikipedia.org/wiki/Thousandth_of_an_inch -struct mil : named_scaled_unit,si::metre> {}; +// thou +// https://en.wikipedia.org/wiki/Thousandth_of_an_inch +struct thou : named_scaled_unit, inch> {}; + +// mil - different name for thou +// https://en.wikipedia.org/wiki/Thousandth_of_an_inch +using mil = thou; inline namespace literals { @@ -87,14 +84,14 @@ constexpr auto operator"" mi(long double l) { return si::length(l); } constexpr auto operator"" naut_mi(long double l) { return si::length(l); } -//TODO thou -//constexpr auto operator"" thou(unsigned long long l) { return si::length(l); } -//constexpr auto operator"" thou(long double l) { return si::length(l); } +// thou +constexpr auto operator"" thou(unsigned long long l) { return si::length(l); } +constexpr auto operator"" thou(long double l) { return si::length(l); } // mil constexpr auto operator"" mil(unsigned long long l) { return si::length(l); } constexpr auto operator"" mil(long double l) { return si::length(l); } -} // namespace literals +} // namespace literals -} //namespace units::international \ No newline at end of file +} // namespace units::international diff --git a/src/include/units/physical/si/density.h b/src/include/units/physical/si/density.h index d82aada4..1686f2c5 100644 --- a/src/include/units/physical/si/density.h +++ b/src/include/units/physical/si/density.h @@ -32,7 +32,7 @@ namespace units::si { struct kilogram_per_metre_cub : unit {}; -struct dim_density : physical::dim_density {}; +struct dim_density : physical::dim_density {}; template using density = quantity; diff --git a/src/include/units/physical/si/length.h b/src/include/units/physical/si/length.h index 53c225f1..49b3c7e3 100644 --- a/src/include/units/physical/si/length.h +++ b/src/include/units/physical/si/length.h @@ -34,7 +34,7 @@ struct centimetre : prefixed_unit {}; struct decimetre : prefixed_unit {}; struct hectometre : prefixed_unit {}; struct kilometre : prefixed_unit {}; -struct femtometre : prefixed_unit {}; +struct femtometre : prefixed_unit {}; struct astronomical_unit : named_scaled_unit, metre> {}; diff --git a/src/include/units/physical/typographic/length.h b/src/include/units/physical/typographic/length.h index 2b1cfe12..1584b174 100644 --- a/src/include/units/physical/typographic/length.h +++ b/src/include/units/physical/typographic/length.h @@ -27,26 +27,27 @@ namespace units::typographic { -struct pica_comp : named_scaled_unit,si::metre> {}; -struct pica_prn : named_scaled_unit,si::metre> {}; -struct point_comp : named_scaled_unit,si::metre> {}; -struct point_prn : named_scaled_unit,si::metre> {}; +// TODO Conflicts with (https://en.wikipedia.org/wiki/Pica_(typography)), verify correctness of below conversion factors and provide hyperlinks to definitions +struct pica_comp : named_scaled_unit, si::metre> {}; +struct pica_prn : named_scaled_unit, si::metre> {}; +struct point_comp : named_scaled_unit, si::metre> {}; +struct point_prn : named_scaled_unit, si::metre> {}; inline namespace literals { - // pica comp +// pica comp constexpr auto operator"" pica_comp(unsigned long long l) { return si::length(l); } constexpr auto operator"" pica_comp(long double l) { return si::length(l); } - // pica prn +// pica prn constexpr auto operator"" pica_prn(unsigned long long l) { return si::length(l); } constexpr auto operator"" pica_prn(long double l) { return si::length(l); } - // point comp +// point comp constexpr auto operator"" point_comp(unsigned long long l) { return si::length(l); } constexpr auto operator"" point_comp(long double l) { return si::length(l); } - // point prn +// point prn constexpr auto operator"" point_prn(unsigned long long l) { return si::length(l); } constexpr auto operator"" point_prn(long double l) { return si::length(l); } diff --git a/src/include/units/physical/us/length.h b/src/include/units/physical/us/length.h index 1abd9f75..14c468c9 100644 --- a/src/include/units/physical/us/length.h +++ b/src/include/units/physical/us/length.h @@ -26,19 +26,16 @@ namespace units::us { -//https://en.wikipedia.org/wiki/Foot_(unit)#US_survey_foot -//https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors#B6 -//struct foot : named_scaled_unit, si::metre> {}; -//################### causes integer overflow when converting for volume ####################### -struct foot : named_scaled_unit, si::metre> {}; -//############################################################################################# +// https://en.wikipedia.org/wiki/Foot_(unit)#US_survey_foot +// https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors#B6 +struct foot : named_scaled_unit, si::metre> {}; -//https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors#B6 -struct fathom : named_scaled_unit,us::foot> {}; +// https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors#B6 +struct fathom : named_scaled_unit, foot> {}; -//https://en.wikipedia.org/wiki/Mile#U.S._survey_mile -//https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors#B6 -struct mile : named_scaled_unit,us::foot> {}; +// https://en.wikipedia.org/wiki/Mile#U.S._survey_mile +// https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors#B6 +struct mile : named_scaled_unit, us::foot> {}; inline namespace literals {