Physical Quantities  v1.0.0
C++ library of physical quantities, physical models, and units of measure for scientific computing. https://github.com/acodcha/phq
Loading...
Searching...
No Matches
Acceleration.hpp
Go to the documentation of this file.
1// Copyright © 2020-2024 Alexandre Coderre-Chabot
2//
3// This file is part of Physical Quantities (PhQ), a C++ library of physical quantities, physical
4// models, and units of measure for scientific computing.
5//
6// Physical Quantities is hosted at:
7// https://github.com/acodcha/phq
8//
9// Physical Quantities is licensed under the MIT License:
10// https://mit-license.org
11//
12// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
13// associated documentation files (the "Software"), to deal in the Software without restriction,
14// including without limitation the rights to use, copy, modify, merge, publish, distribute,
15// sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
16// furnished to do so, subject to the following conditions:
17// - The above copyright notice and this permission notice shall be included in all copies or
18// substantial portions of the Software.
19// - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
20// BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
22// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM
23// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
25#ifndef PHQ_UNIT_ACCELERATION_HPP
26#define PHQ_UNIT_ACCELERATION_HPP
27
28#include <cstddef>
29#include <cstdint>
30#include <functional>
31#include <map>
32#include <ostream>
33#include <string_view>
34#include <unordered_map>
35
36#include "../Base.hpp"
37#include "../Dimension/ElectricCurrent.hpp"
38#include "../Dimension/Length.hpp"
39#include "../Dimension/LuminousIntensity.hpp"
40#include "../Dimension/Mass.hpp"
41#include "../Dimension/SubstanceAmount.hpp"
42#include "../Dimension/Temperature.hpp"
43#include "../Dimension/Time.hpp"
44#include "../Dimensions.hpp"
45#include "../Unit.hpp"
46#include "../UnitSystem.hpp"
47
48namespace PhQ {
49
50namespace Unit {
51
52/// \brief Acceleration units.
53enum class Acceleration : int8_t {
54 /// \brief Metre per square second (m/s^2) acceleration unit.
56
57 /// \brief Metre per square minute (m/min^2) acceleration unit.
59
60 /// \brief Metre per square hour (m/hr^2) acceleration unit.
62
63 /// \brief Nautical mile per square second (nmi/s^2) acceleration unit.
65
66 /// \brief Nautical mile per square minute (nmi/min^2) acceleration unit.
68
69 /// \brief Knot per hour (kn/hr) acceleration unit, also known as nautical mile per square hour.
71
72 /// \brief Mile per square second (mi/s^2) acceleration unit.
74
75 /// \brief Mile per square minute (mi/min^2) acceleration unit.
77
78 /// \brief Mile per square hour (mi/hr^2) acceleration unit.
80
81 /// \brief Kilometre per square second (km/s^2) acceleration unit.
83
84 /// \brief Kilometre per square minute (km/min^2) acceleration unit.
86
87 /// \brief Kilometre per square hour (km/hr^2) acceleration unit.
89
90 /// \brief Yard per square second (yd/s^2) acceleration unit.
92
93 /// \brief Yard per square minute (yd/min^2) acceleration unit.
95
96 /// \brief Yard per square hour (yd/hr^2) acceleration unit.
98
99 /// \brief Foot per square second (ft/s^2) acceleration unit.
101
102 /// \brief Foot per square minute (ft/min^2) acceleration unit.
104
105 /// \brief Foot per square hour (ft/hr^2) acceleration unit.
107
108 /// \brief Decimetre per square second (dm/s^2) acceleration unit.
110
111 /// \brief Decimetre per square minute (dm/min^2) acceleration unit.
113
114 /// \brief Decimetre per square hour (dm/hr^2) acceleration unit.
116
117 /// \brief Inch per square second (in/s^2) acceleration unit.
119
120 /// \brief Inch per square minute (in/min^2) acceleration unit.
122
123 /// \brief Inch per square hour (in/hr^2) acceleration unit.
125
126 /// \brief Centimetre per square second (cm/s^2) acceleration unit.
128
129 /// \brief Centimetre per square minute (cm/min^2) acceleration unit.
131
132 /// \brief Centimetre per square hour (cm/hr^2) acceleration unit.
134
135 /// \brief Millimetre per square second (mm/s^2) acceleration unit.
137
138 /// \brief Millimetre per square minute (mm/min^2) acceleration unit.
140
141 /// \brief Millimetre per square hour (mm/hr^2) acceleration unit.
143
144 /// \brief Milliinch per square second (mil/s^2) acceleration unit.
146
147 /// \brief Milliinch per square minute (mil/min^2) acceleration unit.
149
150 /// \brief Milliinch per square hour (mil/hr^2) acceleration unit.
152
153 /// \brief Micrometre per square second (μm/s^2) acceleration unit.
155
156 /// \brief Micrometre per square minute (μm/min^2) acceleration unit.
158
159 /// \brief Micrometre per square hour (μm/hr^2) acceleration unit.
161
162 /// \brief Microinch per square second (μin/s^2) acceleration unit.
164
165 /// \brief Microinch per square minute (μin/min^2) acceleration unit.
167
168 /// \brief Microinch per square hour (μin/hr^2) acceleration unit.
170};
171
172} // namespace Unit
173
174/// \brief Standard acceleration unit: metre per square second (m/s^2).
175template <>
176inline constexpr const Unit::
177 Acceleration Standard<Unit::Acceleration>{Unit::Acceleration::MetrePerSquareSecond};
178
179/// \brief Physical dimension set of acceleration units.
180template <>
181inline constexpr const Dimensions RelatedDimensions<Unit::Acceleration>{
182 Dimensions{Dimension::Time{-2}, Dimension::Length{1}, Dimension::Mass{0},
183 Dimension::ElectricCurrent{0}, Dimension::Temperature{0},
184 Dimension::SubstanceAmount{0}, Dimension::LuminousIntensity{0}}
185};
186
187inline std::ostream& operator<<(std::ostream& stream, const Unit::Acceleration unit) {
188 stream << Abbreviation(unit);
189 return stream;
190}
191
192namespace Internal {
193
194template <>
195inline const std::map<UnitSystem, Unit::Acceleration> ConsistentUnits<Unit::Acceleration>{
200};
201
202template <>
203inline const std::map<Unit::Acceleration, UnitSystem> RelatedUnitSystems<Unit::Acceleration>{
208};
209
210// clang-format off
211
212template <>
213inline const std::map<Unit::Acceleration, std::string_view> Abbreviations<Unit::Acceleration>{
253};
254
255template <>
256inline const std::unordered_map<std::string_view, Unit::Acceleration> Spellings<Unit::Acceleration>{
273 {"nmi/hr^2", Unit::Acceleration::KnotPerHour },
275 {"nmi/hr/hr", Unit::Acceleration::KnotPerHour },
365 {"milliinch/min/min", Unit::Acceleration::MilliinchPerSquareMinute },
377 {"milliinch/hr/hr", Unit::Acceleration::MilliinchPerSquareHour },
420};
421
422// clang-format on
423
424template <>
425template <typename NumericType>
426inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::MetrePerSquareSecond>::
427 FromStandard(NumericType& /*value*/) noexcept {}
428
429template <>
430template <typename NumericType>
431inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::MetrePerSquareSecond>::
432 ToStandard(NumericType& /*value*/) noexcept {}
433
434template <>
435template <typename NumericType>
436inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::MetrePerSquareMinute>::
437 FromStandard(NumericType& value) noexcept {
438 value *= static_cast<NumericType>(3600.0L);
439}
440
441template <>
442template <typename NumericType>
443inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::MetrePerSquareMinute>::
444 ToStandard(NumericType& value) noexcept {
445 value /= static_cast<NumericType>(3600.0L);
446}
447
448template <>
449template <typename NumericType>
450inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::MetrePerSquareHour>::
451 FromStandard(NumericType& value) noexcept {
452 value *= static_cast<NumericType>(12960000.0L);
453}
454
455template <>
456template <typename NumericType>
457inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::MetrePerSquareHour>::
458 ToStandard(NumericType& value) noexcept {
459 value /= static_cast<NumericType>(12960000.0L);
460}
461
462template <>
463template <typename NumericType>
464inline constexpr void
465Conversion<Unit::Acceleration, Unit::Acceleration::NauticalMilePerSquareSecond>::FromStandard(
466 NumericType& value) noexcept {
467 value /= static_cast<NumericType>(1852.0L);
468}
469
470template <>
471template <typename NumericType>
472inline constexpr void
473Conversion<Unit::Acceleration, Unit::Acceleration::NauticalMilePerSquareSecond>::ToStandard(
474 NumericType& value) noexcept {
475 value *= static_cast<NumericType>(1852.0L);
476}
477
478template <>
479template <typename NumericType>
480inline constexpr void
481Conversion<Unit::Acceleration, Unit::Acceleration::NauticalMilePerSquareMinute>::FromStandard(
482 NumericType& value) noexcept {
483 value *= static_cast<NumericType>(3600.0L) / static_cast<NumericType>(1852.0L);
484}
485
486template <>
487template <typename NumericType>
488inline constexpr void
489Conversion<Unit::Acceleration, Unit::Acceleration::NauticalMilePerSquareMinute>::ToStandard(
490 NumericType& value) noexcept {
491 value *= static_cast<NumericType>(1852.0L) / static_cast<NumericType>(3600.0L);
492}
493
494template <>
495template <typename NumericType>
496inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::KnotPerHour>::FromStandard(
497 NumericType& value) noexcept {
498 value *= static_cast<NumericType>(12960000.0L) / static_cast<NumericType>(1852.0L);
499}
500
501template <>
502template <typename NumericType>
503inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::KnotPerHour>::ToStandard(
504 NumericType& value) noexcept {
505 value *= static_cast<NumericType>(1852.0L) / static_cast<NumericType>(12960000.0L);
506}
507
508template <>
509template <typename NumericType>
510inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::MilePerSquareSecond>::
511 FromStandard(NumericType& value) noexcept {
512 value /= static_cast<NumericType>(1609.344L);
513}
514
515template <>
516template <typename NumericType>
517inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::MilePerSquareSecond>::
518 ToStandard(NumericType& value) noexcept {
519 value *= static_cast<NumericType>(1609.344L);
520}
521
522template <>
523template <typename NumericType>
524inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::MilePerSquareMinute>::
525 FromStandard(NumericType& value) noexcept {
526 value *= static_cast<NumericType>(3600.0L) / static_cast<NumericType>(1609.344L);
527}
528
529template <>
530template <typename NumericType>
531inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::MilePerSquareMinute>::
532 ToStandard(NumericType& value) noexcept {
533 value *= static_cast<NumericType>(1609.344L) / static_cast<NumericType>(3600.0L);
534}
535
536template <>
537template <typename NumericType>
538inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::MilePerSquareHour>::
539 FromStandard(NumericType& value) noexcept {
540 value *= static_cast<NumericType>(12960000.0L) / static_cast<NumericType>(1609.344L);
541}
542
543template <>
544template <typename NumericType>
545inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::MilePerSquareHour>::
546 ToStandard(NumericType& value) noexcept {
547 value *= static_cast<NumericType>(1609.344L) / static_cast<NumericType>(12960000.0L);
548}
549
550template <>
551template <typename NumericType>
552inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::KilometrePerSquareSecond>::
553 FromStandard(NumericType& value) noexcept {
554 value *= static_cast<NumericType>(0.001L);
555}
556
557template <>
558template <typename NumericType>
559inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::KilometrePerSquareSecond>::
560 ToStandard(NumericType& value) noexcept {
561 value *= static_cast<NumericType>(1000.0L);
562}
563
564template <>
565template <typename NumericType>
566inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::KilometrePerSquareMinute>::
567 FromStandard(NumericType& value) noexcept {
568 value *= static_cast<NumericType>(3.6L);
569}
570
571template <>
572template <typename NumericType>
573inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::KilometrePerSquareMinute>::
574 ToStandard(NumericType& value) noexcept {
575 value *= static_cast<NumericType>(1000.0L) / static_cast<NumericType>(3600.0L);
576}
577
578template <>
579template <typename NumericType>
580inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::KilometrePerSquareHour>::
581 FromStandard(NumericType& value) noexcept {
582 value *= static_cast<NumericType>(12960.0L);
583}
584
585template <>
586template <typename NumericType>
587inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::KilometrePerSquareHour>::
588 ToStandard(NumericType& value) noexcept {
589 value *= static_cast<NumericType>(1000.0L) / static_cast<NumericType>(12960000.0L);
590}
591
592template <>
593template <typename NumericType>
594inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::YardPerSquareSecond>::
595 FromStandard(NumericType& value) noexcept {
596 value /= static_cast<NumericType>(0.9144L);
597}
598
599template <>
600template <typename NumericType>
601inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::YardPerSquareSecond>::
602 ToStandard(NumericType& value) noexcept {
603 value *= static_cast<NumericType>(0.9144L);
604}
605
606template <>
607template <typename NumericType>
608inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::YardPerSquareMinute>::
609 FromStandard(NumericType& value) noexcept {
610 value *= static_cast<NumericType>(3600.0L) / static_cast<NumericType>(0.9144L);
611}
612
613template <>
614template <typename NumericType>
615inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::YardPerSquareMinute>::
616 ToStandard(NumericType& value) noexcept {
617 value *= static_cast<NumericType>(0.9144L) / static_cast<NumericType>(3600.0L);
618}
619
620template <>
621template <typename NumericType>
622inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::YardPerSquareHour>::
623 FromStandard(NumericType& value) noexcept {
624 value *= static_cast<NumericType>(12960000.0L) / static_cast<NumericType>(0.9144L);
625}
626
627template <>
628template <typename NumericType>
629inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::YardPerSquareHour>::
630 ToStandard(NumericType& value) noexcept {
631 value *= static_cast<NumericType>(0.9144L) / static_cast<NumericType>(12960000.0L);
632}
633
634template <>
635template <typename NumericType>
636inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::FootPerSquareSecond>::
637 FromStandard(NumericType& value) noexcept {
638 value /= static_cast<NumericType>(0.3048L);
639}
640
641template <>
642template <typename NumericType>
643inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::FootPerSquareSecond>::
644 ToStandard(NumericType& value) noexcept {
645 value *= static_cast<NumericType>(0.3048L);
646}
647
648template <>
649template <typename NumericType>
650inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::FootPerSquareMinute>::
651 FromStandard(NumericType& value) noexcept {
652 value *= static_cast<NumericType>(3600.0L) / static_cast<NumericType>(0.3048L);
653}
654
655template <>
656template <typename NumericType>
657inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::FootPerSquareMinute>::
658 ToStandard(NumericType& value) noexcept {
659 value *= static_cast<NumericType>(0.3048L) / static_cast<NumericType>(3600.0L);
660}
661
662template <>
663template <typename NumericType>
664inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::FootPerSquareHour>::
665 FromStandard(NumericType& value) noexcept {
666 value *= static_cast<NumericType>(12960000.0L) / static_cast<NumericType>(0.3048L);
667}
668
669template <>
670template <typename NumericType>
671inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::FootPerSquareHour>::
672 ToStandard(NumericType& value) noexcept {
673 value *= static_cast<NumericType>(0.3048L) / static_cast<NumericType>(12960000.0L);
674}
675
676template <>
677template <typename NumericType>
678inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::DecimetrePerSquareSecond>::
679 FromStandard(NumericType& value) noexcept {
680 value *= static_cast<NumericType>(10.0L);
681}
682
683template <>
684template <typename NumericType>
685inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::DecimetrePerSquareSecond>::
686 ToStandard(NumericType& value) noexcept {
687 value *= static_cast<NumericType>(0.1L);
688}
689
690template <>
691template <typename NumericType>
692inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::DecimetrePerSquareMinute>::
693 FromStandard(NumericType& value) noexcept {
694 value *= static_cast<NumericType>(36000.0L);
695}
696
697template <>
698template <typename NumericType>
699inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::DecimetrePerSquareMinute>::
700 ToStandard(NumericType& value) noexcept {
701 value *= static_cast<NumericType>(0.1L) / static_cast<NumericType>(3600.0L);
702}
703
704template <>
705template <typename NumericType>
706inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::DecimetrePerSquareHour>::
707 FromStandard(NumericType& value) noexcept {
708 value *= static_cast<NumericType>(129600000.0L);
709}
710
711template <>
712template <typename NumericType>
713inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::DecimetrePerSquareHour>::
714 ToStandard(NumericType& value) noexcept {
715 value *= static_cast<NumericType>(0.1L) / static_cast<NumericType>(12960000.0L);
716}
717
718template <>
719template <typename NumericType>
720inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::InchPerSquareSecond>::
721 FromStandard(NumericType& value) noexcept {
722 value /= static_cast<NumericType>(0.0254L);
723}
724
725template <>
726template <typename NumericType>
727inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::InchPerSquareSecond>::
728 ToStandard(NumericType& value) noexcept {
729 value *= static_cast<NumericType>(0.0254L);
730}
731
732template <>
733template <typename NumericType>
734inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::InchPerSquareMinute>::
735 FromStandard(NumericType& value) noexcept {
736 value *= static_cast<NumericType>(3600.0L) / static_cast<NumericType>(0.0254L);
737}
738
739template <>
740template <typename NumericType>
741inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::InchPerSquareMinute>::
742 ToStandard(NumericType& value) noexcept {
743 value *= static_cast<NumericType>(0.0254L) / static_cast<NumericType>(3600.0L);
744}
745
746template <>
747template <typename NumericType>
748inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::InchPerSquareHour>::
749 FromStandard(NumericType& value) noexcept {
750 value *= static_cast<NumericType>(12960000.0L) / static_cast<NumericType>(0.0254L);
751}
752
753template <>
754template <typename NumericType>
755inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::InchPerSquareHour>::
756 ToStandard(NumericType& value) noexcept {
757 value *= static_cast<NumericType>(0.0254L) / static_cast<NumericType>(12960000.0L);
758}
759
760template <>
761template <typename NumericType>
762inline constexpr void
763Conversion<Unit::Acceleration, Unit::Acceleration::CentimetrePerSquareSecond>::FromStandard(
764 NumericType& value) noexcept {
765 value *= static_cast<NumericType>(100.0L);
766}
767
768template <>
769template <typename NumericType>
770inline constexpr void
771Conversion<Unit::Acceleration, Unit::Acceleration::CentimetrePerSquareSecond>::ToStandard(
772 NumericType& value) noexcept {
773 value *= static_cast<NumericType>(0.01L);
774}
775
776template <>
777template <typename NumericType>
778inline constexpr void
779Conversion<Unit::Acceleration, Unit::Acceleration::CentimetrePerSquareMinute>::FromStandard(
780 NumericType& value) noexcept {
781 value *= static_cast<NumericType>(360000.0L);
782}
783
784template <>
785template <typename NumericType>
786inline constexpr void
787Conversion<Unit::Acceleration, Unit::Acceleration::CentimetrePerSquareMinute>::ToStandard(
788 NumericType& value) noexcept {
789 value *= static_cast<NumericType>(0.01L) / static_cast<NumericType>(3600.0L);
790}
791
792template <>
793template <typename NumericType>
794inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::CentimetrePerSquareHour>::
795 FromStandard(NumericType& value) noexcept {
796 value *= static_cast<NumericType>(1296000000.0L);
797}
798
799template <>
800template <typename NumericType>
801inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::CentimetrePerSquareHour>::
802 ToStandard(NumericType& value) noexcept {
803 value *= static_cast<NumericType>(0.01L) / static_cast<NumericType>(12960000.0L);
804}
805
806template <>
807template <typename NumericType>
808inline constexpr void
809Conversion<Unit::Acceleration, Unit::Acceleration::MillimetrePerSquareSecond>::FromStandard(
810 NumericType& value) noexcept {
811 value *= static_cast<NumericType>(1000.0L);
812}
813
814template <>
815template <typename NumericType>
816inline constexpr void
817Conversion<Unit::Acceleration, Unit::Acceleration::MillimetrePerSquareSecond>::ToStandard(
818 NumericType& value) noexcept {
819 value *= static_cast<NumericType>(0.001L);
820}
821
822template <>
823template <typename NumericType>
824inline constexpr void
825Conversion<Unit::Acceleration, Unit::Acceleration::MillimetrePerSquareMinute>::FromStandard(
826 NumericType& value) noexcept {
827 value *= static_cast<NumericType>(3600000.0L);
828}
829
830template <>
831template <typename NumericType>
832inline constexpr void
833Conversion<Unit::Acceleration, Unit::Acceleration::MillimetrePerSquareMinute>::ToStandard(
834 NumericType& value) noexcept {
835 value *= static_cast<NumericType>(0.001L) / static_cast<NumericType>(3600.0L);
836}
837
838template <>
839template <typename NumericType>
840inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::MillimetrePerSquareHour>::
841 FromStandard(NumericType& value) noexcept {
842 value *= static_cast<NumericType>(12960000000.0L);
843}
844
845template <>
846template <typename NumericType>
847inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::MillimetrePerSquareHour>::
848 ToStandard(NumericType& value) noexcept {
849 value *= static_cast<NumericType>(0.001L) / static_cast<NumericType>(12960000.0L);
850}
851
852template <>
853template <typename NumericType>
854inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::MilliinchPerSquareSecond>::
855 FromStandard(NumericType& value) noexcept {
856 value /= static_cast<NumericType>(0.0000254L);
857}
858
859template <>
860template <typename NumericType>
861inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::MilliinchPerSquareSecond>::
862 ToStandard(NumericType& value) noexcept {
863 value *= static_cast<NumericType>(0.0000254L);
864}
865
866template <>
867template <typename NumericType>
868inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::MilliinchPerSquareMinute>::
869 FromStandard(NumericType& value) noexcept {
870 value *= static_cast<NumericType>(3600.0L) / static_cast<NumericType>(0.0000254L);
871}
872
873template <>
874template <typename NumericType>
875inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::MilliinchPerSquareMinute>::
876 ToStandard(NumericType& value) noexcept {
877 value *= static_cast<NumericType>(0.0000254L) / static_cast<NumericType>(3600.0L);
878}
879
880template <>
881template <typename NumericType>
882inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::MilliinchPerSquareHour>::
883 FromStandard(NumericType& value) noexcept {
884 value *= static_cast<NumericType>(12960000.0L) / static_cast<NumericType>(0.0000254L);
885}
886
887template <>
888template <typename NumericType>
889inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::MilliinchPerSquareHour>::
890 ToStandard(NumericType& value) noexcept {
891 value *= static_cast<NumericType>(0.0000254L) / static_cast<NumericType>(12960000.0L);
892}
893
894template <>
895template <typename NumericType>
896inline constexpr void
897Conversion<Unit::Acceleration, Unit::Acceleration::MicrometrePerSquareSecond>::FromStandard(
898 NumericType& value) noexcept {
899 value *= static_cast<NumericType>(1000000.0L);
900}
901
902template <>
903template <typename NumericType>
904inline constexpr void
905Conversion<Unit::Acceleration, Unit::Acceleration::MicrometrePerSquareSecond>::ToStandard(
906 NumericType& value) noexcept {
907 value *= static_cast<NumericType>(0.000001L);
908}
909
910template <>
911template <typename NumericType>
912inline constexpr void
913Conversion<Unit::Acceleration, Unit::Acceleration::MicrometrePerSquareMinute>::FromStandard(
914 NumericType& value) noexcept {
915 value *= static_cast<NumericType>(3600000000.0L);
916}
917
918template <>
919template <typename NumericType>
920inline constexpr void
921Conversion<Unit::Acceleration, Unit::Acceleration::MicrometrePerSquareMinute>::ToStandard(
922 NumericType& value) noexcept {
923 value *= static_cast<NumericType>(0.000001L) / static_cast<NumericType>(3600.0L);
924}
925
926template <>
927template <typename NumericType>
928inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::MicrometrePerSquareHour>::
929 FromStandard(NumericType& value) noexcept {
930 value *= static_cast<NumericType>(12960000000000.0L);
931}
932
933template <>
934template <typename NumericType>
935inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::MicrometrePerSquareHour>::
936 ToStandard(NumericType& value) noexcept {
937 value *= static_cast<NumericType>(0.000001L) / static_cast<NumericType>(12960000.0L);
938}
939
940template <>
941template <typename NumericType>
942inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::MicroinchPerSquareSecond>::
943 FromStandard(NumericType& value) noexcept {
944 value /= static_cast<NumericType>(0.0000000254L);
945}
946
947template <>
948template <typename NumericType>
949inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::MicroinchPerSquareSecond>::
950 ToStandard(NumericType& value) noexcept {
951 value *= static_cast<NumericType>(0.0000000254L);
952}
953
954template <>
955template <typename NumericType>
956inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::MicroinchPerSquareMinute>::
957 FromStandard(NumericType& value) noexcept {
958 value *= static_cast<NumericType>(3600.0L) / static_cast<NumericType>(0.0000000254L);
959}
960
961template <>
962template <typename NumericType>
963inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::MicroinchPerSquareMinute>::
964 ToStandard(NumericType& value) noexcept {
965 value *= static_cast<NumericType>(0.0000000254L) / static_cast<NumericType>(3600.0L);
966}
967
968template <>
969template <typename NumericType>
970inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::MicroinchPerSquareHour>::
971 FromStandard(NumericType& value) noexcept {
972 value *= static_cast<NumericType>(12960000.0L) / static_cast<NumericType>(0.0000000254L);
973}
974
975template <>
976template <typename NumericType>
977inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::MicroinchPerSquareHour>::
978 ToStandard(NumericType& value) noexcept {
979 value *= static_cast<NumericType>(0.0000000254L) / static_cast<NumericType>(12960000.0L);
980}
981
982template <typename NumericType>
983inline const std::map<Unit::Acceleration,
984 std::function<void(NumericType* values, const std::size_t size)>>
985 MapOfConversionsFromStandard<Unit::Acceleration, NumericType>{
987 Conversions<Unit::Acceleration, Unit::Acceleration::MetrePerSquareSecond>::
988 FromStandard<NumericType> },
990 Conversions<Unit::Acceleration, Unit::Acceleration::MetrePerSquareMinute>::
991 FromStandard<NumericType> },
993 Conversions<Unit::Acceleration, Unit::Acceleration::MetrePerSquareHour>::
994 FromStandard<NumericType> },
996 Conversions<Unit::Acceleration, Unit::Acceleration::NauticalMilePerSquareSecond>::
997 FromStandard<NumericType> },
999 Conversions<Unit::Acceleration, Unit::Acceleration::NauticalMilePerSquareMinute>::
1000 FromStandard<NumericType> },
1002 Conversions<Unit::Acceleration, Unit::Acceleration::KnotPerHour>::FromStandard<NumericType>},
1004 Conversions<Unit::Acceleration, Unit::Acceleration::MilePerSquareSecond>::
1005 FromStandard<NumericType> },
1007 Conversions<Unit::Acceleration, Unit::Acceleration::MilePerSquareMinute>::
1008 FromStandard<NumericType> },
1010 Conversions<Unit::Acceleration, Unit::Acceleration::MilePerSquareHour>::
1011 FromStandard<NumericType> },
1013 Conversions<Unit::Acceleration, Unit::Acceleration::KilometrePerSquareSecond>::
1014 FromStandard<NumericType> },
1016 Conversions<Unit::Acceleration, Unit::Acceleration::KilometrePerSquareMinute>::
1017 FromStandard<NumericType> },
1019 Conversions<Unit::Acceleration, Unit::Acceleration::KilometrePerSquareHour>::
1020 FromStandard<NumericType> },
1022 Conversions<Unit::Acceleration, Unit::Acceleration::YardPerSquareSecond>::
1023 FromStandard<NumericType> },
1025 Conversions<Unit::Acceleration, Unit::Acceleration::YardPerSquareMinute>::
1026 FromStandard<NumericType> },
1028 Conversions<Unit::Acceleration, Unit::Acceleration::YardPerSquareHour>::
1029 FromStandard<NumericType> },
1031 Conversions<Unit::Acceleration, Unit::Acceleration::FootPerSquareSecond>::
1032 FromStandard<NumericType> },
1034 Conversions<Unit::Acceleration, Unit::Acceleration::FootPerSquareMinute>::
1035 FromStandard<NumericType> },
1037 Conversions<Unit::Acceleration, Unit::Acceleration::FootPerSquareHour>::
1038 FromStandard<NumericType> },
1040 Conversions<Unit::Acceleration, Unit::Acceleration::DecimetrePerSquareSecond>::
1041 FromStandard<NumericType> },
1043 Conversions<Unit::Acceleration, Unit::Acceleration::DecimetrePerSquareMinute>::
1044 FromStandard<NumericType> },
1046 Conversions<Unit::Acceleration, Unit::Acceleration::DecimetrePerSquareHour>::
1047 FromStandard<NumericType> },
1049 Conversions<Unit::Acceleration, Unit::Acceleration::InchPerSquareSecond>::
1050 FromStandard<NumericType> },
1052 Conversions<Unit::Acceleration, Unit::Acceleration::InchPerSquareMinute>::
1053 FromStandard<NumericType> },
1055 Conversions<Unit::Acceleration, Unit::Acceleration::InchPerSquareHour>::
1056 FromStandard<NumericType> },
1058 Conversions<Unit::Acceleration, Unit::Acceleration::CentimetrePerSquareSecond>::
1059 FromStandard<NumericType> },
1061 Conversions<Unit::Acceleration, Unit::Acceleration::CentimetrePerSquareMinute>::
1062 FromStandard<NumericType> },
1064 Conversions<Unit::Acceleration, Unit::Acceleration::CentimetrePerSquareHour>::
1065 FromStandard<NumericType> },
1067 Conversions<Unit::Acceleration, Unit::Acceleration::MillimetrePerSquareSecond>::
1068 FromStandard<NumericType> },
1070 Conversions<Unit::Acceleration, Unit::Acceleration::MillimetrePerSquareMinute>::
1071 FromStandard<NumericType> },
1073 Conversions<Unit::Acceleration, Unit::Acceleration::MillimetrePerSquareHour>::
1074 FromStandard<NumericType> },
1076 Conversions<Unit::Acceleration, Unit::Acceleration::MilliinchPerSquareSecond>::
1077 FromStandard<NumericType> },
1079 Conversions<Unit::Acceleration, Unit::Acceleration::MilliinchPerSquareMinute>::
1080 FromStandard<NumericType> },
1082 Conversions<Unit::Acceleration, Unit::Acceleration::MilliinchPerSquareHour>::
1083 FromStandard<NumericType> },
1085 Conversions<Unit::Acceleration, Unit::Acceleration::MicrometrePerSquareSecond>::
1086 FromStandard<NumericType> },
1088 Conversions<Unit::Acceleration, Unit::Acceleration::MicrometrePerSquareMinute>::
1089 FromStandard<NumericType> },
1091 Conversions<Unit::Acceleration, Unit::Acceleration::MicrometrePerSquareHour>::
1092 FromStandard<NumericType> },
1094 Conversions<Unit::Acceleration, Unit::Acceleration::MicroinchPerSquareSecond>::
1095 FromStandard<NumericType> },
1097 Conversions<Unit::Acceleration, Unit::Acceleration::MicroinchPerSquareMinute>::
1098 FromStandard<NumericType> },
1100 Conversions<Unit::Acceleration, Unit::Acceleration::MicroinchPerSquareHour>::
1101 FromStandard<NumericType> },
1102};
1103
1104template <typename NumericType>
1105inline const std::map<Unit::Acceleration,
1106 std::function<void(NumericType* const values, const std::size_t size)>>
1107 MapOfConversionsToStandard<Unit::Acceleration, NumericType>{
1109 Conversions<Unit::Acceleration, Unit::Acceleration::MetrePerSquareSecond>::
1110 ToStandard<NumericType> },
1112 Conversions<Unit::Acceleration, Unit::Acceleration::MetrePerSquareMinute>::
1113 ToStandard<NumericType> },
1115 Conversions<Unit::Acceleration, Unit::Acceleration::MetrePerSquareHour>::
1116 ToStandard<NumericType> },
1118 Conversions<Unit::Acceleration, Unit::Acceleration::NauticalMilePerSquareSecond>::
1119 ToStandard<NumericType> },
1121 Conversions<Unit::Acceleration, Unit::Acceleration::NauticalMilePerSquareMinute>::
1122 ToStandard<NumericType> },
1124 Conversions<Unit::Acceleration, Unit::Acceleration::KnotPerHour>::ToStandard<NumericType>},
1126 Conversions<Unit::Acceleration, Unit::Acceleration::MilePerSquareSecond>::
1127 ToStandard<NumericType> },
1129 Conversions<Unit::Acceleration, Unit::Acceleration::MilePerSquareMinute>::
1130 ToStandard<NumericType> },
1132 Conversions<Unit::Acceleration, Unit::Acceleration::MilePerSquareHour>::
1133 ToStandard<NumericType> },
1135 Conversions<Unit::Acceleration, Unit::Acceleration::KilometrePerSquareSecond>::
1136 ToStandard<NumericType> },
1138 Conversions<Unit::Acceleration, Unit::Acceleration::KilometrePerSquareMinute>::
1139 ToStandard<NumericType> },
1141 Conversions<Unit::Acceleration, Unit::Acceleration::KilometrePerSquareHour>::
1142 ToStandard<NumericType> },
1144 Conversions<Unit::Acceleration, Unit::Acceleration::YardPerSquareSecond>::
1145 ToStandard<NumericType> },
1147 Conversions<Unit::Acceleration, Unit::Acceleration::YardPerSquareMinute>::
1148 ToStandard<NumericType> },
1150 Conversions<Unit::Acceleration, Unit::Acceleration::YardPerSquareHour>::
1151 ToStandard<NumericType> },
1153 Conversions<Unit::Acceleration, Unit::Acceleration::FootPerSquareSecond>::
1154 ToStandard<NumericType> },
1156 Conversions<Unit::Acceleration, Unit::Acceleration::FootPerSquareMinute>::
1157 ToStandard<NumericType> },
1159 Conversions<Unit::Acceleration, Unit::Acceleration::FootPerSquareHour>::
1160 ToStandard<NumericType> },
1162 Conversions<Unit::Acceleration, Unit::Acceleration::DecimetrePerSquareSecond>::
1163 ToStandard<NumericType> },
1165 Conversions<Unit::Acceleration, Unit::Acceleration::DecimetrePerSquareMinute>::
1166 ToStandard<NumericType> },
1168 Conversions<Unit::Acceleration, Unit::Acceleration::DecimetrePerSquareHour>::
1169 ToStandard<NumericType> },
1171 Conversions<Unit::Acceleration, Unit::Acceleration::InchPerSquareSecond>::
1172 ToStandard<NumericType> },
1174 Conversions<Unit::Acceleration, Unit::Acceleration::InchPerSquareMinute>::
1175 ToStandard<NumericType> },
1177 Conversions<Unit::Acceleration, Unit::Acceleration::InchPerSquareHour>::
1178 ToStandard<NumericType> },
1180 Conversions<Unit::Acceleration, Unit::Acceleration::CentimetrePerSquareSecond>::
1181 ToStandard<NumericType> },
1183 Conversions<Unit::Acceleration, Unit::Acceleration::CentimetrePerSquareMinute>::
1184 ToStandard<NumericType> },
1186 Conversions<Unit::Acceleration, Unit::Acceleration::CentimetrePerSquareHour>::
1187 ToStandard<NumericType> },
1189 Conversions<Unit::Acceleration, Unit::Acceleration::MillimetrePerSquareSecond>::
1190 ToStandard<NumericType> },
1192 Conversions<Unit::Acceleration, Unit::Acceleration::MillimetrePerSquareMinute>::
1193 ToStandard<NumericType> },
1195 Conversions<Unit::Acceleration, Unit::Acceleration::MillimetrePerSquareHour>::
1196 ToStandard<NumericType> },
1198 Conversions<Unit::Acceleration, Unit::Acceleration::MilliinchPerSquareSecond>::
1199 ToStandard<NumericType> },
1201 Conversions<Unit::Acceleration, Unit::Acceleration::MilliinchPerSquareMinute>::
1202 ToStandard<NumericType> },
1204 Conversions<Unit::Acceleration, Unit::Acceleration::MilliinchPerSquareHour>::
1205 ToStandard<NumericType> },
1207 Conversions<Unit::Acceleration, Unit::Acceleration::MicrometrePerSquareSecond>::
1208 ToStandard<NumericType> },
1210 Conversions<Unit::Acceleration, Unit::Acceleration::MicrometrePerSquareMinute>::
1211 ToStandard<NumericType> },
1213 Conversions<Unit::Acceleration, Unit::Acceleration::MicrometrePerSquareHour>::
1214 ToStandard<NumericType> },
1216 Conversions<Unit::Acceleration, Unit::Acceleration::MicroinchPerSquareSecond>::
1217 ToStandard<NumericType> },
1219 Conversions<Unit::Acceleration, Unit::Acceleration::MicroinchPerSquareMinute>::
1220 ToStandard<NumericType> },
1222 Conversions<Unit::Acceleration, Unit::Acceleration::MicroinchPerSquareHour>::
1223 ToStandard<NumericType> },
1224};
1225
1226} // namespace Internal
1227
1228} // namespace PhQ
1229
1230#endif // PHQ_UNIT_ACCELERATION_HPP
Acceleration
Acceleration units.
@ FootPerSquareMinute
Foot per square minute (ft/min^2) acceleration unit.
@ FootPerSquareSecond
Foot per square second (ft/s^2) acceleration unit.
@ KnotPerHour
Knot per hour (kn/hr) acceleration unit, also known as nautical mile per square hour.
@ CentimetrePerSquareMinute
Centimetre per square minute (cm/min^2) acceleration unit.
@ FootPerSquareHour
Foot per square hour (ft/hr^2) acceleration unit.
@ CentimetrePerSquareHour
Centimetre per square hour (cm/hr^2) acceleration unit.
@ MicroinchPerSquareHour
Microinch per square hour (μin/hr^2) acceleration unit.
@ MetrePerSquareSecond
Metre per square second (m/s^2) acceleration unit.
@ YardPerSquareHour
Yard per square hour (yd/hr^2) acceleration unit.
@ KilometrePerSquareHour
Kilometre per square hour (km/hr^2) acceleration unit.
@ InchPerSquareMinute
Inch per square minute (in/min^2) acceleration unit.
@ MilePerSquareSecond
Mile per square second (mi/s^2) acceleration unit.
@ MicrometrePerSquareHour
Micrometre per square hour (μm/hr^2) acceleration unit.
@ MicrometrePerSquareMinute
Micrometre per square minute (μm/min^2) acceleration unit.
@ MilliinchPerSquareMinute
Milliinch per square minute (mil/min^2) acceleration unit.
@ MicroinchPerSquareSecond
Microinch per square second (μin/s^2) acceleration unit.
@ KilometrePerSquareSecond
Kilometre per square second (km/s^2) acceleration unit.
@ DecimetrePerSquareSecond
Decimetre per square second (dm/s^2) acceleration unit.
@ InchPerSquareHour
Inch per square hour (in/hr^2) acceleration unit.
@ MilliinchPerSquareHour
Milliinch per square hour (mil/hr^2) acceleration unit.
@ KilometrePerSquareMinute
Kilometre per square minute (km/min^2) acceleration unit.
@ YardPerSquareSecond
Yard per square second (yd/s^2) acceleration unit.
@ MilePerSquareMinute
Mile per square minute (mi/min^2) acceleration unit.
@ InchPerSquareSecond
Inch per square second (in/s^2) acceleration unit.
@ MetrePerSquareHour
Metre per square hour (m/hr^2) acceleration unit.
@ YardPerSquareMinute
Yard per square minute (yd/min^2) acceleration unit.
@ MillimetrePerSquareSecond
Millimetre per square second (mm/s^2) acceleration unit.
@ MillimetrePerSquareHour
Millimetre per square hour (mm/hr^2) acceleration unit.
@ MillimetrePerSquareMinute
Millimetre per square minute (mm/min^2) acceleration unit.
@ DecimetrePerSquareHour
Decimetre per square hour (dm/hr^2) acceleration unit.
@ MicrometrePerSquareSecond
Micrometre per square second (μm/s^2) acceleration unit.
@ DecimetrePerSquareMinute
Decimetre per square minute (dm/min^2) acceleration unit.
@ NauticalMilePerSquareSecond
Nautical mile per square second (nmi/s^2) acceleration unit.
@ NauticalMilePerSquareMinute
Nautical mile per square minute (nmi/min^2) acceleration unit.
@ MilliinchPerSquareSecond
Milliinch per square second (mil/s^2) acceleration unit.
@ MicroinchPerSquareMinute
Microinch per square minute (μin/min^2) acceleration unit.
@ MetrePerSquareMinute
Metre per square minute (m/min^2) acceleration unit.
@ CentimetrePerSquareSecond
Centimetre per square second (cm/s^2) acceleration unit.
@ MilePerSquareHour
Mile per square hour (mi/hr^2) acceleration unit.
Namespace that encompasses all of the Physical Quantities library's content.
std::ostream & operator<<(std::ostream &stream, const Acceleration< NumericType > &acceleration)
@ FootPoundSecondRankine
Foot-pound-second-rankine (ft·lbf·s·°R) system.
@ MillimetreGramSecondKelvin
Millimetre-gram-second-kelvin (mm·g·s·K) system.
@ MetreKilogramSecondKelvin
Metre-kilogram-second-kelvin (m·kg·s·K) system.
@ InchPoundSecondRankine
Inch-pound-second-rankine (in·lbf·s·°R) system.
std::string_view Abbreviation(const Enumeration enumeration)
Returns the abbreviation of a given enumeration value. For example, PhQ::Abbreviation(PhQ::Unit::Time...
Definition Base.hpp:89