Trax3 3.1.0
trax track library
Loading...
Searching...
No Matches
DimensionedValues.h
1// trax track library
2// AD 2021
3//
4// "Jesus died for somebody's sins, but not mine"
5//
6// Patti Smith
7//
8// Copyright (c) 2025 Trend Redaktions- und Verlagsgesellschaft mbH
9// Copyright (c) 2019 Marc-Michael Horstmann
10//
11// Permission is hereby granted to any person obtaining a copy of this software
12// and associated source code (the "Software"), to use, view, and study the
13// Software for personal or internal business purposes, subject to the following
14// conditions:
15//
16// 1. Redistribution, modification, sublicensing, or commercial use of the
17// Software is NOT permitted without prior written consent from the copyright
18// holder.
19//
20// 2. The Software is provided "AS IS", without warranty of any kind, express
21// or implied.
22//
23// 3. All copies of the Software must retain this license notice.
24//
25// For further information, please contact: horstmann.marc@trendverlag.de
26
27#pragma once
28
171
172#include <cmath>
173#include <limits>
174#include <utility>
175
177namespace dim
178{
179 constexpr int DIM_VERSION_MAJOR = 3;
180 constexpr int DIM_VERSION_MINOR = 0;
181 constexpr int DIM_VERSION_PATCH = 0;
182
183#if defined( DIM_SINGLE )
184 typedef float Real;
185#elif defined( DIM_DOUBLE )
186 typedef double Real;
187#elif defined( DIM_LONG_DOUBLE )
188 typedef long double Real;
189#else
190 typedef float Real;
191#endif
192
193
196 constexpr Real kilograms_per_unit = 1;
197 constexpr Real meters_per_unit = 1;
198 constexpr Real seconds_per_unit = 1;
199
200
201 // derived units:
205
215
216
223 template<int L, int M, int T>
224 struct Dimension {
225 enum {
226 length = L,
227 mass = M,
228 time = T
229 };
230 };
231
232 template<typename Dimension>
233 class Value {
234 Real starkNakedNumber{ 0 };
235
236 public:
237 typedef Real real_type;
238
242 inline constexpr Value() noexcept = default;
243
244 inline explicit constexpr Value( const float units ) noexcept
245 : starkNakedNumber{ static_cast<Real>(units) }
246 {}
247 inline explicit constexpr Value( const double units ) noexcept
248 : starkNakedNumber( static_cast<Real>(units) )
249 {}
250 inline explicit constexpr Value( const int units ) noexcept
251 : starkNakedNumber{ static_cast<Real>(units) }
252 {}
254
258 inline constexpr Real Units() const noexcept {
259 return starkNakedNumber; // NOLINT(clang-analyzer-cplusplus.NewDelete)
260 }
261
269 //[[deprecated("Try to not use this. Use _xy(Value) or Value::Units() instead.")]]
270 inline explicit constexpr operator Real() const noexcept {
271 return starkNakedNumber;
272 }
273
274 inline explicit constexpr operator bool() const noexcept {
275 return starkNakedNumber != 0 ? true : false;
276 }
277 };
278
280 template<>
281 class Value<Dimension<0, 0, 0>> {
282 Real starkNakedNumber{ 0 };
283
284 public:
285 typedef Real real_type;
286
290 inline constexpr Value() noexcept = default;
291
292 inline constexpr Value( const float value ) noexcept
293 : starkNakedNumber{ static_cast<Real>(value) }
294 {}
295 inline constexpr Value( const double value ) noexcept
296 : starkNakedNumber{ static_cast<Real>(value) }
297 {}
298 inline constexpr Value( const int value ) noexcept
299 : starkNakedNumber{ static_cast<Real>(value) }
300 {}
302
306 inline constexpr Real Units() const noexcept {
307 return starkNakedNumber;
308 }
309
310 inline constexpr operator Real() const noexcept {
311 return starkNakedNumber;
312 }
313 };
314
315
316
321 using AnglePerLength = Value<Dimension<-1, 0, 0>>;
322 using PixelPerLength = Value<Dimension<-1, 0, 0>>;
323 using AngularVelocity = Value<Dimension<0, 0, -1>>;
328 using Density = Value<Dimension<-3, 1, 0>>;
330 using Frequency = Value<Dimension<0, 0, -1>>;
331 using Velocity = Value<Dimension<1, 0, -1>>;
332 using Acceleration = Value<Dimension<1, 0, -2>>;
333 using Force = Value<Dimension<1, 1, -2>>;
334 using Pressure = Value<Dimension<-1, 1, -2>>;
335 using Momentum = Value<Dimension<1, 1, -1>>;
336 using AngularMomentum = Value<Dimension<2, 1, -1>>;
337 using Torque = Value<Dimension<2, 1, -2>>;
338 using Energy = Value<Dimension<2, 1, -2>>;
339 using Power = Value<Dimension<2, 1, -3>>;
341
342
344 constexpr Real epsilon = std::numeric_limits<Real>::epsilon();
345 static_assert(epsilon > 0, "Too small an epsilon!");
346
347
349 constexpr Real infinite = std::numeric_limits<Real>::infinity();
350
353
376} // namespace dim
377
378namespace std {
379
381 template<int L, int M, int T>
382 class numeric_limits<dim::Value<dim::Dimension<L, M, T>>>
383 { // limits for type Value<Dimension<L,M,T>>
384 public:
387 static constexpr dim::Value<dim::Dimension<L, M, T>> (min)() noexcept
388 { // return minimum value
389 return dim::Value<dim::Dimension<L, M, T>>{(std::numeric_limits<dim::Real>::min)()};
390 }
391
392 static constexpr dim::Value<dim::Dimension<L, M, T>> (max)() noexcept
393 { // return maximum value
394 return dim::Value<dim::Dimension<L, M, T>>{(std::numeric_limits<dim::Real>::max)()};
395 }
396
397 static constexpr dim::Value<dim::Dimension<L, M, T>> lowest() noexcept
398 { // return most negative value
399 return dim::Value<dim::Dimension<L, M, T>>{std::numeric_limits<dim::Real>::lowest()};
400 }
401
402 static constexpr dim::Value<dim::Dimension<L, M, T>> epsilon() noexcept
403 { // return smallest effective increment from 1.0
404 return dim::Value<dim::Dimension<L, M, T>>{std::numeric_limits<dim::Real>::epsilon()};
405 }
406
407 static constexpr dim::Value<dim::Dimension<L, M, T>> round_error() noexcept
408 { // return largest rounding error
409 return dim::Value<dim::Dimension<L, M, T>>{std::numeric_limits<dim::Real>::round_error()};
410 }
411
412 static constexpr dim::Value<dim::Dimension<L, M, T>> denorm_min() noexcept
413 { // return minimum denormalized value
414 return dim::Value<dim::Dimension<L, M, T>>{std::numeric_limits<dim::Real>::denorm_min()};
415 }
416
417 static constexpr dim::Value<dim::Dimension<L, M, T>> infinity() noexcept
418 { // return positive infinity
419 return dim::Value<dim::Dimension<L, M, T>>{std::numeric_limits<dim::Real>::infinity()};
420 }
421
422 static constexpr dim::Value<dim::Dimension<L, M, T>> quiet_NaN() noexcept
423 { // return non-signaling NaN
424 return dim::Value<dim::Dimension<L, M, T>>{std::numeric_limits<dim::Real>::quiet_NaN()};
425 }
426
427 static constexpr dim::Value<dim::Dimension<L, M, T>> signaling_NaN() noexcept
428 { // return signaling NaN
429 return dim::Value<dim::Dimension<L, M, T>>{std::numeric_limits<dim::Real>::signaling_NaN()};
430 }
431
432 static constexpr int digits = std::numeric_limits<dim::Real>::digits;
433 static constexpr int digits10 = std::numeric_limits<dim::Real>::digits10;
434 static constexpr int max_digits10 = std::numeric_limits<dim::Real>::max_digits10;
435 static constexpr int max_exponent = std::numeric_limits<dim::Real>::max_exponent;
436 static constexpr int max_exponent10 = std::numeric_limits<dim::Real>::max_exponent10;
437 static constexpr int min_exponent = std::numeric_limits<dim::Real>::min_exponent;
438 static constexpr int min_exponent10 = std::numeric_limits<dim::Real>::min_exponent10;
439
440#if __cplusplus <= 202002L
441 static constexpr float_denorm_style has_denorm = std::numeric_limits<dim::Real>::has_denorm;
442#endif
443 static constexpr bool has_infinity = std::numeric_limits<dim::Real>::has_infinity;
444 static constexpr bool has_quiet_NaN = std::numeric_limits<dim::Real>::has_quiet_NaN;
445 static constexpr bool has_signaling_NaN = std::numeric_limits<dim::Real>::has_signaling_NaN;
446 static constexpr bool is_bounded = std::numeric_limits<dim::Real>::is_bounded;
447 static constexpr bool is_iec559 = std::numeric_limits<dim::Real>::is_iec559;
448 static constexpr bool is_signed = std::numeric_limits<dim::Real>::is_signed;
449 static constexpr bool is_specialized = std::numeric_limits<dim::Real>::is_specialized;
450 static constexpr float_round_style round_style = std::numeric_limits<dim::Real>::round_style;
451 static constexpr int radix = std::numeric_limits<dim::Real>::radix;
452
453#if __cplusplus <= 202002L
454 static constexpr bool has_denorm_loss = std::numeric_limits<dim::Real>::has_denorm_loss;
455#endif
456 static constexpr bool is_exact = std::numeric_limits<dim::Real>::is_exact;
457 static constexpr bool is_integer = std::numeric_limits<dim::Real>::is_integer;
458 static constexpr bool is_modulo = std::numeric_limits<dim::Real>::is_modulo;
459 static constexpr bool tinyness_before = std::numeric_limits<dim::Real>::tinyness_before;
460 static constexpr bool traps = std::numeric_limits<dim::Real>::traps;
462 };
463}
464
465namespace dim{
466
469
471 template<int L,int M,int T> inline
473 return Value<Dimension<L,M,T>>{ a.Units() + b.Units() };
474 }
475 template<int L,int M,int T> inline
477 a = Value<Dimension<L,M,T>>{ a.Units() + b.Units() };
478 return a;
479 }
480 template<int L,int M,int T> inline
481 constexpr Value<Dimension<L,M,T>> operator+( const Value<Dimension<L,M,T>>& a ) noexcept{
482 return Value<Dimension<L,M,T>>{ +a.Units() };
483 }
484
485 template<int L,int M,int T> inline
487 return Value<Dimension<L,M,T>>{ a.Units() - b.Units() };
488 }
489 template<int L,int M,int T> inline
491 a = Value<Dimension<L,M,T>>{ a.Units() - b.Units() };
492 return a;
493 }
494 template<int L,int M,int T> inline
495 constexpr Value<Dimension<L,M,T>> operator-( const Value<Dimension<L,M,T>>& a ) noexcept{
496 return Value<Dimension<L,M,T>>{ -a.Units() };
497 }
498
499 template<int La,int Ma,int Ta,int Lb,int Mb,int Tb>
501 return Value<Dimension<La+Lb,Ma+Mb,Ta+Tb>>{ a.Units() * b.Units() };
502 }
503
504 template<int L,int M,int T> inline
505 constexpr Value<Dimension<L,M,T>> operator*( const Value<Dimension<L,M,T>>& a, float b ) noexcept{
506 return Value<Dimension<L,M,T>>{ a.Units() * b };
507 }
508
509 template<int L,int M,int T> inline
510 constexpr Value<Dimension<L,M,T>> operator*( const Value<Dimension<L,M,T>>& a, double b ) noexcept{
511 return Value<Dimension<L,M,T>>{ a.Units() * b };
512 }
513
514 template<int L,int M,int T> inline
515 constexpr Value<Dimension<L,M,T>> operator*( const Value<Dimension<L,M,T>>& a, int b ) noexcept{
516 return Value<Dimension<L,M,T>>{ a.Units() * static_cast<Real>(b) };
517 }
518
519 template<int L, int M, int T> inline
520 constexpr Value<Dimension<L, M, T>> operator*( const Value<Dimension<L, M, T>>& a, size_t b ) noexcept{
521 return Value<Dimension<L, M, T>>{ a.Units() * static_cast<Real>(b) };
522 }
523
524 template<int L,int M,int T> inline
525 constexpr Value<Dimension<L,M,T>> operator*( float a, const Value<Dimension<L,M,T>>& b ) noexcept{
526 return b * a;
527 }
528
529 template<int L,int M,int T> inline
530 constexpr Value<Dimension<L,M,T>> operator*( double a, const Value<Dimension<L,M,T>>& b ) noexcept{
531 return b * a;
532 }
533
534 template<int L,int M,int T> inline
535 constexpr Value<Dimension<L,M,T>> operator*( int a, const Value<Dimension<L,M,T>>& b ) noexcept{
536 return b * a;
537 }
538
539 template<int L,int M,int T> inline
540 constexpr Value<Dimension<L,M,T>>& operator*=( Value<Dimension<L,M,T>>& a, float b ) noexcept{
541 a = Value<Dimension<L,M,T>>{ a.Units() * b };
542 return a;
543 }
544
545 template<int L,int M,int T> inline
546 constexpr Value<Dimension<L,M,T>>& operator*=( Value<Dimension<L,M,T>>& a, double b ) noexcept{
547 a = Value<Dimension<L,M,T>>{ a.Units() * b };
548 return a;
549 }
550
551 template<int L,int M,int T> inline
552 constexpr Value<Dimension<L,M,T>>& operator*=( Value<Dimension<L,M,T>>& a, int b ) noexcept{
553 a = Value<Dimension<L,M,T>>{ a.Units() * static_cast<Real>(b) };
554 return a;
555 }
556
557 template<int L, int M, int T> inline
558 constexpr Value<Dimension<L, M, T>>& operator*=( Value<Dimension<L, M, T>>& a, size_t b ) noexcept{
559 a = Value<Dimension<L, M, T>>{ a.Units() * static_cast<Real>(b) };
560 return a;
561 }
562
563#if defined(_MSC_VER)
564# pragma warning(push)
565# pragma warning(disable: 4723) //disable: 4723, potential divide by 0
566#endif
567 template<int La,int Ma,int Ta,int Lb,int Mb,int Tb>
568 constexpr Value<Dimension<La-Lb,Ma-Mb,Ta-Tb>> operator/( const Value<Dimension<La,Ma,Ta>>& a, const Value<Dimension<Lb,Mb,Tb>>& b ) noexcept{
569 return Value<Dimension<La-Lb,Ma-Mb,Ta-Tb>>{ a.Units() / b.Units() };
570 }
571#if defined(_MSC_VER)
572# pragma warning(pop)
573#endif
574
575 template<int L,int M,int T> inline
576 constexpr Value<Dimension<L,M,T>> operator/( const Value<Dimension<L,M,T>>& a, float b ) noexcept{
577 return Value<Dimension<L,M,T>>{ a.Units() / b };
578 }
579
580 template<int L,int M,int T> inline
581 constexpr Value<Dimension<L,M,T>> operator/( const Value<Dimension<L,M,T>>& a, double b ) noexcept{
582 return Value<Dimension<L,M,T>>{ a.Units() / b };
583 }
584
585 template<int L,int M,int T> inline
586 constexpr Value<Dimension<L,M,T>> operator/( const Value<Dimension<L,M,T>>& a, int b ) noexcept{
587 return Value<Dimension<L,M,T>>{ a.Units() / static_cast<Real>(b) };
588 }
589
590 template<int L, int M, int T> inline
591 constexpr Value<Dimension<L, M, T>> operator/( const Value<Dimension<L, M, T>>& a, size_t b ) noexcept{
592 return Value<Dimension<L, M, T>>{ a.Units() / static_cast<Real>(b) };
593 }
594
595 template<int L,int M,int T> inline
596 constexpr Value<Dimension<-L,-M,-T>> operator/( float a, const Value<Dimension<L,M,T>>& b ) noexcept{
597 return Value<Dimension<-L,-M,-T>>{ a / b.Units() };
598 }
599
600 template<int L,int M,int T> inline
601 constexpr Value<Dimension<-L,-M,-T>> operator/( double a, const Value<Dimension<L,M,T>>& b ) noexcept{
602 return Value<Dimension<-L,-M,-T>>{ a / b.Units() };
603 }
604
605 template<int L,int M,int T> inline
606 constexpr Value<Dimension<-L,-M,-T>> operator/( int a, const Value<Dimension<L,M,T>>& b ) noexcept{
607 return Value<Dimension<-L,-M,-T>>{ static_cast<Real>(a) / b.Units() };
608 }
609
610 template<int L,int M,int T> inline
611 constexpr Value<Dimension<L,M,T>>& operator/=( Value<Dimension<L,M,T>>& a, float b ) noexcept{
612 a = Value<Dimension<L,M,T>>{ a.Units() / b };
613 return a;
614 }
615
616 template<int L,int M,int T> inline
617 constexpr Value<Dimension<L,M,T>>& operator/=( Value<Dimension<L,M,T>>& a, double b ) noexcept{
618 a = Value<Dimension<L,M,T>>{ a.Units() / b };
619 return a;
620 }
621
622 template<int L,int M,int T> inline
623 constexpr Value<Dimension<L,M,T>>& operator/=( Value<Dimension<L,M,T>>& a, int b ) noexcept{
624 a = Value<Dimension<L,M,T>>{ a.Units() / static_cast<Real>(b) };
625 return a;
626 }
627
628 template<int L, int M, int T> inline
629 constexpr Value<Dimension<L, M, T>>& operator/=( Value<Dimension<L, M, T>>& a, size_t b ) noexcept{
630 a = Value<Dimension<L, M, T>>{ a.Units() / static_cast<Real>(b) };
631 return a;
632 }
633
634 template<int L,int M,int T> inline
635 constexpr bool operator==( const Value<Dimension<L,M,T>>& a, const Value<Dimension<L,M,T>>& b ) noexcept{
636 return a.Units() == b.Units();
637 }
638
639 template<int L,int M,int T> inline
640 constexpr bool operator!=( const Value<Dimension<L,M,T>>& a, const Value<Dimension<L,M,T>>& b ) noexcept{
641 return a.Units() != b.Units();
642 }
643
644 template<int L,int M,int T> inline
645 constexpr bool operator<( const Value<Dimension<L,M,T>>& a, const Value<Dimension<L,M,T>>& b ) noexcept{
646 return a.Units() < b.Units();
647 }
648
649 template<int L,int M,int T> inline
650 constexpr bool operator>( const Value<Dimension<L,M,T>>& a, const Value<Dimension<L,M,T>>& b ) noexcept{
651 return a.Units() > b.Units();
652 }
653
654 template<int L,int M,int T> inline
655 constexpr bool operator<=( const Value<Dimension<L,M,T>>& a, const Value<Dimension<L,M,T>>& b ) noexcept{
656 return a.Units() <= b.Units();
657 }
658 template<int L,int M,int T> inline
659 constexpr bool operator>=( const Value<Dimension<L,M,T>>& a, const Value<Dimension<L,M,T>>& b ) noexcept{
660 return a.Units() >= b.Units();
661 }
662
663
664
667
669 template<int L,int M,int T>
670 constexpr Value<Dimension<L/2,M/2,T/2>> sqrt( Value<Dimension<L,M,T>> a ) noexcept{
671 return Value<Dimension<L/2,M/2,T/2>>{ std::sqrt(a.Units()) };
672 }
673
674 template<int Y,int L,int M,int T>
676 return Value<Dimension<Y*L,Y*M,Y*T>>{ std::pow(x.Units(),static_cast<Real>(Y)) };
677 }
678
679 template<int L,int M,int T>
681 return Value<Dimension<L,M,T>>{ std::abs(x.Units()) };
682 }
683
684 template<int L,int M,int T>
686 return Value<Dimension<L,M,T>>{ std::fabs(x.Units()) };
687 }
688
689 template<int L,int M,int T>
691 return Value<Dimension<L,M,T>>{ std::round(x.Units()) };
692 }
693
694 constexpr inline Value<Dimension<0,0,0>> sin( Value<Dimension<0,0,0>> a ) noexcept{
695 return Value<Dimension<0,0,0>>{ std::sin(a.Units()) };
696 }
697
698 constexpr inline Value<Dimension<0,0,0>> cos( Value<Dimension<0,0,0>> a ) noexcept{
699 return Value<Dimension<0,0,0>>{ std::cos(a.Units()) };
700 }
701
702 constexpr inline Value<Dimension<0,0,0>> tan( Value<Dimension<0,0,0>> a ) noexcept{
703 return Value<Dimension<0,0,0>>{ std::tan(a.Units()) };
704 }
705
706 constexpr inline Value<Dimension<0,0,0>> asin( Value<Dimension<0,0,0>> a ) noexcept{
707 return Value<Dimension<0,0,0>>{ std::asin(a.Units()) };
708 }
709
710 constexpr inline Value<Dimension<0,0,0>> acos( Value<Dimension<0,0,0>> a ) noexcept{
711 return Value<Dimension<0,0,0>>{ std::acos(a.Units()) };
712 }
713
714 constexpr inline Value<Dimension<0,0,0>> atan( Value<Dimension<0,0,0>> a ) noexcept{
715 return Value<Dimension<0,0,0>>{ std::atan(a.Units()) };
716 }
717
718 template<int L,int M,int T>
720 return Value<Dimension<0,0,0>>{ std::atan2(y.Units(),x.Units()) };
721 }
722
723 template<int L,int M,int T>
724 constexpr bool isnan( Value<Dimension<L,M,T>> x ){
725 return std::isnan(x.Units());
726 }
727
728 template<int L,int M,int T>
729 constexpr Value<Dimension<L,M,T>> nextafter( Value<Dimension<L,M,T>> x, float y ) noexcept{
730 return Value<Dimension<L,M,T>>{ std::nextafter(x.Units(),y) };
731 }
732
733 template<int L,int M,int T>
734 constexpr Value<Dimension<L,M,T>> nexttoward( Value<Dimension<L,M,T>> x, long double y ) noexcept{
735 return Value<Dimension<L,M,T>>{ std::nexttoward(x.Units(),y) };
736 }
737
738 template<int L,int M,int T>
740 return Value<Dimension<L,M,T>>{ std::ldexp(x.Units(),exp) };
741 }
742
743
744 inline namespace literals{
745
748
750 constexpr Value<Dimension<-1,0,0>> operator"" _1Ikm( const unsigned long long int value ){
751 return Value<Dimension<-1,0,0>>{ static_cast<Real>(value) * meters_per_unit / 1000 };
752 }
753
754 constexpr Value<Dimension<-1,0,0>> operator"" _1Ikm( const long double value ){
755 return Value<Dimension<-1,0,0>>{ static_cast<Real>(value) * meters_per_unit / 1000 };
756 }
757
758 constexpr Value<Dimension<-1,0,0>> operator"" _1Im( const unsigned long long int value ){
759 return Value<Dimension<-1,0,0>>{ static_cast<Real>(value) * meters_per_unit };
760 }
761
762 constexpr Value<Dimension<-1,0,0>> operator"" _1Im( const long double value ){
763 return Value<Dimension<-1,0,0>>{ static_cast<Real>(value) * meters_per_unit };
764 }
765
766 constexpr Value<Dimension<-1,0,0>> operator"" _1Icm( const unsigned long long int value ){
767 return Value<Dimension<-1,0,0>>{ static_cast<Real>(value) * meters_per_unit * 100 };
768 }
769
770 constexpr Value<Dimension<-1,0,0>> operator"" _1Icm( const long double value ){
771 return Value<Dimension<-1,0,0>>{ static_cast<Real>(value) * meters_per_unit * 100 };
772 }
773
774 constexpr Value<Dimension<-2,0,0>> operator"" _1Im2( const unsigned long long int value ){
775 return Value<Dimension<-2,0,0>>{ static_cast<Real>(value) * meters_per_unit * meters_per_unit };
776 }
777
778 constexpr Value<Dimension<-2,0,0>> operator"" _1Im2( const long double value ){
779 return Value<Dimension<-2,0,0>>{ static_cast<Real>(value) * meters_per_unit * meters_per_unit };
780 }
781
782 constexpr Value<Dimension<0,0,-1>> operator"" _1Is( const unsigned long long int value ){
783 return Value<Dimension<0,0,-1>>{ static_cast<Real>(value) / units_per_second };
784 }
785
786 constexpr Value<Dimension<0,0,-1>> operator"" _1Is( const long double value ){
787 return Value<Dimension<0,0,-1>>{ static_cast<Real>(value) / units_per_second };
788 }
789
790 constexpr Value<Dimension<1,0,0>> operator"" _mm( const unsigned long long int value ){
791 return Value<Dimension<1,0,0>>{ static_cast<Real>(value) * units_per_meter / 1000 };
792 }
793
794 constexpr Value<Dimension<1,0,0>> operator"" _mm( const long double value ){
795 return Value<Dimension<1,0,0>>{ static_cast<Real>(value) * units_per_meter / 1000 };
796 }
797
798 constexpr Value<Dimension<1,0,0>> operator"" _cm( const unsigned long long int value ){
799 return Value<Dimension<1,0,0>>{ static_cast<Real>(value) * units_per_meter / 100 };
800 }
801
802 constexpr Value<Dimension<1,0,0>> operator"" _cm( const long double value ){
803 return Value<Dimension<1,0,0>>{ static_cast<Real>(value) * units_per_meter / 100 };
804 }
805
806 constexpr Value<Dimension<1,0,0>> operator"" _dm( const unsigned long long int value ){
807 return Value<Dimension<1,0,0>>{ static_cast<Real>(value) * units_per_meter / 10 };
808 }
809
810 constexpr Value<Dimension<1,0,0>> operator"" _dm( const long double value ){
811 return Value<Dimension<1,0,0>>{ static_cast<Real>(value) * units_per_meter / 10 };
812 }
813
814 constexpr Value<Dimension<1,0,0>> operator"" _m( const unsigned long long int value ){
815 return Value<Dimension<1,0,0>>{ static_cast<Real>(value) * units_per_meter };
816 }
817
818 constexpr Value<Dimension<1,0,0>> operator"" _m( const long double value ){
819 return Value<Dimension<1,0,0>>{ static_cast<Real>(value) * units_per_meter };
820 }
821
822 constexpr Value<Dimension<1,0,0>> operator"" _km( const unsigned long long int value ){
823 return Value<Dimension<1,0,0>>{ static_cast<Real>(value) * 1000 * units_per_meter };
824 }
825
826 constexpr Value<Dimension<1,0,0>> operator"" _km( const long double value ){
827 return Value<Dimension<1,0,0>>{ static_cast<Real>(value) * 1000 * units_per_meter };
828 }
829
830 constexpr Value<Dimension<1,0,0>> operator"" _mi( const unsigned long long int value ){
831 return Value<Dimension<1,0,0>>{ static_cast<Real>(value) * 1000 * units_per_meter * 25146/15625 };
832 }
833
834 constexpr Value<Dimension<1,0,0>> operator"" _mi( const long double value ){
835 return Value<Dimension<1,0,0>>{ static_cast<Real>(value) * 1000 * units_per_meter * 25146/15625 };
836 }
837
838 constexpr Value<Dimension<1,0,0>> operator"" _nmi( const unsigned long long int value ){
839 return Value<Dimension<1,0,0>>{ static_cast<Real>(value) * units_per_meter * 1852 };
840 }
841
842 constexpr Value<Dimension<1,0,0>> operator"" _nmi( const long double value ){
843 return Value<Dimension<1,0,0>>{ static_cast<Real>(value) * units_per_meter * 1852 };
844 }
845
846 constexpr Value<Dimension<1,0,0>> operator"" _yd( const unsigned long long int value ){
847 return Value<Dimension<1,0,0>>{ static_cast<Real>(value) * units_per_meter * 0.3048f * 3 };
848 }
849
850 constexpr Value<Dimension<1,0,0>> operator"" _yd( const long double value ){
851 return Value<Dimension<1,0,0>>{ static_cast<Real>(value) * units_per_meter * 0.3048f * 3 };
852 }
853
854 constexpr Value<Dimension<1,0,0>> operator"" _ft( const unsigned long long int value ){
855 return Value<Dimension<1,0,0>>{ static_cast<Real>(value) * units_per_meter * 0.3048f };
856 }
857
858 constexpr Value<Dimension<1,0,0>> operator"" _ft( const long double value ){
859 return Value<Dimension<1,0,0>>{ static_cast<Real>(value) * units_per_meter * 0.3048f };
860 }
861
862 constexpr Value<Dimension<1,0,0>> operator"" _in( const unsigned long long int value ){
863 return Value<Dimension<1,0,0>>{ static_cast<Real>(value) * units_per_meter * 0.3048f/12 };
864 }
865
866 constexpr Value<Dimension<1,0,0>> operator"" _in( const long double value ){
867 return Value<Dimension<1,0,0>>{ static_cast<Real>(value) * units_per_meter * 0.3048f/12 };
868 }
869
870 constexpr Value<Dimension<2,0,0>> operator"" _cm2( const unsigned long long int value ){
871 return Value<Dimension<2,0,0>>{ static_cast<Real>(value) * units_per_meter / 100 * units_per_meter / 100 };
872 }
873
874 constexpr Value<Dimension<2,0,0>> operator"" _cm2( const long double value ){
875 return Value<Dimension<2,0,0>>{ static_cast<Real>(value) * units_per_meter / 100 * units_per_meter / 100 };
876 }
877
878 constexpr Value<Dimension<2,0,0>> operator"" _m2( const unsigned long long int value ){
879 return Value<Dimension<2,0,0>>{ static_cast<Real>(value) * units_per_meter * units_per_meter };
880 }
881
882 constexpr Value<Dimension<2,0,0>> operator"" _m2( const long double value ){
883 return Value<Dimension<2,0,0>>{ static_cast<Real>(value) * units_per_meter * units_per_meter };
884 }
885
886 constexpr Value<Dimension<3,0,0>> operator"" _m3( const unsigned long long int value ){
888 }
889
890 constexpr Value<Dimension<3,0,0>> operator"" _m3( const long double value ){
892 }
893
894 constexpr Value<Dimension<0,1,0>> operator"" _g( const unsigned long long int value ){
895 return Value<Dimension<0,1,0>>{ static_cast<Real>(value) * units_per_kilogram / 1000 };
896 }
897
898 constexpr Value<Dimension<0,1,0>> operator"" _g( const long double value ){
899 return Value<Dimension<0,1,0>>{ static_cast<Real>(value) * units_per_kilogram / 1000 };
900 }
901
902 constexpr Value<Dimension<0,1,0>> operator"" _kg( const unsigned long long int value ){
903 return Value<Dimension<0,1,0>>{ static_cast<Real>(value) * units_per_kilogram };
904 }
905
906 constexpr Value<Dimension<0,1,0>> operator"" _kg( const long double value ){
907 return Value<Dimension<0,1,0>>{ static_cast<Real>(value) * units_per_kilogram };
908 }
909
910 constexpr Value<Dimension<0,1,0>> operator"" _t( const unsigned long long int value ){
911 return Value<Dimension<0,1,0>>{ static_cast<Real>(value) * 1000 * units_per_kilogram };
912 }
913
914 constexpr Value<Dimension<0,1,0>> operator"" _t( const long double value ){
915 return Value<Dimension<0,1,0>>{ static_cast<Real>(value) * 1000 * units_per_kilogram };
916 }
917
918 constexpr Value<Dimension<-3,1,0>> operator"" _gIcm3( const unsigned long long int value ){
919 return Value<Dimension<-3,1,0>>{ static_cast<Real>(value) * 1000 * units_per_kilogram / units_per_meter / units_per_meter / units_per_meter };
920 }
921
922 constexpr Value<Dimension<-3,1,0>> operator"" _gIcm3( const long double value ){
923 return Value<Dimension<-3,1,0>>{ static_cast<Real>(value) * 1000 * units_per_kilogram / units_per_meter / units_per_meter / units_per_meter };
924 }
925
926 constexpr Value<Dimension<-3,1,0>> operator"" _kgIm3( const unsigned long long int value ){
927 return Value<Dimension<-3,1,0>>{ static_cast<Real>(value) * units_per_kilogram / units_per_meter / units_per_meter / units_per_meter };
928 }
929
930 constexpr Value<Dimension<-3,1,0>> operator"" _kgIm3( const long double value ){
931 return Value<Dimension<-3,1,0>>{ static_cast<Real>(value) * units_per_kilogram / units_per_meter / units_per_meter / units_per_meter };
932 }
933
934 constexpr Value<Dimension<-3,1,0>> operator"" _tIm3( const unsigned long long int value ){
935 return Value<Dimension<-3,1,0>>{ static_cast<Real>(value) * 1000 * units_per_kilogram / units_per_meter / units_per_meter / units_per_meter };
936 }
937
938 constexpr Value<Dimension<-3,1,0>> operator"" _tIm3( const long double value ){
939 return Value<Dimension<-3,1,0>>{ static_cast<Real>(value) * 1000 * units_per_kilogram / units_per_meter / units_per_meter / units_per_meter };
940 }
941
942 constexpr Value<Dimension<0,0,1>> operator"" _h( const unsigned long long int value ){
943 return Value<Dimension<0,0,1>>{ static_cast<Real>(value) * 60 * 60 / seconds_per_unit };
944 }
945
946 constexpr Value<Dimension<0,0,1>> operator"" _h( const long double value ){
947 return Value<Dimension<0,0,1>>{ static_cast<Real>(value) * 60 * 60 / seconds_per_unit };
948 }
949
950 constexpr Value<Dimension<0,0,1>> operator"" _s( const unsigned long long int value ){
951 return Value<Dimension<0,0,1>>{ static_cast<Real>(value) / seconds_per_unit };
952 }
953
954 constexpr Value<Dimension<0,0,1>> operator"" _s( const long double value ){
955 return Value<Dimension<0,0,1>>{ static_cast<Real>(value) / seconds_per_unit };
956 }
957
958 constexpr Value<Dimension<0,0,1>> operator"" _ms( const unsigned long long int value ){
959 return Value<Dimension<0,0,1>>{ static_cast<Real>(value) / seconds_per_unit / 1000 };
960 }
961
962 constexpr Value<Dimension<0,0,1>> operator"" _ms( const long double value ){
963 return Value<Dimension<0,0,1>>{ static_cast<Real>(value) / seconds_per_unit / 1000 };
964 }
965
966 constexpr Value<Dimension<1,0,-1>> operator"" _cmIs( const unsigned long long int value ){
967 return Value<Dimension<1,0,-1>>{ static_cast<Real>(value) / 100 * units_per_meter / units_per_second };
968 }
969
970 constexpr Value<Dimension<1,0,-1>> operator"" _cmIs( const long double value ){
971 return Value<Dimension<1,0,-1>>{ static_cast<Real>(value) / 100 * units_per_meter / units_per_second };
972 }
973
974 constexpr Value<Dimension<1,0,-1>> operator"" _mIs( const unsigned long long int value ){
975 return Value<Dimension<1,0,-1>>{ static_cast<Real>(value) * units_per_meter / units_per_second };
976 }
977
978 constexpr Value<Dimension<1,0,-1>> operator"" _mIs( const long double value ){
979 return Value<Dimension<1,0,-1>>{ static_cast<Real>(value) * units_per_meter / units_per_second };
980 }
981
982 constexpr Value<Dimension<1,0,-1>> operator"" _kmIh( const unsigned long long int value ){
983 return Value<Dimension<1,0,-1>>{ static_cast<Real>(value) / 3.6f * units_per_meter };
984 }
985
986 constexpr Value<Dimension<1,0,-1>> operator"" _kmIh( const long double value ){
987 return Value<Dimension<1,0,-1>>{ static_cast<Real>(value) / 3.6f * units_per_meter };
988 }
989
990 constexpr Value<Dimension<1,0,-1>> operator"" _miIh( const unsigned long long int value ){
991 return Value<Dimension<1,0,-1>>{ static_cast<Real>(value) * 0.44704 * units_per_meter / units_per_second };
992 }
993
994 constexpr Value<Dimension<1,0,-1>> operator"" _miIh( const long double value ){
995 return Value<Dimension<1,0,-1>>{ static_cast<Real>(value) * 0.44704 * units_per_meter / units_per_second };
996 }
997
998 constexpr Value<Dimension<1,0,-1>> operator"" _mph( const unsigned long long int value ){
999 return Value<Dimension<1,0,-1>>{ static_cast<Real>(value) * 0.44704 * units_per_meter / units_per_second };
1000 }
1001
1002 constexpr Value<Dimension<1,0,-1>> operator"" _mph( const long double value ){
1003 return Value<Dimension<1,0,-1>>{ static_cast<Real>(value) * 0.44704 * units_per_meter / units_per_second };
1004 }
1005
1006 constexpr Value<Dimension<1,0,-2>> operator"" _mIs2( const unsigned long long int value ){
1007 return Value<Dimension<1,0,-2>>{ static_cast<Real>(value) * units_per_meter / units_per_second / units_per_second};
1008 }
1009
1010 constexpr Value<Dimension<1,0,-2>> operator"" _mIs2( const long double value ){
1011 return Value<Dimension<1,0,-2>>{ static_cast<Real>(value) * units_per_meter / units_per_second / units_per_second };
1012 }
1013
1014 constexpr Value<Dimension<1,1,-2>> operator"" _N( const unsigned long long int value ){
1015 return Value<Dimension<1,1,-2>>{ static_cast<Real>(value) * units_per_newton };
1016 }
1017
1018 constexpr Value<Dimension<1,1,-2>> operator"" _N( const long double value ){
1019 return Value<Dimension<1,1,-2>>{ static_cast<Real>(value) * units_per_newton };
1020 }
1021
1022 constexpr Value<Dimension<1,1,-2>> operator"" _kN( const unsigned long long int value ){
1023 return Value<Dimension<1,1,-2>>{ static_cast<Real>(value) * 1000 * units_per_newton };
1024 }
1025
1026 constexpr Value<Dimension<1,1,-2>> operator"" _kN( const long double value ){
1027 return Value<Dimension<1,1,-2>>{ static_cast<Real>(value) * 1000 * units_per_newton };
1028 }
1029
1030 constexpr Value<Dimension<-1,1,-2>> operator"" _Pa( const unsigned long long int value ){
1031 return Value<Dimension<-1,1,-2>>{ static_cast<Real>(value) * units_per_pascal };
1032 }
1033
1034 constexpr Value<Dimension<-1,1,-2>> operator"" _Pa( const long double value ){
1035 return Value<Dimension<-1,1,-2>>{ static_cast<Real>(value) * units_per_pascal };
1036 }
1037
1038 constexpr Value<Dimension<-1, 1, -2>> operator"" _kPa( const unsigned long long int value ){
1039 return Value<Dimension<-1, 1, -2>>{ static_cast<Real>(value) * 1000 * units_per_pascal };
1040 }
1041
1042 constexpr Value<Dimension<-1, 1, -2>> operator"" _kPa( const long double value ){
1043 return Value<Dimension<-1, 1, -2>>{ static_cast<Real>(value) * 1000 * units_per_pascal };
1044 }
1045
1046 constexpr Value<Dimension<-1, 1, -2>> operator"" _bar( const unsigned long long int value ){
1047 return Value<Dimension<-1, 1, -2>>{ static_cast<Real>(value) * 100 * 1000 * units_per_pascal };
1048 }
1049
1050 constexpr Value<Dimension<-1, 1, -2>> operator"" _bar( const long double value ){
1051 return Value<Dimension<-1, 1, -2>>{ static_cast<Real>(value) * 100 * 1000 * units_per_pascal };
1052 }
1053
1054 constexpr Value<Dimension<2,1,-2>> operator"" _Nm( const unsigned long long int value ){
1055 return Value<Dimension<2,1,-2>>{ static_cast<Real>(value) * units_per_newton * units_per_meter };
1056 }
1057
1058 constexpr Value<Dimension<2,1,-2>> operator"" _Nm( const long double value ){
1059 return Value<Dimension<2,1,-2>>{ static_cast<Real>(value) * units_per_newton * units_per_meter };
1060 }
1061
1062 constexpr Value<Dimension<2,1,-2>> operator"" _kNm( const unsigned long long int value ){
1063 return Value<Dimension<2,1,-2>>{ static_cast<Real>(value) * 1000 * units_per_newton * units_per_meter };
1064 }
1065
1066 constexpr Value<Dimension<2,1,-2>> operator"" _kNm( const long double value ){
1067 return Value<Dimension<2,1,-2>>{ static_cast<Real>(value) * 1000 * units_per_newton * units_per_meter };
1068 }
1069
1070 constexpr Value<Dimension<1,1,-1>> operator"" _Ns( const unsigned long long int value ){
1071 return Value<Dimension<1,1,-1>>{ static_cast<Real>(value) * units_per_newton * units_per_second };
1072 }
1073
1074 constexpr Value<Dimension<1,1,-1>> operator"" _Ns( const long double value ){
1075 return Value<Dimension<1,1,-1>>{ static_cast<Real>(value) * units_per_newton * units_per_second };
1076 }
1077
1078 constexpr Value<Dimension<2,1,-1>> operator"" _Nms( const unsigned long long int value ){
1079 return Value<Dimension<2,1,-1>>{ static_cast<Real>(value) * units_per_newton * units_per_meter * units_per_second };
1080 }
1081
1082 constexpr Value<Dimension<2,1,-1>> operator"" _Nms( const long double value ){
1083 return Value<Dimension<2,1,-1>>{ static_cast<Real>(value) * units_per_newton * units_per_meter * units_per_second };
1084 }
1085
1086 constexpr Value<Dimension<2,1,-2>> operator"" _J( const unsigned long long int value ){
1088 }
1089
1090 constexpr Value<Dimension<2,1,-2>> operator"" _J( const long double value ){
1092 }
1093
1094 constexpr Value<Dimension<2,1,-3>> operator"" _W( const unsigned long long int value ){
1095 return Value<Dimension<2,1,-3>>{ static_cast<Real>(value) * units_per_kilogram * units_per_meter * units_per_meter };
1096 }
1097
1098 constexpr Value<Dimension<2,1,-3>> operator"" _W( const long double value ){
1099 return Value<Dimension<2,1,-3>>{ static_cast<Real>(value) * units_per_kilogram * units_per_meter * units_per_meter };
1100 }
1101
1102 constexpr Value<Dimension<2,1,-3>> operator"" _kW( const unsigned long long int value ){
1103 return Value<Dimension<2,1,-3>>{ static_cast<Real>(value) * 1000 * units_per_kilogram * units_per_meter * units_per_meter };
1104 }
1105
1106 constexpr Value<Dimension<2,1,-3>> operator"" _kW( const long double value ){
1107 return Value<Dimension<2,1,-3>>{ static_cast<Real>(value) * 1000 * units_per_kilogram * units_per_meter * units_per_meter };
1108 }
1109
1110 constexpr Value<Dimension<0,0,0>> operator"" _1( const unsigned long long int value ){
1111 return Value<Dimension<0,0,0>>{ static_cast<Real>(value) };
1112 }
1113
1114 constexpr Value<Dimension<0,0,0>> operator"" _1( const long double value ){
1115 return Value<Dimension<0,0,0>>{ static_cast<Real>(value) };
1116 }
1117
1118 constexpr Angle operator"" _rad( const unsigned long long int radiant ){
1119 return Angle{ static_cast<Real>(radiant) };
1120 }
1121
1122 constexpr Angle operator"" _rad( const long double radiant ){
1123 return Angle{ static_cast<Real>(radiant) };
1124 }
1125
1126 constexpr AngularVelocity operator"" _radIs( const unsigned long long int value ){
1127 return AngularVelocity{ static_cast<Real>(value) * seconds_per_unit };
1128 }
1129
1130 constexpr AngularVelocity operator"" _radIs( const long double value ){
1131 return AngularVelocity{ static_cast<Real>(value) * seconds_per_unit };
1132 }
1133
1134 constexpr AngularVelocity operator"" _radIm( const unsigned long long int value ){
1135 return AngularVelocity{ static_cast<Real>(value) * meters_per_unit };
1136 }
1137
1138 constexpr AngularVelocity operator"" _radIm( const long double value ){
1139 return AngularVelocity{ static_cast<Real>(value) * meters_per_unit };
1140 }
1141
1142 } // inline namespace literals
1143
1145 constexpr Angle pi = 3.14159265358979323846264338327950288_rad;
1146
1148 constexpr Angle tau = 2*pi;
1149
1150 inline namespace literals{
1153
1155 constexpr Angle operator"" _deg( const unsigned long long int degree ){
1156 return Angle{ static_cast<Real>(degree) * pi/180 };
1157 }
1158
1159 constexpr Angle operator"" _deg( const long double degree ){
1160 return Angle{ static_cast<Real>(degree) * pi/180 };
1161 }
1162
1163 constexpr AngularVelocity operator"" _degIs( const unsigned long long int value ){
1164 return AngularVelocity{ static_cast<Real>(value) * pi/180 * seconds_per_unit };
1165 }
1166
1167 constexpr AngularVelocity operator"" _degIs( const long double value ){
1168 return AngularVelocity{ static_cast<Real>(value) * pi/180 * seconds_per_unit };
1169 }
1170
1171 constexpr AnglePerLength operator"" _degIm( const unsigned long long int value ){
1172 return AnglePerLength{ static_cast<Real>(value) * pi/180 * meters_per_unit };
1173 }
1174
1175 constexpr AnglePerLength operator"" _degIm( const long double value ){
1176 return AnglePerLength{ static_cast<Real>(value) * pi/180 * meters_per_unit };
1177 }
1178
1179 } // inline namespace literals
1180
1181
1184
1186 constexpr inline Real _1( One one ) noexcept{
1187 return one.Units();
1188 }
1189
1190 constexpr inline One _1( Real r ) noexcept{
1191 return One{ r };
1192 }
1193
1194 constexpr inline Real _deg( Angle a ) noexcept{
1195 return a.Units() * 180 / pi;
1196 }
1197
1198 constexpr inline Angle _deg( Real l ) noexcept{
1199 return Angle{ l * pi / 180 };
1200 }
1201
1202 constexpr inline Real _rad( Angle a ) noexcept{
1203 return a.Units();
1204 }
1205
1206 constexpr inline Angle _rad( Real l ) noexcept{
1207 return Angle{ l };
1208 }
1209
1210 constexpr inline Real _m( Length l ) noexcept{
1211 return l.Units() * meters_per_unit;
1212 }
1213
1214 constexpr inline Length _m( Real l ) noexcept{
1215 return Length{ l * units_per_meter };
1216 }
1217
1218 constexpr inline Real _mm( Length l ) noexcept{
1219 return _m( l ) * 1000;
1220 }
1221
1222 constexpr inline Length _mm( Real l ) noexcept{
1223 return _m( l / 1000 );
1224 }
1225
1226 constexpr inline Real _cm( Length l ) noexcept{
1227 return _m( l ) * 100;
1228 }
1229
1230 constexpr inline Length _cm( Real l ) noexcept{
1231 //return _m( l / 100 );
1232 return _m( l * Real{0.01f} ); // I don't know why it is so, but sometimes the multiplication is faster than dividing R.Bacza
1233 }
1234
1235 constexpr inline Real _dm( Length l ) noexcept{
1236 return _m( l ) * 10;
1237 }
1238
1239 constexpr inline Length _dm( Real l ) noexcept{
1240 return _m( l / 10 );
1241 }
1242
1243 constexpr inline Real _km( Length l ) noexcept{
1244 return _m( l ) / 1000;
1245 }
1246
1247 constexpr inline Length _km( Real l ) noexcept{
1248 return _m( l * 1000 );
1249 }
1250
1251 constexpr inline Real _mi( Length l ) noexcept{
1252 return _m( l ) / 1000 * 15625/25146;
1253 }
1254
1255 constexpr inline Length _mi( Real l ) noexcept{
1256 return _m( l * 1000 * 25146/15625 );
1257 }
1258
1259 constexpr inline Real _nmi( Length l ) noexcept{
1260 return _m( l ) / 1852;
1261 }
1262
1263 constexpr inline Length _nmi( Real l ) noexcept{
1264 return _m( l * 1852 );
1265 }
1266
1267 constexpr inline Real _yd( Length l ) noexcept{
1268 return _m( l ) / (Real{0.3048f} * 3);
1269 }
1270
1271 constexpr inline Length _yd( Real l ) noexcept{
1272 return _m( l * 0.3048f * 3 );
1273 }
1274
1275 constexpr inline Real _ft( Length l ) noexcept{
1276 return _m( l ) / 0.3048f;
1277 }
1278
1279 constexpr inline Length _ft( Real l ) noexcept{
1280 return _m( l * 0.3048f );
1281 }
1282
1283 constexpr inline Real _in( Length l ) noexcept{
1284 return _m( l ) * 12 / 0.3048f;
1285 }
1286
1287 constexpr inline Length _in( Real l ) noexcept{
1288 return _m( l * 0.3048f / 12 );
1289 }
1290
1291 constexpr inline Real _cm2( Area a ) noexcept{
1292 return a.Units() * 100 * meters_per_unit * 100 * meters_per_unit;
1293 }
1294
1295 constexpr inline Area _cm2( Real a ) noexcept{
1296 return Area{ a * units_per_meter / 100 * units_per_meter / 100 };
1297 }
1298
1299 constexpr inline Real _m2( Area a ) noexcept{
1300 return a.Units() * meters_per_unit * meters_per_unit;
1301 }
1302
1303 constexpr inline Area _m2( Real a ) noexcept{
1304 return Area{ a * units_per_meter * units_per_meter };
1305 }
1306
1307 constexpr inline Real _m3( Volume v ) noexcept{
1308 return v.Units() * meters_per_unit * meters_per_unit * meters_per_unit;
1309 }
1310
1311 constexpr inline Volume _m3( Real v ) noexcept{
1313 }
1314
1315 constexpr inline Real _1Is( AngularVelocity v ) noexcept{
1316 return v.Units() / seconds_per_unit;
1317 }
1318
1319 constexpr inline AngularVelocity _1Is( Real v ) noexcept{
1320 return AngularVelocity{ v / units_per_second };
1321 }
1322
1323 constexpr inline Real _degIs( AngularVelocity dads ) noexcept{
1324 return dads.Units() * 180 / pi / seconds_per_unit;
1325 }
1326
1327 constexpr inline AngularVelocity _degIs( Real l ) noexcept{
1328 return AngularVelocity{ l * pi / 180 / units_per_second };
1329 }
1330
1331 constexpr inline Real _radIs( AngularVelocity dads ) noexcept{
1332 return dads.Units() / seconds_per_unit;
1333 }
1334
1335 constexpr inline AngularVelocity _radIs( Real l ) noexcept{
1336 return AngularVelocity{ l / units_per_second };
1337 }
1338
1339 constexpr inline Real _radIm( AnglePerLength dadm ) noexcept{
1340 return dadm.Units() / meters_per_unit;
1341 }
1342
1343 constexpr inline AnglePerLength _radIm( Real l ) noexcept{
1344 return AnglePerLength{ l / units_per_meter };
1345 }
1346
1347 constexpr inline Real _1Im( AnglePerLength a ) noexcept{
1348 return a.Units() / meters_per_unit;
1349 }
1350
1351 constexpr inline AnglePerLength _1Im( Real a ) noexcept{
1352 return AnglePerLength{ a / units_per_meter };
1353 }
1354
1355 constexpr inline Real _1Icm( AnglePerLength a ) noexcept{
1356 return a.Units() / meters_per_unit / 100;
1357 }
1358
1359 constexpr inline AnglePerLength _1Icm( Real a ) noexcept{
1360 return AnglePerLength{ a / units_per_meter * 100 };
1361 }
1362
1363 constexpr inline Real _degIm( AnglePerLength a ) noexcept{
1364 return a.Units() * 180 / pi / meters_per_unit;
1365 }
1366
1367 constexpr inline AnglePerLength _degIm( Real l ) noexcept{
1368 return AnglePerLength{ l * pi / 180 * meters_per_unit };
1369 }
1370
1371 constexpr inline Real _degIcm( AnglePerLength a ) noexcept{
1372 return a.Units() * 180 / pi / meters_per_unit / 100;
1373 }
1374
1375 constexpr inline AnglePerLength _degIcm( Real l ) noexcept{
1376 return AnglePerLength{ l * pi / 180 * meters_per_unit * 100 };
1377 }
1378
1379 constexpr inline Real _1Im2( Value<Dimension<-2,0,0>> a ) noexcept{
1380 return a.Units() / meters_per_unit / meters_per_unit;
1381 }
1382
1383 constexpr inline Value<Dimension<-2,0,0>> _1Im2( Real a ) noexcept{
1384 return Value<Dimension<-2,0,0>>{ a / units_per_meter / meters_per_unit };
1385 }
1386
1387 constexpr inline Real _cmIs( Velocity v ) noexcept{
1388 return v.Units() * meters_per_unit / seconds_per_unit * 100;
1389 }
1390
1391 constexpr inline Velocity _cmIs( Real v ) noexcept{
1392 return Velocity{ v / 100 * units_per_meter / units_per_second };
1393 }
1394
1395 constexpr inline Real _mIs( Velocity v ) noexcept{
1396 return v.Units() * meters_per_unit / seconds_per_unit;
1397 }
1398
1399 constexpr inline Velocity _mIs( Real v ) noexcept{
1401 }
1402
1403 constexpr inline Real _kmIh( Velocity v ) noexcept{
1404 return _mIs( v ) * 3.6f;
1405 }
1406
1407 constexpr inline Velocity _kmIh( Real v ) noexcept{
1408 return _mIs( v / 3.6f );
1409 }
1410
1411 constexpr inline Real _mph( Velocity v ) noexcept{
1412 return _mIs( v ) * 2.236f;
1413 }
1414
1415 constexpr inline Velocity _mph( Real v ) noexcept{
1416 return _mIs( v * 0.44704f );
1417 }
1418
1419 constexpr inline Real _kn( Velocity v ) noexcept{
1420 return _mIs( v ) / 0.514f;
1421 }
1422
1423 constexpr inline Velocity _kn( Real v ) noexcept{
1424 return _mIs( v * 0.514f );
1425 }
1426
1427 constexpr inline Real _mIs2( Acceleration a ) noexcept{
1428 return a.Units() * meters_per_unit / seconds_per_unit / seconds_per_unit;
1429 }
1430
1431 constexpr inline Acceleration _mIs2( Real a ) noexcept{
1433 }
1434
1435 constexpr inline Real _m2Is2( decltype(Velocity{}*Velocity{}) v2 ) noexcept{
1437 }
1438
1439 constexpr inline decltype(Velocity{}*Velocity{}) _m2Is2( Real v2 ) noexcept{
1441 }
1442
1443 constexpr inline Real _kg( Mass m ) noexcept{
1444 return m.Units() * kilograms_per_unit;
1445 }
1446
1447 constexpr inline Mass _kg( Real m ) noexcept{
1448 return Mass{ m * units_per_kilogram };
1449 }
1450
1451 constexpr inline Real _g( Mass m ) noexcept{
1452 return _kg( m ) * 1000;
1453 }
1454
1455 constexpr inline Mass _g( Real m ) noexcept{
1456 return _kg( m / 1000 );
1457 }
1458
1459 constexpr inline Real _t( Mass m ) noexcept{
1460 return _kg( m ) / 1000;
1461 }
1462
1463 constexpr inline Mass _t( Real m ) noexcept{
1464 return _kg( m * 1000 );
1465 }
1466
1467 constexpr inline Real _lb( Mass m ) noexcept{
1468 return _kg( m ) / 0.45359237f;
1469 }
1470
1471 constexpr inline Mass _lb( Real m ) noexcept{
1472 return _kg( m * 0.45359237f );
1473 }
1474
1475 constexpr inline Real _oz( Mass m ) noexcept{
1476 return _lb( m ) * 16;
1477 }
1478
1479 constexpr inline Mass _oz( Real m ) noexcept{
1480 return _lb( m / 16 );
1481 }
1482
1483 constexpr inline Real _long_tons( Mass m ) noexcept{
1484 return _lb( m ) / 2240;
1485 }
1486
1487 constexpr inline Mass _long_tons( Real m ) noexcept{
1488 return _lb( m * 2240 );
1489 }
1490
1491 constexpr inline Real _short_tons( Mass m ) noexcept{
1492 return _lb( m ) / 2000;
1493 }
1494
1495 constexpr inline Mass _short_tons( Real m ) noexcept{
1496 return _lb( m * 2000 );
1497 }
1498
1499 constexpr inline Real _gIcm3( Density d ) noexcept{
1501 }
1502
1503 constexpr inline Density _gIcm3( Real d ) noexcept{
1505 }
1506
1507 constexpr inline Real _kgIm3( Density d ) noexcept{
1509 }
1510
1511 constexpr inline Density _kgIm3( Real d ) noexcept{
1513 }
1514
1515 constexpr inline Real _tIm3( Density d ) noexcept{
1516 return d.Units() * kilograms_per_unit / meters_per_unit / meters_per_unit / meters_per_unit / 1000;
1517 }
1518
1519 constexpr inline Density _tIm3( Real d ) noexcept{
1521 }
1522
1523 constexpr inline Real _ms( Time t ) noexcept{
1524 return t.Units() * seconds_per_unit * 1000;
1525 }
1526
1527 constexpr inline Time _ms( Real t ) noexcept{
1528 return Time{ t / 1000 * units_per_second };
1529 }
1530
1531 constexpr inline Time _ms( const long long int t ) noexcept{
1532 return Time{ static_cast<Real>(t) / 1000 * units_per_second };
1533 }
1534
1535 constexpr inline Real _s( Time t ) noexcept{
1536 return t.Units() * seconds_per_unit;
1537 }
1538
1539 constexpr inline Time _h( Real t ) noexcept{
1540 return Time{ t * 60 * 60 * units_per_second };
1541 }
1542
1543 constexpr inline Real _h( Time t ) noexcept{
1544 return t.Units() * seconds_per_unit / 60 / 60;
1545 }
1546
1547 constexpr inline Time _s( Real t ) noexcept{
1548 return Time{ t * units_per_second };
1549 }
1550
1551 constexpr inline Real _N( Force f ) noexcept{
1552 return f.Units() * newtons_per_unit;
1553 }
1554
1555 constexpr inline Force _N( Real f ) noexcept{
1556 return Force{ f * units_per_newton };
1557 }
1558
1559 constexpr inline Real _kN( Force f ) noexcept{
1560 return _N( f ) / 1000;
1561 }
1562
1563 constexpr inline Force _kN( Real f ) noexcept{
1564 return _N( f * 1000 );
1565 }
1566
1567 constexpr inline Real _kp( Force f ) noexcept{
1568 return _N( f ) / 9.80665f;
1569 }
1570
1571 constexpr inline Force _kp( Real f ) noexcept{
1572 return _N( f * 9.80665f );
1573 }
1574
1575 constexpr inline Real _lbf( Force f ) noexcept{
1576 return _N( f ) / 4.448222f;
1577 }
1578
1579 constexpr inline Force _lbf( Real f ) noexcept{
1580 return _N( f * 4.448222f );
1581 }
1582
1583 constexpr inline Real _long_tons_force( Force f ) noexcept{
1584 return _lbf( f ) / 2240;
1585 }
1586
1587 constexpr inline Force _long_tons_force( Real f ) noexcept{
1588 return _lbf( f * 2240 );
1589 }
1590
1591 constexpr inline Real _short_tons_force( Force f ) noexcept{
1592 return _lbf( f ) / 2000;
1593 }
1594
1595 constexpr inline Force _short_tons_force( Real f ) noexcept{
1596 return _lbf( f * 2000 );
1597 }
1598
1599 constexpr inline Real _Pa( Pressure p ) noexcept{
1600 return p.Units() * pascal_per_unit;
1601 }
1602
1603 constexpr inline Pressure _Pa( Real p ) noexcept{
1604 return Pressure{ p * units_per_pascal };
1605 }
1606
1607 constexpr inline Real _kPa( Pressure p ) noexcept{
1608 return _Pa( p ) / 1000;
1609 }
1610
1611 constexpr inline Pressure _kPa( Real p ) noexcept{
1612 return _Pa( p * 1000 );
1613 }
1614
1615 constexpr inline Real _bar( Pressure p ) noexcept{
1616 return _kPa( p ) / 100;
1617 }
1618
1619 constexpr inline Pressure _bar( Real p ) noexcept{
1620 return _kPa( p * 100 );
1621 }
1622
1623 constexpr inline Real _kgmIs( Momentum m ) noexcept{
1625 }
1626
1627 constexpr inline Momentum _kgmIs( Real m ) noexcept{
1629 }
1630
1631 constexpr inline Real _tmIs( Momentum m ) noexcept{
1632 return m.Units() * kilograms_per_unit * meters_per_unit / seconds_per_unit / 1000;
1633 }
1634
1635 constexpr inline Momentum _tmIs( Real m ) noexcept{
1637 }
1638
1639 constexpr inline Real _kgm2Is( AngularMomentum am ) noexcept{
1641 }
1642
1643 constexpr inline AngularMomentum _kgm2Is( Real am ) noexcept{
1645 }
1646
1647 constexpr inline Real _tm2Is( AngularMomentum am ) noexcept{
1648 return am.Units() * kilograms_per_unit * meters_per_unit * meters_per_unit / seconds_per_unit / 1000;
1649 }
1650
1651 constexpr inline AngularMomentum _tm2Is( Real am ) noexcept{
1653 }
1654
1655 constexpr inline Real _Nm( Torque t ) noexcept{
1656 return t.Units() * newtons_per_unit * meters_per_unit;
1657 }
1658
1659 constexpr inline Torque _Nm( Real t ) noexcept{
1660 return Torque{ t * units_per_newton * units_per_meter };
1661 }
1662
1663 constexpr inline Real _kNm( Torque t ) noexcept{
1664 return _Nm( t ) / 1000;
1665 }
1666
1667 constexpr inline Torque _kNm( Real t ) noexcept{
1668 return _Nm( t * 1000 );
1669 }
1670
1671 constexpr inline Real _W( Power p ) noexcept{
1672 return p.Units() * watts_per_unit;
1673 }
1674
1675 constexpr inline Power _W( Real p ) noexcept{
1676 return Power{ p * units_per_watt };
1677 }
1678
1679 constexpr inline Real _kW( Power p ) noexcept{
1680 return _W( p ) / 1000;
1681 }
1682
1683 constexpr inline Power _kW( Real p ) noexcept{
1684 return _W( p * 1000 );
1685 }
1686
1687 constexpr inline Real _PS( Power p ) noexcept{
1688 return _W( p ) / 735.49875f;
1689 }
1690
1691 constexpr inline Power _PS( Real p ) noexcept{
1692 return _W( p * 735.49875f );
1693 }
1694
1695 constexpr inline Real _hp( Power p ) noexcept{
1696 return _kW( p ) * 1.34102f;
1697 }
1698
1699 constexpr inline Power _hp( Real p ) noexcept{
1700 return _kW( p * 0.74570f );
1701 }
1702
1703
1704} // namespace dim
constexpr Real Units() const noexcept
Definition DimensionedValues.h:306
Value type, dependend from dimensions.
Definition DimensionedValues.h:233
constexpr Real Units() const noexcept
Definition DimensionedValues.h:258
The namespace provides classes and methods for the dim library.
Definition DimensionedValues.h:178
constexpr AngularMomentum infinite__angularMomentum
Dimensionated infinite values.
Definition DimensionedValues.h:371
Value< Dimension< 2, 0, 0 > > Area
Area.
Definition DimensionedValues.h:325
constexpr Real units_per_joule
How many units will make up one joule.
Definition DimensionedValues.h:212
constexpr Real meters_per_unit
How many meters will make up one unit.
Definition DimensionedValues.h:197
constexpr Value< Dimension< L, M, T > > & operator/=(Value< Dimension< L, M, T > > &a, float b) noexcept
Dimensionated Values operator.
Definition DimensionedValues.h:611
constexpr Value< Dimension< 0, 0, 0 > > acos(Value< Dimension< 0, 0, 0 > > a) noexcept
Dimensionated Values math function.
Definition DimensionedValues.h:710
constexpr Force infinite__force
Dimensionated infinite values.
Definition DimensionedValues.h:368
Value< Dimension<-1, 0, 0 > > PixelPerLength
Pixel per length.
Definition DimensionedValues.h:322
constexpr Real _t(Mass m) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1459
constexpr Value< Dimension< Y *L, Y *M, Y *T > > pow(Value< Dimension< L, M, T > > x) noexcept
Dimensionated Values math function.
Definition DimensionedValues.h:675
constexpr Value< Dimension< L/2, M/2, T/2 > > sqrt(Value< Dimension< L, M, T > > a) noexcept
Dimensionated Values math function.
Definition DimensionedValues.h:670
constexpr Real _kn(Velocity v) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1419
Value< Dimension< 0, 0, -1 > > AngularVelocity
Angular velocity.
Definition DimensionedValues.h:323
constexpr Real infinite
Positive infinity value.
Definition DimensionedValues.h:349
constexpr Real kilograms_per_unit
How many kilograms will make up one unit.
Definition DimensionedValues.h:196
Value< Dimension< 2, 1, -1 > > AngularMomentum
Angular momentum.
Definition DimensionedValues.h:336
constexpr Real _rad(Angle a) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1202
constexpr Real _kgmIs(Momentum m) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1623
constexpr Value< Dimension< 0, 0, 0 > > asin(Value< Dimension< 0, 0, 0 > > a) noexcept
Dimensionated Values math function.
Definition DimensionedValues.h:706
constexpr Real _Pa(Pressure p) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1599
constexpr Value< Dimension< 0, 0, 0 > > cos(Value< Dimension< 0, 0, 0 > > a) noexcept
Dimensionated Values math function.
Definition DimensionedValues.h:698
constexpr AngularVelocity infinite__angularVelocity
Dimensionated infinite values.
Definition DimensionedValues.h:358
constexpr Real _mph(Velocity v) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1411
constexpr Value< Dimension< 0, 0, 0 > > atan2(Value< Dimension< L, M, T > > y, Value< Dimension< L, M, T > > x) noexcept
Dimensionated Values math function.
Definition DimensionedValues.h:719
constexpr Real _1Is(AngularVelocity v) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1315
constexpr Volume infinite__volume
Dimensionated infinite values.
Definition DimensionedValues.h:361
constexpr Pressure infinite__pressure
Dimensionated infinite values.
Definition DimensionedValues.h:369
constexpr Real _s(Time t) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1535
constexpr Real _kN(Force f) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1559
constexpr Value< Dimension< L, M, T > > operator+(const Value< Dimension< L, M, T > > &a, const Value< Dimension< L, M, T > > &b) noexcept
Dimensionated Values operator.
Definition DimensionedValues.h:472
constexpr Velocity infinite__velocity
Dimensionated infinite values.
Definition DimensionedValues.h:366
constexpr Real _degIs(AngularVelocity dads) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1323
constexpr Real _cm2(Area a) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1291
Value< Dimension< 0, 0, -1 > > Frequency
Frequency.
Definition DimensionedValues.h:330
constexpr Real _1(One one) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1186
constexpr AnglePerLength infinite__anglePerLength
Dimensionated infinite values.
Definition DimensionedValues.h:357
Value< Dimension< 1, 0, -1 > > Velocity
Velocity.
Definition DimensionedValues.h:331
Value< Dimension< 0, 0, 0 > > One
Dimensionless value.
Definition DimensionedValues.h:319
constexpr Real _radIm(AnglePerLength dadm) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1339
constexpr Mass infinite__mass
Dimensionated infinite values.
Definition DimensionedValues.h:362
constexpr Value< Dimension< 0, 0, 0 > > atan(Value< Dimension< 0, 0, 0 > > a) noexcept
Dimensionated Values math function.
Definition DimensionedValues.h:714
constexpr Real _1Im(AnglePerLength a) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1347
constexpr Value< Dimension< L, M, T > > & operator*=(Value< Dimension< L, M, T > > &a, float b) noexcept
Dimensionated Values operator.
Definition DimensionedValues.h:540
Value< Dimension< 1, 0, 0 > > Length
Length.
Definition DimensionedValues.h:324
constexpr Real units_per_newton
How many units will make up one newton.
Definition DimensionedValues.h:209
constexpr Value< Dimension< 0, 0, 0 > > sin(Value< Dimension< 0, 0, 0 > > a) noexcept
Dimensionated Values math function.
Definition DimensionedValues.h:694
constexpr Real watts_per_unit
How many kilograms will make up one unit.
Definition DimensionedValues.h:204
constexpr Real _radIs(AngularVelocity dads) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1331
constexpr bool operator<(const Value< Dimension< L, M, T > > &a, const Value< Dimension< L, M, T > > &b) noexcept
Dimensionated Values operator.
Definition DimensionedValues.h:645
constexpr Real _kW(Power p) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1679
constexpr Time infinite__time
Dimensionated infinite values.
Definition DimensionedValues.h:364
Value< Dimension< 0, 1, 0 > > Mass
Mass.
Definition DimensionedValues.h:327
constexpr Real _degIcm(AnglePerLength a) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1371
constexpr Real _1Im2(Value< Dimension<-2, 0, 0 > > a) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1379
constexpr Real _dm(Length l) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1235
constexpr Real _m2Is2(decltype(Velocity{} *Velocity{}) v2) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1435
constexpr bool operator>(const Value< Dimension< L, M, T > > &a, const Value< Dimension< L, M, T > > &b) noexcept
Dimensionated Values operator.
Definition DimensionedValues.h:650
constexpr Real _nmi(Length l) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1259
Value< Dimension< 0, 0, 1 > > Time
Time.
Definition DimensionedValues.h:329
constexpr Real units_per_newtonmeter
How many units will make up one newtonmeter (unit of torque).
Definition DimensionedValues.h:211
constexpr Angle pi
Circle number pi.
Definition DimensionedValues.h:1145
constexpr Value< Dimension< L, M, T > > & operator+=(Value< Dimension< L, M, T > > &a, const Value< Dimension< L, M, T > > &b) noexcept
Dimensionated Values operator.
Definition DimensionedValues.h:476
constexpr Power infinite__power
Dimensionated infinite values.
Definition DimensionedValues.h:374
constexpr Real _mi(Length l) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1251
constexpr Real _kgIm3(Density d) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1507
constexpr Real _kmIh(Velocity v) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1403
constexpr Value< Dimension< L, M, T > > nextafter(Value< Dimension< L, M, T > > x, float y) noexcept
Dimensionated Values math function.
Definition DimensionedValues.h:729
constexpr Real _kgm2Is(AngularMomentum am) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1639
constexpr Real _ms(Time t) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1523
constexpr Area infinite__area
Dimensionated infinite values.
Definition DimensionedValues.h:360
constexpr Value< Dimension< L, M, T > > round(Value< Dimension< L, M, T > > x) noexcept
Dimensionated Values math function.
Definition DimensionedValues.h:690
Value< Dimension<-1, 1, -2 > > Pressure
Pressure.
Definition DimensionedValues.h:334
constexpr Real _cmIs(Velocity v) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1387
constexpr Real _m(Length l) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1210
constexpr Value< Dimension< La+Lb, Ma+Mb, Ta+Tb > > operator*(const Value< Dimension< La, Ma, Ta > > &a, const Value< Dimension< Lb, Mb, Tb > > &b) noexcept
Dimensionated Values operator.
Definition DimensionedValues.h:500
constexpr Real _ft(Length l) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1275
constexpr Length infinite__length
Dimensionated infinite values.
Definition DimensionedValues.h:359
constexpr Real _tmIs(Momentum m) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1631
constexpr Real _m3(Volume v) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1307
constexpr Real _short_tons_force(Force f) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1591
constexpr Momentum infinite__momentum
Dimensionated infinite values.
Definition DimensionedValues.h:370
constexpr Real _N(Force f) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1551
constexpr Value< Dimension< L, M, T > > & operator-=(Value< Dimension< L, M, T > > &a, const Value< Dimension< L, M, T > > &b) noexcept
Dimensionated Values operator.
Definition DimensionedValues.h:490
constexpr bool operator==(const Value< Dimension< L, M, T > > &a, const Value< Dimension< L, M, T > > &b) noexcept
Dimensionated Values operator.
Definition DimensionedValues.h:635
Value< Dimension< 1, 0, -2 > > Acceleration
Acceleration.
Definition DimensionedValues.h:332
constexpr Real seconds_per_unit
How many seconds will make up one unit.
Definition DimensionedValues.h:198
constexpr Real _lb(Mass m) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1467
constexpr Time _h(Real t) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1539
constexpr Real _kNm(Torque t) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1663
constexpr One infinite__one
Dimensionated infinite values.
Definition DimensionedValues.h:355
Value< Dimension< 1, 1, -2 > > Force
Force.
Definition DimensionedValues.h:333
constexpr Real newtons_per_unit
How many kilograms will make up one unit.
Definition DimensionedValues.h:202
constexpr bool operator>=(const Value< Dimension< L, M, T > > &a, const Value< Dimension< L, M, T > > &b) noexcept
Dimensionated Values operator.
Definition DimensionedValues.h:659
constexpr Value< Dimension< L, M, T > > ldexp(Value< Dimension< L, M, T > > x, int exp)
Dimensionated Values math function.
Definition DimensionedValues.h:739
constexpr Frequency infinite__frequency
Dimensionated infinite values.
Definition DimensionedValues.h:365
constexpr Real _mm(Length l) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1218
constexpr Real _in(Length l) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1283
constexpr Real _kg(Mass m) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1443
constexpr Acceleration infinite__accelearation
Dimensionated infinite values.
Definition DimensionedValues.h:367
Value< Dimension< 3, 0, 0 > > Volume
Volume.
Definition DimensionedValues.h:326
constexpr Density infinite__density
Dimensionated infinite values.
Definition DimensionedValues.h:363
Value< Dimension<-1, 0, 0 > > AnglePerLength
Angle per length.
Definition DimensionedValues.h:321
constexpr Real units_per_meter
How many units will make up one meter.
Definition DimensionedValues.h:207
constexpr Real _1Icm(AnglePerLength a) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1355
Value< Dimension<-3, 1, 0 > > Density
Density.
Definition DimensionedValues.h:328
float Real
Underlying floating point type to be used with the dim library.
Definition DimensionedValues.h:190
constexpr Torque infinite__torque
Dimensionated infinite values.
Definition DimensionedValues.h:372
constexpr Real _kp(Force f) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1567
constexpr Real units_per_kilogram
How many units will make up one kilogram.
Definition DimensionedValues.h:206
Value< Dimension< 2, 1, -2 > > Torque
Torque.
Definition DimensionedValues.h:337
constexpr Real units_per_second
How many units will make up one second.
Definition DimensionedValues.h:208
Value< Dimension< 2, 1, -3 > > Power
Power.
Definition DimensionedValues.h:339
constexpr Real _bar(Pressure p) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1615
constexpr Real epsilon
Marginal difference in calculations.
Definition DimensionedValues.h:344
constexpr Real _tIm3(Density d) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1515
constexpr Real _long_tons(Mass m) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1483
constexpr Angle tau
2pi, sometimes called tau.
Definition DimensionedValues.h:1148
constexpr Real _deg(Angle a) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1194
constexpr bool operator<=(const Value< Dimension< L, M, T > > &a, const Value< Dimension< L, M, T > > &b) noexcept
Dimensionated Values operator.
Definition DimensionedValues.h:655
constexpr Real units_per_watt
How many kilograms will make up one unit.
Definition DimensionedValues.h:213
constexpr Energy infinite__energy
Dimensionated infinite values.
Definition DimensionedValues.h:373
constexpr Real _PS(Power p) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1687
constexpr Real _hp(Power p) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1695
constexpr Real _W(Power p) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1671
constexpr Real _kPa(Pressure p) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1607
constexpr Value< Dimension< L, M, T > > fabs(Value< Dimension< L, M, T > > x) noexcept
Dimensionated Values math function.
Definition DimensionedValues.h:685
Value< Dimension< 0, 0, 0 > > Angle
Angle in radians.
Definition DimensionedValues.h:320
Value< Dimension< 1, 1, -1 > > Momentum
Momentum.
Definition DimensionedValues.h:335
constexpr Real _km(Length l) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1243
constexpr Value< Dimension< La-Lb, Ma-Mb, Ta-Tb > > operator/(const Value< Dimension< La, Ma, Ta > > &a, const Value< Dimension< Lb, Mb, Tb > > &b) noexcept
Dimensionated Values operator.
Definition DimensionedValues.h:568
constexpr Real _mIs(Velocity v) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1395
constexpr Value< Dimension< L, M, T > > abs(Value< Dimension< L, M, T > > x) noexcept
Dimensionated Values math function.
Definition DimensionedValues.h:680
constexpr Value< Dimension< 0, 0, 0 > > tan(Value< Dimension< 0, 0, 0 > > a) noexcept
Dimensionated Values math function.
Definition DimensionedValues.h:702
constexpr Real _lbf(Force f) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1575
constexpr Real _degIm(AnglePerLength a) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1363
constexpr Real _g(Mass m) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1451
constexpr Real _oz(Mass m) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1475
constexpr Real _short_tons(Mass m) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1491
constexpr Real _m2(Area a) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1299
constexpr Value< Dimension< L, M, T > > operator-(const Value< Dimension< L, M, T > > &a, const Value< Dimension< L, M, T > > &b) noexcept
Dimensionated Values operator.
Definition DimensionedValues.h:486
constexpr Real _mIs2(Acceleration a) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1427
constexpr Real pascal_per_unit
How many kilograms will make up one unit.
Definition DimensionedValues.h:203
Value< Dimension< 2, 1, -2 > > Energy
Energy.
Definition DimensionedValues.h:338
constexpr Angle infinite__angle
Dimensionated infinite values.
Definition DimensionedValues.h:356
constexpr Real _long_tons_force(Force f) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1583
constexpr bool operator!=(const Value< Dimension< L, M, T > > &a, const Value< Dimension< L, M, T > > &b) noexcept
Dimensionated Values operator.
Definition DimensionedValues.h:640
constexpr Real _tm2Is(AngularMomentum am) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1647
constexpr Real _yd(Length l) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1267
constexpr Real units_per_pascal
How many units will make up one pascal.
Definition DimensionedValues.h:210
constexpr Real _cm(Length l) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1226
constexpr bool isnan(Value< Dimension< L, M, T > > x)
Dimensionated Values math function.
Definition DimensionedValues.h:724
constexpr Value< Dimension< L, M, T > > nexttoward(Value< Dimension< L, M, T > > x, long double y) noexcept
Dimensionated Values math function.
Definition DimensionedValues.h:734
constexpr Real _gIcm3(Density d) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1499
constexpr Real _Nm(Torque t) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1655
STL namespace.
Type selection for class Value.
Definition DimensionedValues.h:224
@ mass
inertial mass dimension
Definition DimensionedValues.h:227
@ length
spatial dimension
Definition DimensionedValues.h:226
@ time
time dimension
Definition DimensionedValues.h:228