Physical Quantities  v1.0.0
C++ library of physical quantities, physical models, and units of measure for scientific computing. https://github.com/acodcha/phq
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 
48 namespace PhQ {
49 
50 namespace Unit {
51 
52 /// \brief Acceleration units.
53 enum 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).
175 template <>
176 inline constexpr const Unit::Acceleration Standard<Unit::Acceleration>{
178 
179 /// \brief Physical dimension set of acceleration units.
180 template <>
181 inline constexpr const Dimensions RelatedDimensions<Unit::Acceleration>{
182  Dimensions{Dimension::Time{-2}, Dimension::Length{1}, Dimension::Mass{0},
184  Dimension::SubstanceAmount{0}, Dimension::LuminousIntensity{0}}
185 };
186 
187 inline std::ostream& operator<<(std::ostream& stream, const Unit::Acceleration unit) {
188  stream << Abbreviation(unit);
189  return stream;
190 }
191 
192 namespace Internal {
193 
194 template <>
195 inline const std::map<UnitSystem, Unit::Acceleration> ConsistentUnits<Unit::Acceleration>{
200 };
201 
202 template <>
203 inline const std::map<Unit::Acceleration, UnitSystem> RelatedUnitSystems<Unit::Acceleration>{
208 };
209 
210 // clang-format off
211 
212 template <>
213 inline const std::map<Unit::Acceleration, std::string_view> Abbreviations<Unit::Acceleration>{
253 };
254 
255 template <>
256 inline const std::unordered_map<std::string_view, Unit::Acceleration> Spellings<Unit::Acceleration>{
273  {"nmi/hr^2", Unit::Acceleration::KnotPerHour },
274  {"nmi/hr2", Unit::Acceleration::KnotPerHour },
275  {"nmi/hr/hr", Unit::Acceleration::KnotPerHour },
363  {"milliinch/min^2", Unit::Acceleration::MilliinchPerSquareMinute },
365  {"milliinch/min/min", Unit::Acceleration::MilliinchPerSquareMinute },
375  {"milliinch/hr^2", Unit::Acceleration::MilliinchPerSquareHour },
376  {"milliinch/hr2", Unit::Acceleration::MilliinchPerSquareHour },
377  {"milliinch/hr/hr", Unit::Acceleration::MilliinchPerSquareHour },
420 };
421 
422 // clang-format on
423 
424 template <>
425 template <typename NumericType>
426 inline constexpr void
427 Conversion<Unit::Acceleration, Unit::Acceleration::MetrePerSquareSecond>::FromStandard(
428  NumericType& /*value*/) noexcept {}
429 
430 template <>
431 template <typename NumericType>
432 inline constexpr void
433 Conversion<Unit::Acceleration, Unit::Acceleration::MetrePerSquareSecond>::ToStandard(
434  NumericType& /*value*/) noexcept {}
435 
436 template <>
437 template <typename NumericType>
438 inline constexpr void
439 Conversion<Unit::Acceleration, Unit::Acceleration::MetrePerSquareMinute>::FromStandard(
440  NumericType& value) noexcept {
441  value *= static_cast<NumericType>(3600.0L);
442 }
443 
444 template <>
445 template <typename NumericType>
446 inline constexpr void
447 Conversion<Unit::Acceleration, Unit::Acceleration::MetrePerSquareMinute>::ToStandard(
448  NumericType& value) noexcept {
449  value /= static_cast<NumericType>(3600.0L);
450 }
451 
452 template <>
453 template <typename NumericType>
454 inline constexpr void
455 Conversion<Unit::Acceleration, Unit::Acceleration::MetrePerSquareHour>::FromStandard(
456  NumericType& value) noexcept {
457  value *= static_cast<NumericType>(12960000.0L);
458 }
459 
460 template <>
461 template <typename NumericType>
462 inline constexpr void
463 Conversion<Unit::Acceleration, Unit::Acceleration::MetrePerSquareHour>::ToStandard(
464  NumericType& value) noexcept {
465  value /= static_cast<NumericType>(12960000.0L);
466 }
467 
468 template <>
469 template <typename NumericType>
470 inline constexpr void
471 Conversion<Unit::Acceleration, Unit::Acceleration::NauticalMilePerSquareSecond>::FromStandard(
472  NumericType& value) noexcept {
473  value /= static_cast<NumericType>(1852.0L);
474 }
475 
476 template <>
477 template <typename NumericType>
478 inline constexpr void
479 Conversion<Unit::Acceleration, Unit::Acceleration::NauticalMilePerSquareSecond>::ToStandard(
480  NumericType& value) noexcept {
481  value *= static_cast<NumericType>(1852.0L);
482 }
483 
484 template <>
485 template <typename NumericType>
486 inline constexpr void
487 Conversion<Unit::Acceleration, Unit::Acceleration::NauticalMilePerSquareMinute>::FromStandard(
488  NumericType& value) noexcept {
489  value *= static_cast<NumericType>(3600.0L) / static_cast<NumericType>(1852.0L);
490 }
491 
492 template <>
493 template <typename NumericType>
494 inline constexpr void
495 Conversion<Unit::Acceleration, Unit::Acceleration::NauticalMilePerSquareMinute>::ToStandard(
496  NumericType& value) noexcept {
497  value *= static_cast<NumericType>(1852.0L) / static_cast<NumericType>(3600.0L);
498 }
499 
500 template <>
501 template <typename NumericType>
502 inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::KnotPerHour>::FromStandard(
503  NumericType& value) noexcept {
504  value *= static_cast<NumericType>(12960000.0L) / static_cast<NumericType>(1852.0L);
505 }
506 
507 template <>
508 template <typename NumericType>
509 inline constexpr void Conversion<Unit::Acceleration, Unit::Acceleration::KnotPerHour>::ToStandard(
510  NumericType& value) noexcept {
511  value *= static_cast<NumericType>(1852.0L) / static_cast<NumericType>(12960000.0L);
512 }
513 
514 template <>
515 template <typename NumericType>
516 inline constexpr void
517 Conversion<Unit::Acceleration, Unit::Acceleration::MilePerSquareSecond>::FromStandard(
518  NumericType& value) noexcept {
519  value /= static_cast<NumericType>(1609.344L);
520 }
521 
522 template <>
523 template <typename NumericType>
524 inline constexpr void
525 Conversion<Unit::Acceleration, Unit::Acceleration::MilePerSquareSecond>::ToStandard(
526  NumericType& value) noexcept {
527  value *= static_cast<NumericType>(1609.344L);
528 }
529 
530 template <>
531 template <typename NumericType>
532 inline constexpr void
533 Conversion<Unit::Acceleration, Unit::Acceleration::MilePerSquareMinute>::FromStandard(
534  NumericType& value) noexcept {
535  value *= static_cast<NumericType>(3600.0L) / static_cast<NumericType>(1609.344L);
536 }
537 
538 template <>
539 template <typename NumericType>
540 inline constexpr void
541 Conversion<Unit::Acceleration, Unit::Acceleration::MilePerSquareMinute>::ToStandard(
542  NumericType& value) noexcept {
543  value *= static_cast<NumericType>(1609.344L) / static_cast<NumericType>(3600.0L);
544 }
545 
546 template <>
547 template <typename NumericType>
548 inline constexpr void
549 Conversion<Unit::Acceleration, Unit::Acceleration::MilePerSquareHour>::FromStandard(
550  NumericType& value) noexcept {
551  value *= static_cast<NumericType>(12960000.0L) / static_cast<NumericType>(1609.344L);
552 }
553 
554 template <>
555 template <typename NumericType>
556 inline constexpr void
557 Conversion<Unit::Acceleration, Unit::Acceleration::MilePerSquareHour>::ToStandard(
558  NumericType& value) noexcept {
559  value *= static_cast<NumericType>(1609.344L) / static_cast<NumericType>(12960000.0L);
560 }
561 
562 template <>
563 template <typename NumericType>
564 inline constexpr void
565 Conversion<Unit::Acceleration, Unit::Acceleration::KilometrePerSquareSecond>::FromStandard(
566  NumericType& value) noexcept {
567  value *= static_cast<NumericType>(0.001L);
568 }
569 
570 template <>
571 template <typename NumericType>
572 inline constexpr void
573 Conversion<Unit::Acceleration, Unit::Acceleration::KilometrePerSquareSecond>::ToStandard(
574  NumericType& value) noexcept {
575  value *= static_cast<NumericType>(1000.0L);
576 }
577 
578 template <>
579 template <typename NumericType>
580 inline constexpr void
581 Conversion<Unit::Acceleration, Unit::Acceleration::KilometrePerSquareMinute>::FromStandard(
582  NumericType& value) noexcept {
583  value *= static_cast<NumericType>(3.6L);
584 }
585 
586 template <>
587 template <typename NumericType>
588 inline constexpr void
589 Conversion<Unit::Acceleration, Unit::Acceleration::KilometrePerSquareMinute>::ToStandard(
590  NumericType& value) noexcept {
591  value *= static_cast<NumericType>(1000.0L) / static_cast<NumericType>(3600.0L);
592 }
593 
594 template <>
595 template <typename NumericType>
596 inline constexpr void
597 Conversion<Unit::Acceleration, Unit::Acceleration::KilometrePerSquareHour>::FromStandard(
598  NumericType& value) noexcept {
599  value *= static_cast<NumericType>(12960.0L);
600 }
601 
602 template <>
603 template <typename NumericType>
604 inline constexpr void
605 Conversion<Unit::Acceleration, Unit::Acceleration::KilometrePerSquareHour>::ToStandard(
606  NumericType& value) noexcept {
607  value *= static_cast<NumericType>(1000.0L) / static_cast<NumericType>(12960000.0L);
608 }
609 
610 template <>
611 template <typename NumericType>
612 inline constexpr void
613 Conversion<Unit::Acceleration, Unit::Acceleration::YardPerSquareSecond>::FromStandard(
614  NumericType& value) noexcept {
615  value /= static_cast<NumericType>(0.9144L);
616 }
617 
618 template <>
619 template <typename NumericType>
620 inline constexpr void
621 Conversion<Unit::Acceleration, Unit::Acceleration::YardPerSquareSecond>::ToStandard(
622  NumericType& value) noexcept {
623  value *= static_cast<NumericType>(0.9144L);
624 }
625 
626 template <>
627 template <typename NumericType>
628 inline constexpr void
629 Conversion<Unit::Acceleration, Unit::Acceleration::YardPerSquareMinute>::FromStandard(
630  NumericType& value) noexcept {
631  value *= static_cast<NumericType>(3600.0L) / static_cast<NumericType>(0.9144L);
632 }
633 
634 template <>
635 template <typename NumericType>
636 inline constexpr void
637 Conversion<Unit::Acceleration, Unit::Acceleration::YardPerSquareMinute>::ToStandard(
638  NumericType& value) noexcept {
639  value *= static_cast<NumericType>(0.9144L) / static_cast<NumericType>(3600.0L);
640 }
641 
642 template <>
643 template <typename NumericType>
644 inline constexpr void
645 Conversion<Unit::Acceleration, Unit::Acceleration::YardPerSquareHour>::FromStandard(
646  NumericType& value) noexcept {
647  value *= static_cast<NumericType>(12960000.0L) / static_cast<NumericType>(0.9144L);
648 }
649 
650 template <>
651 template <typename NumericType>
652 inline constexpr void
653 Conversion<Unit::Acceleration, Unit::Acceleration::YardPerSquareHour>::ToStandard(
654  NumericType& value) noexcept {
655  value *= static_cast<NumericType>(0.9144L) / static_cast<NumericType>(12960000.0L);
656 }
657 
658 template <>
659 template <typename NumericType>
660 inline constexpr void
661 Conversion<Unit::Acceleration, Unit::Acceleration::FootPerSquareSecond>::FromStandard(
662  NumericType& value) noexcept {
663  value /= static_cast<NumericType>(0.3048L);
664 }
665 
666 template <>
667 template <typename NumericType>
668 inline constexpr void
669 Conversion<Unit::Acceleration, Unit::Acceleration::FootPerSquareSecond>::ToStandard(
670  NumericType& value) noexcept {
671  value *= static_cast<NumericType>(0.3048L);
672 }
673 
674 template <>
675 template <typename NumericType>
676 inline constexpr void
677 Conversion<Unit::Acceleration, Unit::Acceleration::FootPerSquareMinute>::FromStandard(
678  NumericType& value) noexcept {
679  value *= static_cast<NumericType>(3600.0L) / static_cast<NumericType>(0.3048L);
680 }
681 
682 template <>
683 template <typename NumericType>
684 inline constexpr void
685 Conversion<Unit::Acceleration, Unit::Acceleration::FootPerSquareMinute>::ToStandard(
686  NumericType& value) noexcept {
687  value *= static_cast<NumericType>(0.3048L) / static_cast<NumericType>(3600.0L);
688 }
689 
690 template <>
691 template <typename NumericType>
692 inline constexpr void
693 Conversion<Unit::Acceleration, Unit::Acceleration::FootPerSquareHour>::FromStandard(
694  NumericType& value) noexcept {
695  value *= static_cast<NumericType>(12960000.0L) / static_cast<NumericType>(0.3048L);
696 }
697 
698 template <>
699 template <typename NumericType>
700 inline constexpr void
701 Conversion<Unit::Acceleration, Unit::Acceleration::FootPerSquareHour>::ToStandard(
702  NumericType& value) noexcept {
703  value *= static_cast<NumericType>(0.3048L) / static_cast<NumericType>(12960000.0L);
704 }
705 
706 template <>
707 template <typename NumericType>
708 inline constexpr void
709 Conversion<Unit::Acceleration, Unit::Acceleration::DecimetrePerSquareSecond>::FromStandard(
710  NumericType& value) noexcept {
711  value *= static_cast<NumericType>(10.0L);
712 }
713 
714 template <>
715 template <typename NumericType>
716 inline constexpr void
717 Conversion<Unit::Acceleration, Unit::Acceleration::DecimetrePerSquareSecond>::ToStandard(
718  NumericType& value) noexcept {
719  value *= static_cast<NumericType>(0.1L);
720 }
721 
722 template <>
723 template <typename NumericType>
724 inline constexpr void
725 Conversion<Unit::Acceleration, Unit::Acceleration::DecimetrePerSquareMinute>::FromStandard(
726  NumericType& value) noexcept {
727  value *= static_cast<NumericType>(36000.0L);
728 }
729 
730 template <>
731 template <typename NumericType>
732 inline constexpr void
733 Conversion<Unit::Acceleration, Unit::Acceleration::DecimetrePerSquareMinute>::ToStandard(
734  NumericType& value) noexcept {
735  value *= static_cast<NumericType>(0.1L) / static_cast<NumericType>(3600.0L);
736 }
737 
738 template <>
739 template <typename NumericType>
740 inline constexpr void
741 Conversion<Unit::Acceleration, Unit::Acceleration::DecimetrePerSquareHour>::FromStandard(
742  NumericType& value) noexcept {
743  value *= static_cast<NumericType>(129600000.0L);
744 }
745 
746 template <>
747 template <typename NumericType>
748 inline constexpr void
749 Conversion<Unit::Acceleration, Unit::Acceleration::DecimetrePerSquareHour>::ToStandard(
750  NumericType& value) noexcept {
751  value *= static_cast<NumericType>(0.1L) / static_cast<NumericType>(12960000.0L);
752 }
753 
754 template <>
755 template <typename NumericType>
756 inline constexpr void
757 Conversion<Unit::Acceleration, Unit::Acceleration::InchPerSquareSecond>::FromStandard(
758  NumericType& value) noexcept {
759  value /= static_cast<NumericType>(0.0254L);
760 }
761 
762 template <>
763 template <typename NumericType>
764 inline constexpr void
765 Conversion<Unit::Acceleration, Unit::Acceleration::InchPerSquareSecond>::ToStandard(
766  NumericType& value) noexcept {
767  value *= static_cast<NumericType>(0.0254L);
768 }
769 
770 template <>
771 template <typename NumericType>
772 inline constexpr void
773 Conversion<Unit::Acceleration, Unit::Acceleration::InchPerSquareMinute>::FromStandard(
774  NumericType& value) noexcept {
775  value *= static_cast<NumericType>(3600.0L) / static_cast<NumericType>(0.0254L);
776 }
777 
778 template <>
779 template <typename NumericType>
780 inline constexpr void
781 Conversion<Unit::Acceleration, Unit::Acceleration::InchPerSquareMinute>::ToStandard(
782  NumericType& value) noexcept {
783  value *= static_cast<NumericType>(0.0254L) / static_cast<NumericType>(3600.0L);
784 }
785 
786 template <>
787 template <typename NumericType>
788 inline constexpr void
789 Conversion<Unit::Acceleration, Unit::Acceleration::InchPerSquareHour>::FromStandard(
790  NumericType& value) noexcept {
791  value *= static_cast<NumericType>(12960000.0L) / static_cast<NumericType>(0.0254L);
792 }
793 
794 template <>
795 template <typename NumericType>
796 inline constexpr void
797 Conversion<Unit::Acceleration, Unit::Acceleration::InchPerSquareHour>::ToStandard(
798  NumericType& value) noexcept {
799  value *= static_cast<NumericType>(0.0254L) / static_cast<NumericType>(12960000.0L);
800 }
801 
802 template <>
803 template <typename NumericType>
804 inline constexpr void
805 Conversion<Unit::Acceleration, Unit::Acceleration::CentimetrePerSquareSecond>::FromStandard(
806  NumericType& value) noexcept {
807  value *= static_cast<NumericType>(100.0L);
808 }
809 
810 template <>
811 template <typename NumericType>
812 inline constexpr void
813 Conversion<Unit::Acceleration, Unit::Acceleration::CentimetrePerSquareSecond>::ToStandard(
814  NumericType& value) noexcept {
815  value *= static_cast<NumericType>(0.01L);
816 }
817 
818 template <>
819 template <typename NumericType>
820 inline constexpr void
821 Conversion<Unit::Acceleration, Unit::Acceleration::CentimetrePerSquareMinute>::FromStandard(
822  NumericType& value) noexcept {
823  value *= static_cast<NumericType>(360000.0L);
824 }
825 
826 template <>
827 template <typename NumericType>
828 inline constexpr void
829 Conversion<Unit::Acceleration, Unit::Acceleration::CentimetrePerSquareMinute>::ToStandard(
830  NumericType& value) noexcept {
831  value *= static_cast<NumericType>(0.01L) / static_cast<NumericType>(3600.0L);
832 }
833 
834 template <>
835 template <typename NumericType>
836 inline constexpr void
837 Conversion<Unit::Acceleration, Unit::Acceleration::CentimetrePerSquareHour>::FromStandard(
838  NumericType& value) noexcept {
839  value *= static_cast<NumericType>(1296000000.0L);
840 }
841 
842 template <>
843 template <typename NumericType>
844 inline constexpr void
845 Conversion<Unit::Acceleration, Unit::Acceleration::CentimetrePerSquareHour>::ToStandard(
846  NumericType& value) noexcept {
847  value *= static_cast<NumericType>(0.01L) / static_cast<NumericType>(12960000.0L);
848 }
849 
850 template <>
851 template <typename NumericType>
852 inline constexpr void
853 Conversion<Unit::Acceleration, Unit::Acceleration::MillimetrePerSquareSecond>::FromStandard(
854  NumericType& value) noexcept {
855  value *= static_cast<NumericType>(1000.0L);
856 }
857 
858 template <>
859 template <typename NumericType>
860 inline constexpr void
861 Conversion<Unit::Acceleration, Unit::Acceleration::MillimetrePerSquareSecond>::ToStandard(
862  NumericType& value) noexcept {
863  value *= static_cast<NumericType>(0.001L);
864 }
865 
866 template <>
867 template <typename NumericType>
868 inline constexpr void
869 Conversion<Unit::Acceleration, Unit::Acceleration::MillimetrePerSquareMinute>::FromStandard(
870  NumericType& value) noexcept {
871  value *= static_cast<NumericType>(3600000.0L);
872 }
873 
874 template <>
875 template <typename NumericType>
876 inline constexpr void
877 Conversion<Unit::Acceleration, Unit::Acceleration::MillimetrePerSquareMinute>::ToStandard(
878  NumericType& value) noexcept {
879  value *= static_cast<NumericType>(0.001L) / static_cast<NumericType>(3600.0L);
880 }
881 
882 template <>
883 template <typename NumericType>
884 inline constexpr void
885 Conversion<Unit::Acceleration, Unit::Acceleration::MillimetrePerSquareHour>::FromStandard(
886  NumericType& value) noexcept {
887  value *= static_cast<NumericType>(12960000000.0L);
888 }
889 
890 template <>
891 template <typename NumericType>
892 inline constexpr void
893 Conversion<Unit::Acceleration, Unit::Acceleration::MillimetrePerSquareHour>::ToStandard(
894  NumericType& value) noexcept {
895  value *= static_cast<NumericType>(0.001L) / static_cast<NumericType>(12960000.0L);
896 }
897 
898 template <>
899 template <typename NumericType>
900 inline constexpr void
901 Conversion<Unit::Acceleration, Unit::Acceleration::MilliinchPerSquareSecond>::FromStandard(
902  NumericType& value) noexcept {
903  value /= static_cast<NumericType>(0.0000254L);
904 }
905 
906 template <>
907 template <typename NumericType>
908 inline constexpr void
909 Conversion<Unit::Acceleration, Unit::Acceleration::MilliinchPerSquareSecond>::ToStandard(
910  NumericType& value) noexcept {
911  value *= static_cast<NumericType>(0.0000254L);
912 }
913 
914 template <>
915 template <typename NumericType>
916 inline constexpr void
917 Conversion<Unit::Acceleration, Unit::Acceleration::MilliinchPerSquareMinute>::FromStandard(
918  NumericType& value) noexcept {
919  value *= static_cast<NumericType>(3600.0L) / static_cast<NumericType>(0.0000254L);
920 }
921 
922 template <>
923 template <typename NumericType>
924 inline constexpr void
925 Conversion<Unit::Acceleration, Unit::Acceleration::MilliinchPerSquareMinute>::ToStandard(
926  NumericType& value) noexcept {
927  value *= static_cast<NumericType>(0.0000254L) / static_cast<NumericType>(3600.0L);
928 }
929 
930 template <>
931 template <typename NumericType>
932 inline constexpr void
933 Conversion<Unit::Acceleration, Unit::Acceleration::MilliinchPerSquareHour>::FromStandard(
934  NumericType& value) noexcept {
935  value *= static_cast<NumericType>(12960000.0L) / static_cast<NumericType>(0.0000254L);
936 }
937 
938 template <>
939 template <typename NumericType>
940 inline constexpr void
941 Conversion<Unit::Acceleration, Unit::Acceleration::MilliinchPerSquareHour>::ToStandard(
942  NumericType& value) noexcept {
943  value *= static_cast<NumericType>(0.0000254L) / static_cast<NumericType>(12960000.0L);
944 }
945 
946 template <>
947 template <typename NumericType>
948 inline constexpr void
949 Conversion<Unit::Acceleration, Unit::Acceleration::MicrometrePerSquareSecond>::FromStandard(
950  NumericType& value) noexcept {
951  value *= static_cast<NumericType>(1000000.0L);
952 }
953 
954 template <>
955 template <typename NumericType>
956 inline constexpr void
957 Conversion<Unit::Acceleration, Unit::Acceleration::MicrometrePerSquareSecond>::ToStandard(
958  NumericType& value) noexcept {
959  value *= static_cast<NumericType>(0.000001L);
960 }
961 
962 template <>
963 template <typename NumericType>
964 inline constexpr void
965 Conversion<Unit::Acceleration, Unit::Acceleration::MicrometrePerSquareMinute>::FromStandard(
966  NumericType& value) noexcept {
967  value *= static_cast<NumericType>(3600000000.0L);
968 }
969 
970 template <>
971 template <typename NumericType>
972 inline constexpr void
973 Conversion<Unit::Acceleration, Unit::Acceleration::MicrometrePerSquareMinute>::ToStandard(
974  NumericType& value) noexcept {
975  value *= static_cast<NumericType>(0.000001L) / static_cast<NumericType>(3600.0L);
976 }
977 
978 template <>
979 template <typename NumericType>
980 inline constexpr void
981 Conversion<Unit::Acceleration, Unit::Acceleration::MicrometrePerSquareHour>::FromStandard(
982  NumericType& value) noexcept {
983  value *= static_cast<NumericType>(12960000000000.0L);
984 }
985 
986 template <>
987 template <typename NumericType>
988 inline constexpr void
989 Conversion<Unit::Acceleration, Unit::Acceleration::MicrometrePerSquareHour>::ToStandard(
990  NumericType& value) noexcept {
991  value *= static_cast<NumericType>(0.000001L) / static_cast<NumericType>(12960000.0L);
992 }
993 
994 template <>
995 template <typename NumericType>
996 inline constexpr void
997 Conversion<Unit::Acceleration, Unit::Acceleration::MicroinchPerSquareSecond>::FromStandard(
998  NumericType& value) noexcept {
999  value /= static_cast<NumericType>(0.0000000254L);
1000 }
1001 
1002 template <>
1003 template <typename NumericType>
1004 inline constexpr void
1005 Conversion<Unit::Acceleration, Unit::Acceleration::MicroinchPerSquareSecond>::ToStandard(
1006  NumericType& value) noexcept {
1007  value *= static_cast<NumericType>(0.0000000254L);
1008 }
1009 
1010 template <>
1011 template <typename NumericType>
1012 inline constexpr void
1013 Conversion<Unit::Acceleration, Unit::Acceleration::MicroinchPerSquareMinute>::FromStandard(
1014  NumericType& value) noexcept {
1015  value *= static_cast<NumericType>(3600.0L) / static_cast<NumericType>(0.0000000254L);
1016 }
1017 
1018 template <>
1019 template <typename NumericType>
1020 inline constexpr void
1021 Conversion<Unit::Acceleration, Unit::Acceleration::MicroinchPerSquareMinute>::ToStandard(
1022  NumericType& value) noexcept {
1023  value *= static_cast<NumericType>(0.0000000254L) / static_cast<NumericType>(3600.0L);
1024 }
1025 
1026 template <>
1027 template <typename NumericType>
1028 inline constexpr void
1029 Conversion<Unit::Acceleration, Unit::Acceleration::MicroinchPerSquareHour>::FromStandard(
1030  NumericType& value) noexcept {
1031  value *= static_cast<NumericType>(12960000.0L) / static_cast<NumericType>(0.0000000254L);
1032 }
1033 
1034 template <>
1035 template <typename NumericType>
1036 inline constexpr void
1037 Conversion<Unit::Acceleration, Unit::Acceleration::MicroinchPerSquareHour>::ToStandard(
1038  NumericType& value) noexcept {
1039  value *= static_cast<NumericType>(0.0000000254L) / static_cast<NumericType>(12960000.0L);
1040 }
1041 
1042 template <typename NumericType>
1043 inline const std::map<Unit::Acceleration,
1044  std::function<void(NumericType* values, const std::size_t size)>>
1045  MapOfConversionsFromStandard<Unit::Acceleration, NumericType>{
1047  Conversions<Unit::Acceleration,
1048  Unit::Acceleration::MetrePerSquareSecond>::FromStandard<NumericType> },
1050  Conversions<Unit::Acceleration,
1051  Unit::Acceleration::MetrePerSquareMinute>::FromStandard<NumericType> },
1053  Conversions<Unit::Acceleration,
1054  Unit::Acceleration::MetrePerSquareHour>::FromStandard<NumericType> },
1056  Conversions<Unit::Acceleration,
1057  Unit::Acceleration::NauticalMilePerSquareSecond>::FromStandard<NumericType>},
1059  Conversions<Unit::Acceleration,
1060  Unit::Acceleration::NauticalMilePerSquareMinute>::FromStandard<NumericType>},
1062  Conversions<Unit::Acceleration,
1063  Unit::Acceleration::KnotPerHour>::FromStandard<NumericType> },
1065  Conversions<Unit::Acceleration,
1066  Unit::Acceleration::MilePerSquareSecond>::FromStandard<NumericType> },
1068  Conversions<Unit::Acceleration,
1069  Unit::Acceleration::MilePerSquareMinute>::FromStandard<NumericType> },
1071  Conversions<Unit::Acceleration,
1072  Unit::Acceleration::MilePerSquareHour>::FromStandard<NumericType> },
1074  Conversions<Unit::Acceleration,
1075  Unit::Acceleration::KilometrePerSquareSecond>::FromStandard<NumericType> },
1077  Conversions<Unit::Acceleration,
1078  Unit::Acceleration::KilometrePerSquareMinute>::FromStandard<NumericType> },
1080  Conversions<Unit::Acceleration,
1081  Unit::Acceleration::KilometrePerSquareHour>::FromStandard<NumericType> },
1083  Conversions<Unit::Acceleration,
1084  Unit::Acceleration::YardPerSquareSecond>::FromStandard<NumericType> },
1086  Conversions<Unit::Acceleration,
1087  Unit::Acceleration::YardPerSquareMinute>::FromStandard<NumericType> },
1089  Conversions<Unit::Acceleration,
1090  Unit::Acceleration::YardPerSquareHour>::FromStandard<NumericType> },
1092  Conversions<Unit::Acceleration,
1093  Unit::Acceleration::FootPerSquareSecond>::FromStandard<NumericType> },
1095  Conversions<Unit::Acceleration,
1096  Unit::Acceleration::FootPerSquareMinute>::FromStandard<NumericType> },
1098  Conversions<Unit::Acceleration,
1099  Unit::Acceleration::FootPerSquareHour>::FromStandard<NumericType> },
1101  Conversions<Unit::Acceleration,
1102  Unit::Acceleration::DecimetrePerSquareSecond>::FromStandard<NumericType> },
1104  Conversions<Unit::Acceleration,
1105  Unit::Acceleration::DecimetrePerSquareMinute>::FromStandard<NumericType> },
1107  Conversions<Unit::Acceleration,
1108  Unit::Acceleration::DecimetrePerSquareHour>::FromStandard<NumericType> },
1110  Conversions<Unit::Acceleration,
1111  Unit::Acceleration::InchPerSquareSecond>::FromStandard<NumericType> },
1113  Conversions<Unit::Acceleration,
1114  Unit::Acceleration::InchPerSquareMinute>::FromStandard<NumericType> },
1116  Conversions<Unit::Acceleration,
1117  Unit::Acceleration::InchPerSquareHour>::FromStandard<NumericType> },
1119  Conversions<Unit::Acceleration,
1120  Unit::Acceleration::CentimetrePerSquareSecond>::FromStandard<NumericType> },
1122  Conversions<Unit::Acceleration,
1123  Unit::Acceleration::CentimetrePerSquareMinute>::FromStandard<NumericType> },
1125  Conversions<Unit::Acceleration,
1126  Unit::Acceleration::CentimetrePerSquareHour>::FromStandard<NumericType> },
1128  Conversions<Unit::Acceleration,
1129  Unit::Acceleration::MillimetrePerSquareSecond>::FromStandard<NumericType> },
1131  Conversions<Unit::Acceleration,
1132  Unit::Acceleration::MillimetrePerSquareMinute>::FromStandard<NumericType> },
1134  Conversions<Unit::Acceleration,
1135  Unit::Acceleration::MillimetrePerSquareHour>::FromStandard<NumericType> },
1137  Conversions<Unit::Acceleration,
1138  Unit::Acceleration::MilliinchPerSquareSecond>::FromStandard<NumericType> },
1140  Conversions<Unit::Acceleration,
1141  Unit::Acceleration::MilliinchPerSquareMinute>::FromStandard<NumericType> },
1143  Conversions<Unit::Acceleration,
1144  Unit::Acceleration::MilliinchPerSquareHour>::FromStandard<NumericType> },
1146  Conversions<Unit::Acceleration,
1147  Unit::Acceleration::MicrometrePerSquareSecond>::FromStandard<NumericType> },
1149  Conversions<Unit::Acceleration,
1150  Unit::Acceleration::MicrometrePerSquareMinute>::FromStandard<NumericType> },
1152  Conversions<Unit::Acceleration,
1153  Unit::Acceleration::MicrometrePerSquareHour>::FromStandard<NumericType> },
1155  Conversions<Unit::Acceleration,
1156  Unit::Acceleration::MicroinchPerSquareSecond>::FromStandard<NumericType> },
1158  Conversions<Unit::Acceleration,
1159  Unit::Acceleration::MicroinchPerSquareMinute>::FromStandard<NumericType> },
1161  Conversions<Unit::Acceleration,
1162  Unit::Acceleration::MicroinchPerSquareHour>::FromStandard<NumericType> },
1163 };
1164 
1165 template <typename NumericType>
1166 inline const std::map<Unit::Acceleration,
1167  std::function<void(NumericType* const values, const std::size_t size)>>
1168  MapOfConversionsToStandard<Unit::Acceleration, NumericType>{
1170  Conversions<Unit::Acceleration,
1171  Unit::Acceleration::MetrePerSquareSecond>::ToStandard<NumericType> },
1173  Conversions<Unit::Acceleration,
1174  Unit::Acceleration::MetrePerSquareMinute>::ToStandard<NumericType> },
1176  Conversions<Unit::Acceleration,
1177  Unit::Acceleration::MetrePerSquareHour>::ToStandard<NumericType> },
1179  Conversions<Unit::Acceleration,
1180  Unit::Acceleration::NauticalMilePerSquareSecond>::ToStandard<NumericType> },
1182  Conversions<Unit::Acceleration,
1183  Unit::Acceleration::NauticalMilePerSquareMinute>::ToStandard<NumericType> },
1185  Conversions<Unit::Acceleration, Unit::Acceleration::KnotPerHour>::ToStandard<NumericType>},
1187  Conversions<Unit::Acceleration,
1188  Unit::Acceleration::MilePerSquareSecond>::ToStandard<NumericType> },
1190  Conversions<Unit::Acceleration,
1191  Unit::Acceleration::MilePerSquareMinute>::ToStandard<NumericType> },
1193  Conversions<Unit::Acceleration,
1194  Unit::Acceleration::MilePerSquareHour>::ToStandard<NumericType> },
1196  Conversions<Unit::Acceleration,
1197  Unit::Acceleration::KilometrePerSquareSecond>::ToStandard<NumericType> },
1199  Conversions<Unit::Acceleration,
1200  Unit::Acceleration::KilometrePerSquareMinute>::ToStandard<NumericType> },
1202  Conversions<Unit::Acceleration,
1203  Unit::Acceleration::KilometrePerSquareHour>::ToStandard<NumericType> },
1205  Conversions<Unit::Acceleration,
1206  Unit::Acceleration::YardPerSquareSecond>::ToStandard<NumericType> },
1208  Conversions<Unit::Acceleration,
1209  Unit::Acceleration::YardPerSquareMinute>::ToStandard<NumericType> },
1211  Conversions<Unit::Acceleration,
1212  Unit::Acceleration::YardPerSquareHour>::ToStandard<NumericType> },
1214  Conversions<Unit::Acceleration,
1215  Unit::Acceleration::FootPerSquareSecond>::ToStandard<NumericType> },
1217  Conversions<Unit::Acceleration,
1218  Unit::Acceleration::FootPerSquareMinute>::ToStandard<NumericType> },
1220  Conversions<Unit::Acceleration,
1221  Unit::Acceleration::FootPerSquareHour>::ToStandard<NumericType> },
1223  Conversions<Unit::Acceleration,
1224  Unit::Acceleration::DecimetrePerSquareSecond>::ToStandard<NumericType> },
1226  Conversions<Unit::Acceleration,
1227  Unit::Acceleration::DecimetrePerSquareMinute>::ToStandard<NumericType> },
1229  Conversions<Unit::Acceleration,
1230  Unit::Acceleration::DecimetrePerSquareHour>::ToStandard<NumericType> },
1232  Conversions<Unit::Acceleration,
1233  Unit::Acceleration::InchPerSquareSecond>::ToStandard<NumericType> },
1235  Conversions<Unit::Acceleration,
1236  Unit::Acceleration::InchPerSquareMinute>::ToStandard<NumericType> },
1238  Conversions<Unit::Acceleration,
1239  Unit::Acceleration::InchPerSquareHour>::ToStandard<NumericType> },
1241  Conversions<Unit::Acceleration,
1242  Unit::Acceleration::CentimetrePerSquareSecond>::ToStandard<NumericType> },
1244  Conversions<Unit::Acceleration,
1245  Unit::Acceleration::CentimetrePerSquareMinute>::ToStandard<NumericType> },
1247  Conversions<Unit::Acceleration,
1248  Unit::Acceleration::CentimetrePerSquareHour>::ToStandard<NumericType> },
1250  Conversions<Unit::Acceleration,
1251  Unit::Acceleration::MillimetrePerSquareSecond>::ToStandard<NumericType> },
1253  Conversions<Unit::Acceleration,
1254  Unit::Acceleration::MillimetrePerSquareMinute>::ToStandard<NumericType> },
1256  Conversions<Unit::Acceleration,
1257  Unit::Acceleration::MillimetrePerSquareHour>::ToStandard<NumericType> },
1259  Conversions<Unit::Acceleration,
1260  Unit::Acceleration::MilliinchPerSquareSecond>::ToStandard<NumericType> },
1262  Conversions<Unit::Acceleration,
1263  Unit::Acceleration::MilliinchPerSquareMinute>::ToStandard<NumericType> },
1265  Conversions<Unit::Acceleration,
1266  Unit::Acceleration::MilliinchPerSquareHour>::ToStandard<NumericType> },
1268  Conversions<Unit::Acceleration,
1269  Unit::Acceleration::MicrometrePerSquareSecond>::ToStandard<NumericType> },
1271  Conversions<Unit::Acceleration,
1272  Unit::Acceleration::MicrometrePerSquareMinute>::ToStandard<NumericType> },
1274  Conversions<Unit::Acceleration,
1275  Unit::Acceleration::MicrometrePerSquareHour>::ToStandard<NumericType> },
1277  Conversions<Unit::Acceleration,
1278  Unit::Acceleration::MicroinchPerSquareSecond>::ToStandard<NumericType> },
1280  Conversions<Unit::Acceleration,
1281  Unit::Acceleration::MicroinchPerSquareMinute>::ToStandard<NumericType> },
1283  Conversions<Unit::Acceleration,
1284  Unit::Acceleration::MicroinchPerSquareHour>::ToStandard<NumericType> },
1285 };
1286 
1287 } // namespace Internal
1288 
1289 } // namespace PhQ
1290 
1291 #endif // PHQ_UNIT_ACCELERATION_HPP
ElectricCurrent
Electric current units.
Mass
Mass units.
Definition: Mass.hpp:53
Length
Length units.
Definition: Length.hpp:53
SubstanceAmount
Amount of substance units.
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.
Temperature
Temperature units. Not to be confused with temperature difference units. For example,...
Definition: Temperature.hpp:55
Time
Time units.
Definition: Time.hpp:53
Namespace that encompasses all of the Physical Quantities library's content.
@ 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
std::ostream & operator<<(std::ostream &stream, const Acceleration< NumericType > &acceleration)