1
2use core::fmt;
5use super::UnitStruct;
6use super::NumLike;
7use super::base::*;
8use super::chemical::*;
9use super::mechanical::*;
10
11#[cfg(feature="serde")]
13use serde::{Serialize, Deserialize};
14#[cfg(feature="num-bigfloat")]
15use num_bigfloat;
16#[cfg(feature="num-complex")]
17use num_complex;
18
19
20
21#[derive(UnitStruct, Debug, Clone)]
23#[cfg_attr(feature="serde", derive(Serialize, Deserialize))]
24pub struct AbsorbedDose<T: NumLike>{
25 pub Gy: T
27}
28
29impl<T> AbsorbedDose<T> where T: NumLike {
30
31 pub fn unit_name() -> &'static str { "grays" }
33
34 pub fn unit_symbol() -> &'static str { "Gy" }
36
37 pub fn from_Gy(Gy: T) -> Self { AbsorbedDose{Gy: Gy} }
42
43 pub fn to_Gy(&self) -> T { self.Gy.clone() }
45
46 pub fn from_grays(grays: T) -> Self { AbsorbedDose{Gy: grays} }
51
52 pub fn to_grays(&self) -> T { self.Gy.clone() }
54
55}
56
57impl<T> fmt::Display for AbsorbedDose<T> where T: NumLike {
58 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
59 write!(f, "{} {}", &self.Gy, Self::unit_symbol())
60 }
61}
62
63impl<T> AbsorbedDose<T> where T: NumLike+From<f64> {
64
65 pub fn to_mGy(&self) -> T {
69 return self.Gy.clone() * T::from(1000.0_f64);
70 }
71
72 pub fn from_mGy(mGy: T) -> Self {
79 AbsorbedDose{Gy: mGy * T::from(0.001_f64)}
80 }
81
82 pub fn to_uGy(&self) -> T {
86 return self.Gy.clone() * T::from(1000000.0_f64);
87 }
88
89 pub fn from_uGy(uGy: T) -> Self {
96 AbsorbedDose{Gy: uGy * T::from(1e-06_f64)}
97 }
98
99 pub fn to_nGy(&self) -> T {
103 return self.Gy.clone() * T::from(1000000000.0_f64);
104 }
105
106 pub fn from_nGy(nGy: T) -> Self {
113 AbsorbedDose{Gy: nGy * T::from(1e-09_f64)}
114 }
115
116 pub fn to_kGy(&self) -> T {
120 return self.Gy.clone() * T::from(0.001_f64);
121 }
122
123 pub fn from_kGy(kGy: T) -> Self {
130 AbsorbedDose{Gy: kGy * T::from(1000.0_f64)}
131 }
132
133 pub fn to_MGy(&self) -> T {
137 return self.Gy.clone() * T::from(1e-06_f64);
138 }
139
140 pub fn from_MGy(MGy: T) -> Self {
147 AbsorbedDose{Gy: MGy * T::from(1000000.0_f64)}
148 }
149
150 pub fn to_GGy(&self) -> T {
154 return self.Gy.clone() * T::from(1e-09_f64);
155 }
156
157 pub fn from_GGy(GGy: T) -> Self {
164 AbsorbedDose{Gy: GGy * T::from(1000000000.0_f64)}
165 }
166
167 pub fn to_rad(&self) -> T {
171 return self.Gy.clone() * T::from(100.0_f64);
172 }
173
174 pub fn from_rad(rad: T) -> Self {
181 AbsorbedDose{Gy: rad * T::from(0.01_f64)}
182 }
183
184 pub fn to_krad(&self) -> T {
188 return self.Gy.clone() * T::from(0.1_f64);
189 }
190
191 pub fn from_krad(krad: T) -> Self {
198 AbsorbedDose{Gy: krad * T::from(10.0_f64)}
199 }
200
201 pub fn to_mrad(&self) -> T {
205 return self.Gy.clone() * T::from(100000.0_f64);
206 }
207
208 pub fn from_mrad(mrad: T) -> Self {
215 AbsorbedDose{Gy: mrad * T::from(1e-05_f64)}
216 }
217
218 pub fn to_urad(&self) -> T {
222 return self.Gy.clone() * T::from(100000000.0_f64);
223 }
224
225 pub fn from_urad(urad: T) -> Self {
232 AbsorbedDose{Gy: urad * T::from(1e-08_f64)}
233 }
234
235 pub fn to_erg(&self) -> T {
239 return self.Gy.clone() * T::from(10000.0_f64);
240 }
241
242 pub fn from_erg(erg: T) -> Self {
249 AbsorbedDose{Gy: erg * T::from(0.0001_f64)}
250 }
251
252}
253
254
255#[cfg(feature="num-bigfloat")]
257impl core::ops::Mul<AbsorbedDose<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
258 type Output = AbsorbedDose<num_bigfloat::BigFloat>;
259 fn mul(self, rhs: AbsorbedDose<num_bigfloat::BigFloat>) -> Self::Output {
260 AbsorbedDose{Gy: self * rhs.Gy}
261 }
262}
263#[cfg(feature="num-bigfloat")]
265impl core::ops::Mul<AbsorbedDose<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
266 type Output = AbsorbedDose<num_bigfloat::BigFloat>;
267 fn mul(self, rhs: AbsorbedDose<num_bigfloat::BigFloat>) -> Self::Output {
268 AbsorbedDose{Gy: self.clone() * rhs.Gy}
269 }
270}
271#[cfg(feature="num-bigfloat")]
273impl core::ops::Mul<&AbsorbedDose<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
274 type Output = AbsorbedDose<num_bigfloat::BigFloat>;
275 fn mul(self, rhs: &AbsorbedDose<num_bigfloat::BigFloat>) -> Self::Output {
276 AbsorbedDose{Gy: self * rhs.Gy.clone()}
277 }
278}
279#[cfg(feature="num-bigfloat")]
281impl core::ops::Mul<&AbsorbedDose<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
282 type Output = AbsorbedDose<num_bigfloat::BigFloat>;
283 fn mul(self, rhs: &AbsorbedDose<num_bigfloat::BigFloat>) -> Self::Output {
284 AbsorbedDose{Gy: self.clone() * rhs.Gy.clone()}
285 }
286}
287
288#[cfg(feature="num-complex")]
290impl core::ops::Mul<AbsorbedDose<num_complex::Complex32>> for num_complex::Complex32 {
291 type Output = AbsorbedDose<num_complex::Complex32>;
292 fn mul(self, rhs: AbsorbedDose<num_complex::Complex32>) -> Self::Output {
293 AbsorbedDose{Gy: self * rhs.Gy}
294 }
295}
296#[cfg(feature="num-complex")]
298impl core::ops::Mul<AbsorbedDose<num_complex::Complex32>> for &num_complex::Complex32 {
299 type Output = AbsorbedDose<num_complex::Complex32>;
300 fn mul(self, rhs: AbsorbedDose<num_complex::Complex32>) -> Self::Output {
301 AbsorbedDose{Gy: self.clone() * rhs.Gy}
302 }
303}
304#[cfg(feature="num-complex")]
306impl core::ops::Mul<&AbsorbedDose<num_complex::Complex32>> for num_complex::Complex32 {
307 type Output = AbsorbedDose<num_complex::Complex32>;
308 fn mul(self, rhs: &AbsorbedDose<num_complex::Complex32>) -> Self::Output {
309 AbsorbedDose{Gy: self * rhs.Gy.clone()}
310 }
311}
312#[cfg(feature="num-complex")]
314impl core::ops::Mul<&AbsorbedDose<num_complex::Complex32>> for &num_complex::Complex32 {
315 type Output = AbsorbedDose<num_complex::Complex32>;
316 fn mul(self, rhs: &AbsorbedDose<num_complex::Complex32>) -> Self::Output {
317 AbsorbedDose{Gy: self.clone() * rhs.Gy.clone()}
318 }
319}
320
321#[cfg(feature="num-complex")]
323impl core::ops::Mul<AbsorbedDose<num_complex::Complex64>> for num_complex::Complex64 {
324 type Output = AbsorbedDose<num_complex::Complex64>;
325 fn mul(self, rhs: AbsorbedDose<num_complex::Complex64>) -> Self::Output {
326 AbsorbedDose{Gy: self * rhs.Gy}
327 }
328}
329#[cfg(feature="num-complex")]
331impl core::ops::Mul<AbsorbedDose<num_complex::Complex64>> for &num_complex::Complex64 {
332 type Output = AbsorbedDose<num_complex::Complex64>;
333 fn mul(self, rhs: AbsorbedDose<num_complex::Complex64>) -> Self::Output {
334 AbsorbedDose{Gy: self.clone() * rhs.Gy}
335 }
336}
337#[cfg(feature="num-complex")]
339impl core::ops::Mul<&AbsorbedDose<num_complex::Complex64>> for num_complex::Complex64 {
340 type Output = AbsorbedDose<num_complex::Complex64>;
341 fn mul(self, rhs: &AbsorbedDose<num_complex::Complex64>) -> Self::Output {
342 AbsorbedDose{Gy: self * rhs.Gy.clone()}
343 }
344}
345#[cfg(feature="num-complex")]
347impl core::ops::Mul<&AbsorbedDose<num_complex::Complex64>> for &num_complex::Complex64 {
348 type Output = AbsorbedDose<num_complex::Complex64>;
349 fn mul(self, rhs: &AbsorbedDose<num_complex::Complex64>) -> Self::Output {
350 AbsorbedDose{Gy: self.clone() * rhs.Gy.clone()}
351 }
352}
353
354
355
356
357impl<T> core::ops::Mul<Mass<T>> for AbsorbedDose<T> where T: NumLike {
360 type Output = Energy<T>;
361 fn mul(self, rhs: Mass<T>) -> Self::Output {
362 Energy{J: self.Gy * rhs.kg}
363 }
364}
365impl<T> core::ops::Mul<Mass<T>> for &AbsorbedDose<T> where T: NumLike {
367 type Output = Energy<T>;
368 fn mul(self, rhs: Mass<T>) -> Self::Output {
369 Energy{J: self.Gy.clone() * rhs.kg}
370 }
371}
372impl<T> core::ops::Mul<&Mass<T>> for AbsorbedDose<T> where T: NumLike {
374 type Output = Energy<T>;
375 fn mul(self, rhs: &Mass<T>) -> Self::Output {
376 Energy{J: self.Gy * rhs.kg.clone()}
377 }
378}
379impl<T> core::ops::Mul<&Mass<T>> for &AbsorbedDose<T> where T: NumLike {
381 type Output = Energy<T>;
382 fn mul(self, rhs: &Mass<T>) -> Self::Output {
383 Energy{J: self.Gy.clone() * rhs.kg.clone()}
384 }
385}
386
387#[derive(UnitStruct, Debug, Clone)]
389#[cfg_attr(feature="serde", derive(Serialize, Deserialize))]
390pub struct DoseEquivalent<T: NumLike>{
391 pub Sv: T
393}
394
395impl<T> DoseEquivalent<T> where T: NumLike {
396
397 pub fn unit_name() -> &'static str { "sieverts" }
399
400 pub fn unit_symbol() -> &'static str { "Sv" }
402
403 pub fn from_Sv(Sv: T) -> Self { DoseEquivalent{Sv: Sv} }
408
409 pub fn to_Sv(&self) -> T { self.Sv.clone() }
411
412 pub fn from_sieverts(sieverts: T) -> Self { DoseEquivalent{Sv: sieverts} }
417
418 pub fn to_sieverts(&self) -> T { self.Sv.clone() }
420
421}
422
423impl<T> fmt::Display for DoseEquivalent<T> where T: NumLike {
424 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
425 write!(f, "{} {}", &self.Sv, Self::unit_symbol())
426 }
427}
428
429impl<T> DoseEquivalent<T> where T: NumLike+From<f64> {
430
431 pub fn to_mSv(&self) -> T {
435 return self.Sv.clone() * T::from(1000.0_f64);
436 }
437
438 pub fn from_mSv(mSv: T) -> Self {
445 DoseEquivalent{Sv: mSv * T::from(0.001_f64)}
446 }
447
448 pub fn to_uSv(&self) -> T {
452 return self.Sv.clone() * T::from(1000000.0_f64);
453 }
454
455 pub fn from_uSv(uSv: T) -> Self {
462 DoseEquivalent{Sv: uSv * T::from(1e-06_f64)}
463 }
464
465 pub fn to_nSv(&self) -> T {
469 return self.Sv.clone() * T::from(1000000000.0_f64);
470 }
471
472 pub fn from_nSv(nSv: T) -> Self {
479 DoseEquivalent{Sv: nSv * T::from(1e-09_f64)}
480 }
481
482 pub fn to_kSv(&self) -> T {
486 return self.Sv.clone() * T::from(0.001_f64);
487 }
488
489 pub fn from_kSv(kSv: T) -> Self {
496 DoseEquivalent{Sv: kSv * T::from(1000.0_f64)}
497 }
498
499 pub fn to_MSv(&self) -> T {
503 return self.Sv.clone() * T::from(1e-06_f64);
504 }
505
506 pub fn from_MSv(MSv: T) -> Self {
513 DoseEquivalent{Sv: MSv * T::from(1000000.0_f64)}
514 }
515
516 pub fn to_GSv(&self) -> T {
520 return self.Sv.clone() * T::from(1e-09_f64);
521 }
522
523 pub fn from_GSv(GSv: T) -> Self {
530 DoseEquivalent{Sv: GSv * T::from(1000000000.0_f64)}
531 }
532
533 pub fn to_rem(&self) -> T {
537 return self.Sv.clone() * T::from(100.0_f64);
538 }
539
540 pub fn from_rem(rem: T) -> Self {
547 DoseEquivalent{Sv: rem * T::from(0.01_f64)}
548 }
549
550 pub fn to_mrem(&self) -> T {
554 return self.Sv.clone() * T::from(100000.0_f64);
555 }
556
557 pub fn from_mrem(mrem: T) -> Self {
564 DoseEquivalent{Sv: mrem * T::from(1e-05_f64)}
565 }
566
567 pub fn to_krem(&self) -> T {
571 return self.Sv.clone() * T::from(0.1_f64);
572 }
573
574 pub fn from_krem(krem: T) -> Self {
581 DoseEquivalent{Sv: krem * T::from(10.0_f64)}
582 }
583
584}
585
586
587#[cfg(feature="num-bigfloat")]
589impl core::ops::Mul<DoseEquivalent<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
590 type Output = DoseEquivalent<num_bigfloat::BigFloat>;
591 fn mul(self, rhs: DoseEquivalent<num_bigfloat::BigFloat>) -> Self::Output {
592 DoseEquivalent{Sv: self * rhs.Sv}
593 }
594}
595#[cfg(feature="num-bigfloat")]
597impl core::ops::Mul<DoseEquivalent<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
598 type Output = DoseEquivalent<num_bigfloat::BigFloat>;
599 fn mul(self, rhs: DoseEquivalent<num_bigfloat::BigFloat>) -> Self::Output {
600 DoseEquivalent{Sv: self.clone() * rhs.Sv}
601 }
602}
603#[cfg(feature="num-bigfloat")]
605impl core::ops::Mul<&DoseEquivalent<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
606 type Output = DoseEquivalent<num_bigfloat::BigFloat>;
607 fn mul(self, rhs: &DoseEquivalent<num_bigfloat::BigFloat>) -> Self::Output {
608 DoseEquivalent{Sv: self * rhs.Sv.clone()}
609 }
610}
611#[cfg(feature="num-bigfloat")]
613impl core::ops::Mul<&DoseEquivalent<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
614 type Output = DoseEquivalent<num_bigfloat::BigFloat>;
615 fn mul(self, rhs: &DoseEquivalent<num_bigfloat::BigFloat>) -> Self::Output {
616 DoseEquivalent{Sv: self.clone() * rhs.Sv.clone()}
617 }
618}
619
620#[cfg(feature="num-complex")]
622impl core::ops::Mul<DoseEquivalent<num_complex::Complex32>> for num_complex::Complex32 {
623 type Output = DoseEquivalent<num_complex::Complex32>;
624 fn mul(self, rhs: DoseEquivalent<num_complex::Complex32>) -> Self::Output {
625 DoseEquivalent{Sv: self * rhs.Sv}
626 }
627}
628#[cfg(feature="num-complex")]
630impl core::ops::Mul<DoseEquivalent<num_complex::Complex32>> for &num_complex::Complex32 {
631 type Output = DoseEquivalent<num_complex::Complex32>;
632 fn mul(self, rhs: DoseEquivalent<num_complex::Complex32>) -> Self::Output {
633 DoseEquivalent{Sv: self.clone() * rhs.Sv}
634 }
635}
636#[cfg(feature="num-complex")]
638impl core::ops::Mul<&DoseEquivalent<num_complex::Complex32>> for num_complex::Complex32 {
639 type Output = DoseEquivalent<num_complex::Complex32>;
640 fn mul(self, rhs: &DoseEquivalent<num_complex::Complex32>) -> Self::Output {
641 DoseEquivalent{Sv: self * rhs.Sv.clone()}
642 }
643}
644#[cfg(feature="num-complex")]
646impl core::ops::Mul<&DoseEquivalent<num_complex::Complex32>> for &num_complex::Complex32 {
647 type Output = DoseEquivalent<num_complex::Complex32>;
648 fn mul(self, rhs: &DoseEquivalent<num_complex::Complex32>) -> Self::Output {
649 DoseEquivalent{Sv: self.clone() * rhs.Sv.clone()}
650 }
651}
652
653#[cfg(feature="num-complex")]
655impl core::ops::Mul<DoseEquivalent<num_complex::Complex64>> for num_complex::Complex64 {
656 type Output = DoseEquivalent<num_complex::Complex64>;
657 fn mul(self, rhs: DoseEquivalent<num_complex::Complex64>) -> Self::Output {
658 DoseEquivalent{Sv: self * rhs.Sv}
659 }
660}
661#[cfg(feature="num-complex")]
663impl core::ops::Mul<DoseEquivalent<num_complex::Complex64>> for &num_complex::Complex64 {
664 type Output = DoseEquivalent<num_complex::Complex64>;
665 fn mul(self, rhs: DoseEquivalent<num_complex::Complex64>) -> Self::Output {
666 DoseEquivalent{Sv: self.clone() * rhs.Sv}
667 }
668}
669#[cfg(feature="num-complex")]
671impl core::ops::Mul<&DoseEquivalent<num_complex::Complex64>> for num_complex::Complex64 {
672 type Output = DoseEquivalent<num_complex::Complex64>;
673 fn mul(self, rhs: &DoseEquivalent<num_complex::Complex64>) -> Self::Output {
674 DoseEquivalent{Sv: self * rhs.Sv.clone()}
675 }
676}
677#[cfg(feature="num-complex")]
679impl core::ops::Mul<&DoseEquivalent<num_complex::Complex64>> for &num_complex::Complex64 {
680 type Output = DoseEquivalent<num_complex::Complex64>;
681 fn mul(self, rhs: &DoseEquivalent<num_complex::Complex64>) -> Self::Output {
682 DoseEquivalent{Sv: self.clone() * rhs.Sv.clone()}
683 }
684}
685
686
687
688
689impl<T> core::ops::Mul<Mass<T>> for DoseEquivalent<T> where T: NumLike {
692 type Output = Energy<T>;
693 fn mul(self, rhs: Mass<T>) -> Self::Output {
694 Energy{J: self.Sv * rhs.kg}
695 }
696}
697impl<T> core::ops::Mul<Mass<T>> for &DoseEquivalent<T> where T: NumLike {
699 type Output = Energy<T>;
700 fn mul(self, rhs: Mass<T>) -> Self::Output {
701 Energy{J: self.Sv.clone() * rhs.kg}
702 }
703}
704impl<T> core::ops::Mul<&Mass<T>> for DoseEquivalent<T> where T: NumLike {
706 type Output = Energy<T>;
707 fn mul(self, rhs: &Mass<T>) -> Self::Output {
708 Energy{J: self.Sv * rhs.kg.clone()}
709 }
710}
711impl<T> core::ops::Mul<&Mass<T>> for &DoseEquivalent<T> where T: NumLike {
713 type Output = Energy<T>;
714 fn mul(self, rhs: &Mass<T>) -> Self::Output {
715 Energy{J: self.Sv.clone() * rhs.kg.clone()}
716 }
717}
718
719#[derive(UnitStruct, Debug, Clone)]
721#[cfg_attr(feature="serde", derive(Serialize, Deserialize))]
722pub struct InverseAbsorbedDose<T: NumLike>{
723 pub per_Gy: T
725}
726
727impl<T> InverseAbsorbedDose<T> where T: NumLike {
728
729 pub fn unit_name() -> &'static str { "inverse grays" }
731
732 pub fn unit_symbol() -> &'static str { "1/Gy" }
734
735 pub fn from_per_Gy(per_Gy: T) -> Self { InverseAbsorbedDose{per_Gy: per_Gy} }
740
741 pub fn to_per_Gy(&self) -> T { self.per_Gy.clone() }
743
744 pub fn from_per_grays(per_grays: T) -> Self { InverseAbsorbedDose{per_Gy: per_grays} }
749
750 pub fn to_per_grays(&self) -> T { self.per_Gy.clone() }
752
753}
754
755impl<T> fmt::Display for InverseAbsorbedDose<T> where T: NumLike {
756 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
757 write!(f, "{} {}", &self.per_Gy, Self::unit_symbol())
758 }
759}
760
761impl<T> InverseAbsorbedDose<T> where T: NumLike+From<f64> {
762
763 pub fn to_per_mGy(&self) -> T {
767 return self.per_Gy.clone() * T::from(0.001_f64);
768 }
769
770 pub fn from_per_mGy(per_mGy: T) -> Self {
777 InverseAbsorbedDose{per_Gy: per_mGy * T::from(1000.0_f64)}
778 }
779
780 pub fn to_per_uGy(&self) -> T {
784 return self.per_Gy.clone() * T::from(1e-06_f64);
785 }
786
787 pub fn from_per_uGy(per_uGy: T) -> Self {
794 InverseAbsorbedDose{per_Gy: per_uGy * T::from(1000000.0_f64)}
795 }
796
797 pub fn to_per_nGy(&self) -> T {
801 return self.per_Gy.clone() * T::from(1e-09_f64);
802 }
803
804 pub fn from_per_nGy(per_nGy: T) -> Self {
811 InverseAbsorbedDose{per_Gy: per_nGy * T::from(1000000000.0_f64)}
812 }
813
814 pub fn to_per_kGy(&self) -> T {
818 return self.per_Gy.clone() * T::from(1000.0_f64);
819 }
820
821 pub fn from_per_kGy(per_kGy: T) -> Self {
828 InverseAbsorbedDose{per_Gy: per_kGy * T::from(0.001_f64)}
829 }
830
831 pub fn to_per_MGy(&self) -> T {
835 return self.per_Gy.clone() * T::from(1000000.0_f64);
836 }
837
838 pub fn from_per_MGy(per_MGy: T) -> Self {
845 InverseAbsorbedDose{per_Gy: per_MGy * T::from(1e-06_f64)}
846 }
847
848 pub fn to_per_GGy(&self) -> T {
852 return self.per_Gy.clone() * T::from(1000000000.0_f64);
853 }
854
855 pub fn from_per_GGy(per_GGy: T) -> Self {
862 InverseAbsorbedDose{per_Gy: per_GGy * T::from(1e-09_f64)}
863 }
864
865 pub fn to_per_rad(&self) -> T {
869 return self.per_Gy.clone() * T::from(0.01_f64);
870 }
871
872 pub fn from_per_rad(per_rad: T) -> Self {
879 InverseAbsorbedDose{per_Gy: per_rad * T::from(100.0_f64)}
880 }
881
882 pub fn to_per_krad(&self) -> T {
886 return self.per_Gy.clone() * T::from(10.0_f64);
887 }
888
889 pub fn from_per_krad(per_krad: T) -> Self {
896 InverseAbsorbedDose{per_Gy: per_krad * T::from(0.1_f64)}
897 }
898
899 pub fn to_per_mrad(&self) -> T {
903 return self.per_Gy.clone() * T::from(1e-05_f64);
904 }
905
906 pub fn from_per_mrad(per_mrad: T) -> Self {
913 InverseAbsorbedDose{per_Gy: per_mrad * T::from(100000.0_f64)}
914 }
915
916 pub fn to_per_urad(&self) -> T {
920 return self.per_Gy.clone() * T::from(1e-08_f64);
921 }
922
923 pub fn from_per_urad(per_urad: T) -> Self {
930 InverseAbsorbedDose{per_Gy: per_urad * T::from(100000000.0_f64)}
931 }
932
933 pub fn to_per_erg(&self) -> T {
937 return self.per_Gy.clone() * T::from(0.0001_f64);
938 }
939
940 pub fn from_per_erg(per_erg: T) -> Self {
947 InverseAbsorbedDose{per_Gy: per_erg * T::from(10000.0_f64)}
948 }
949
950}
951
952
953#[cfg(feature="num-bigfloat")]
955impl core::ops::Mul<InverseAbsorbedDose<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
956 type Output = InverseAbsorbedDose<num_bigfloat::BigFloat>;
957 fn mul(self, rhs: InverseAbsorbedDose<num_bigfloat::BigFloat>) -> Self::Output {
958 InverseAbsorbedDose{per_Gy: self * rhs.per_Gy}
959 }
960}
961#[cfg(feature="num-bigfloat")]
963impl core::ops::Mul<InverseAbsorbedDose<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
964 type Output = InverseAbsorbedDose<num_bigfloat::BigFloat>;
965 fn mul(self, rhs: InverseAbsorbedDose<num_bigfloat::BigFloat>) -> Self::Output {
966 InverseAbsorbedDose{per_Gy: self.clone() * rhs.per_Gy}
967 }
968}
969#[cfg(feature="num-bigfloat")]
971impl core::ops::Mul<&InverseAbsorbedDose<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
972 type Output = InverseAbsorbedDose<num_bigfloat::BigFloat>;
973 fn mul(self, rhs: &InverseAbsorbedDose<num_bigfloat::BigFloat>) -> Self::Output {
974 InverseAbsorbedDose{per_Gy: self * rhs.per_Gy.clone()}
975 }
976}
977#[cfg(feature="num-bigfloat")]
979impl core::ops::Mul<&InverseAbsorbedDose<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
980 type Output = InverseAbsorbedDose<num_bigfloat::BigFloat>;
981 fn mul(self, rhs: &InverseAbsorbedDose<num_bigfloat::BigFloat>) -> Self::Output {
982 InverseAbsorbedDose{per_Gy: self.clone() * rhs.per_Gy.clone()}
983 }
984}
985
986#[cfg(feature="num-complex")]
988impl core::ops::Mul<InverseAbsorbedDose<num_complex::Complex32>> for num_complex::Complex32 {
989 type Output = InverseAbsorbedDose<num_complex::Complex32>;
990 fn mul(self, rhs: InverseAbsorbedDose<num_complex::Complex32>) -> Self::Output {
991 InverseAbsorbedDose{per_Gy: self * rhs.per_Gy}
992 }
993}
994#[cfg(feature="num-complex")]
996impl core::ops::Mul<InverseAbsorbedDose<num_complex::Complex32>> for &num_complex::Complex32 {
997 type Output = InverseAbsorbedDose<num_complex::Complex32>;
998 fn mul(self, rhs: InverseAbsorbedDose<num_complex::Complex32>) -> Self::Output {
999 InverseAbsorbedDose{per_Gy: self.clone() * rhs.per_Gy}
1000 }
1001}
1002#[cfg(feature="num-complex")]
1004impl core::ops::Mul<&InverseAbsorbedDose<num_complex::Complex32>> for num_complex::Complex32 {
1005 type Output = InverseAbsorbedDose<num_complex::Complex32>;
1006 fn mul(self, rhs: &InverseAbsorbedDose<num_complex::Complex32>) -> Self::Output {
1007 InverseAbsorbedDose{per_Gy: self * rhs.per_Gy.clone()}
1008 }
1009}
1010#[cfg(feature="num-complex")]
1012impl core::ops::Mul<&InverseAbsorbedDose<num_complex::Complex32>> for &num_complex::Complex32 {
1013 type Output = InverseAbsorbedDose<num_complex::Complex32>;
1014 fn mul(self, rhs: &InverseAbsorbedDose<num_complex::Complex32>) -> Self::Output {
1015 InverseAbsorbedDose{per_Gy: self.clone() * rhs.per_Gy.clone()}
1016 }
1017}
1018
1019#[cfg(feature="num-complex")]
1021impl core::ops::Mul<InverseAbsorbedDose<num_complex::Complex64>> for num_complex::Complex64 {
1022 type Output = InverseAbsorbedDose<num_complex::Complex64>;
1023 fn mul(self, rhs: InverseAbsorbedDose<num_complex::Complex64>) -> Self::Output {
1024 InverseAbsorbedDose{per_Gy: self * rhs.per_Gy}
1025 }
1026}
1027#[cfg(feature="num-complex")]
1029impl core::ops::Mul<InverseAbsorbedDose<num_complex::Complex64>> for &num_complex::Complex64 {
1030 type Output = InverseAbsorbedDose<num_complex::Complex64>;
1031 fn mul(self, rhs: InverseAbsorbedDose<num_complex::Complex64>) -> Self::Output {
1032 InverseAbsorbedDose{per_Gy: self.clone() * rhs.per_Gy}
1033 }
1034}
1035#[cfg(feature="num-complex")]
1037impl core::ops::Mul<&InverseAbsorbedDose<num_complex::Complex64>> for num_complex::Complex64 {
1038 type Output = InverseAbsorbedDose<num_complex::Complex64>;
1039 fn mul(self, rhs: &InverseAbsorbedDose<num_complex::Complex64>) -> Self::Output {
1040 InverseAbsorbedDose{per_Gy: self * rhs.per_Gy.clone()}
1041 }
1042}
1043#[cfg(feature="num-complex")]
1045impl core::ops::Mul<&InverseAbsorbedDose<num_complex::Complex64>> for &num_complex::Complex64 {
1046 type Output = InverseAbsorbedDose<num_complex::Complex64>;
1047 fn mul(self, rhs: &InverseAbsorbedDose<num_complex::Complex64>) -> Self::Output {
1048 InverseAbsorbedDose{per_Gy: self.clone() * rhs.per_Gy.clone()}
1049 }
1050}
1051
1052
1053
1054
1055impl<T> core::ops::Mul<Distance<T>> for InverseAbsorbedDose<T> where T: NumLike {
1058 type Output = InverseAcceleration<T>;
1059 fn mul(self, rhs: Distance<T>) -> Self::Output {
1060 InverseAcceleration{s2pm: self.per_Gy * rhs.m}
1061 }
1062}
1063impl<T> core::ops::Mul<Distance<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1065 type Output = InverseAcceleration<T>;
1066 fn mul(self, rhs: Distance<T>) -> Self::Output {
1067 InverseAcceleration{s2pm: self.per_Gy.clone() * rhs.m}
1068 }
1069}
1070impl<T> core::ops::Mul<&Distance<T>> for InverseAbsorbedDose<T> where T: NumLike {
1072 type Output = InverseAcceleration<T>;
1073 fn mul(self, rhs: &Distance<T>) -> Self::Output {
1074 InverseAcceleration{s2pm: self.per_Gy * rhs.m.clone()}
1075 }
1076}
1077impl<T> core::ops::Mul<&Distance<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1079 type Output = InverseAcceleration<T>;
1080 fn mul(self, rhs: &Distance<T>) -> Self::Output {
1081 InverseAcceleration{s2pm: self.per_Gy.clone() * rhs.m.clone()}
1082 }
1083}
1084
1085impl<T> core::ops::Div<InverseDistance<T>> for InverseAbsorbedDose<T> where T: NumLike {
1088 type Output = InverseAcceleration<T>;
1089 fn div(self, rhs: InverseDistance<T>) -> Self::Output {
1090 InverseAcceleration{s2pm: self.per_Gy / rhs.per_m}
1091 }
1092}
1093impl<T> core::ops::Div<InverseDistance<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1095 type Output = InverseAcceleration<T>;
1096 fn div(self, rhs: InverseDistance<T>) -> Self::Output {
1097 InverseAcceleration{s2pm: self.per_Gy.clone() / rhs.per_m}
1098 }
1099}
1100impl<T> core::ops::Div<&InverseDistance<T>> for InverseAbsorbedDose<T> where T: NumLike {
1102 type Output = InverseAcceleration<T>;
1103 fn div(self, rhs: &InverseDistance<T>) -> Self::Output {
1104 InverseAcceleration{s2pm: self.per_Gy / rhs.per_m.clone()}
1105 }
1106}
1107impl<T> core::ops::Div<&InverseDistance<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1109 type Output = InverseAcceleration<T>;
1110 fn div(self, rhs: &InverseDistance<T>) -> Self::Output {
1111 InverseAcceleration{s2pm: self.per_Gy.clone() / rhs.per_m.clone()}
1112 }
1113}
1114
1115impl<T> core::ops::Mul<InverseMass<T>> for InverseAbsorbedDose<T> where T: NumLike {
1118 type Output = InverseEnergy<T>;
1119 fn mul(self, rhs: InverseMass<T>) -> Self::Output {
1120 InverseEnergy{per_J: self.per_Gy * rhs.per_kg}
1121 }
1122}
1123impl<T> core::ops::Mul<InverseMass<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1125 type Output = InverseEnergy<T>;
1126 fn mul(self, rhs: InverseMass<T>) -> Self::Output {
1127 InverseEnergy{per_J: self.per_Gy.clone() * rhs.per_kg}
1128 }
1129}
1130impl<T> core::ops::Mul<&InverseMass<T>> for InverseAbsorbedDose<T> where T: NumLike {
1132 type Output = InverseEnergy<T>;
1133 fn mul(self, rhs: &InverseMass<T>) -> Self::Output {
1134 InverseEnergy{per_J: self.per_Gy * rhs.per_kg.clone()}
1135 }
1136}
1137impl<T> core::ops::Mul<&InverseMass<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1139 type Output = InverseEnergy<T>;
1140 fn mul(self, rhs: &InverseMass<T>) -> Self::Output {
1141 InverseEnergy{per_J: self.per_Gy.clone() * rhs.per_kg.clone()}
1142 }
1143}
1144
1145impl<T> core::ops::Div<InverseTemperature<T>> for InverseAbsorbedDose<T> where T: NumLike {
1148 type Output = InverseSpecificHeatCapacity<T>;
1149 fn div(self, rhs: InverseTemperature<T>) -> Self::Output {
1150 InverseSpecificHeatCapacity{kgK_per_J: self.per_Gy / rhs.per_K}
1151 }
1152}
1153impl<T> core::ops::Div<InverseTemperature<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1155 type Output = InverseSpecificHeatCapacity<T>;
1156 fn div(self, rhs: InverseTemperature<T>) -> Self::Output {
1157 InverseSpecificHeatCapacity{kgK_per_J: self.per_Gy.clone() / rhs.per_K}
1158 }
1159}
1160impl<T> core::ops::Div<&InverseTemperature<T>> for InverseAbsorbedDose<T> where T: NumLike {
1162 type Output = InverseSpecificHeatCapacity<T>;
1163 fn div(self, rhs: &InverseTemperature<T>) -> Self::Output {
1164 InverseSpecificHeatCapacity{kgK_per_J: self.per_Gy / rhs.per_K.clone()}
1165 }
1166}
1167impl<T> core::ops::Div<&InverseTemperature<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1169 type Output = InverseSpecificHeatCapacity<T>;
1170 fn div(self, rhs: &InverseTemperature<T>) -> Self::Output {
1171 InverseSpecificHeatCapacity{kgK_per_J: self.per_Gy.clone() / rhs.per_K.clone()}
1172 }
1173}
1174
1175impl<T> core::ops::Div<Mass<T>> for InverseAbsorbedDose<T> where T: NumLike {
1178 type Output = InverseEnergy<T>;
1179 fn div(self, rhs: Mass<T>) -> Self::Output {
1180 InverseEnergy{per_J: self.per_Gy / rhs.kg}
1181 }
1182}
1183impl<T> core::ops::Div<Mass<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1185 type Output = InverseEnergy<T>;
1186 fn div(self, rhs: Mass<T>) -> Self::Output {
1187 InverseEnergy{per_J: self.per_Gy.clone() / rhs.kg}
1188 }
1189}
1190impl<T> core::ops::Div<&Mass<T>> for InverseAbsorbedDose<T> where T: NumLike {
1192 type Output = InverseEnergy<T>;
1193 fn div(self, rhs: &Mass<T>) -> Self::Output {
1194 InverseEnergy{per_J: self.per_Gy / rhs.kg.clone()}
1195 }
1196}
1197impl<T> core::ops::Div<&Mass<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1199 type Output = InverseEnergy<T>;
1200 fn div(self, rhs: &Mass<T>) -> Self::Output {
1201 InverseEnergy{per_J: self.per_Gy.clone() / rhs.kg.clone()}
1202 }
1203}
1204
1205impl<T> core::ops::Mul<Temperature<T>> for InverseAbsorbedDose<T> where T: NumLike {
1208 type Output = InverseSpecificHeatCapacity<T>;
1209 fn mul(self, rhs: Temperature<T>) -> Self::Output {
1210 InverseSpecificHeatCapacity{kgK_per_J: self.per_Gy * rhs.K}
1211 }
1212}
1213impl<T> core::ops::Mul<Temperature<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1215 type Output = InverseSpecificHeatCapacity<T>;
1216 fn mul(self, rhs: Temperature<T>) -> Self::Output {
1217 InverseSpecificHeatCapacity{kgK_per_J: self.per_Gy.clone() * rhs.K}
1218 }
1219}
1220impl<T> core::ops::Mul<&Temperature<T>> for InverseAbsorbedDose<T> where T: NumLike {
1222 type Output = InverseSpecificHeatCapacity<T>;
1223 fn mul(self, rhs: &Temperature<T>) -> Self::Output {
1224 InverseSpecificHeatCapacity{kgK_per_J: self.per_Gy * rhs.K.clone()}
1225 }
1226}
1227impl<T> core::ops::Mul<&Temperature<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1229 type Output = InverseSpecificHeatCapacity<T>;
1230 fn mul(self, rhs: &Temperature<T>) -> Self::Output {
1231 InverseSpecificHeatCapacity{kgK_per_J: self.per_Gy.clone() * rhs.K.clone()}
1232 }
1233}
1234
1235impl<T> core::ops::Div<InverseSpecificHeatCapacity<T>> for InverseAbsorbedDose<T> where T: NumLike {
1238 type Output = InverseTemperature<T>;
1239 fn div(self, rhs: InverseSpecificHeatCapacity<T>) -> Self::Output {
1240 InverseTemperature{per_K: self.per_Gy / rhs.kgK_per_J}
1241 }
1242}
1243impl<T> core::ops::Div<InverseSpecificHeatCapacity<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1245 type Output = InverseTemperature<T>;
1246 fn div(self, rhs: InverseSpecificHeatCapacity<T>) -> Self::Output {
1247 InverseTemperature{per_K: self.per_Gy.clone() / rhs.kgK_per_J}
1248 }
1249}
1250impl<T> core::ops::Div<&InverseSpecificHeatCapacity<T>> for InverseAbsorbedDose<T> where T: NumLike {
1252 type Output = InverseTemperature<T>;
1253 fn div(self, rhs: &InverseSpecificHeatCapacity<T>) -> Self::Output {
1254 InverseTemperature{per_K: self.per_Gy / rhs.kgK_per_J.clone()}
1255 }
1256}
1257impl<T> core::ops::Div<&InverseSpecificHeatCapacity<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1259 type Output = InverseTemperature<T>;
1260 fn div(self, rhs: &InverseSpecificHeatCapacity<T>) -> Self::Output {
1261 InverseTemperature{per_K: self.per_Gy.clone() / rhs.kgK_per_J.clone()}
1262 }
1263}
1264
1265impl<T> core::ops::Mul<SpecificHeatCapacity<T>> for InverseAbsorbedDose<T> where T: NumLike {
1268 type Output = InverseTemperature<T>;
1269 fn mul(self, rhs: SpecificHeatCapacity<T>) -> Self::Output {
1270 InverseTemperature{per_K: self.per_Gy * rhs.J_per_kgK}
1271 }
1272}
1273impl<T> core::ops::Mul<SpecificHeatCapacity<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1275 type Output = InverseTemperature<T>;
1276 fn mul(self, rhs: SpecificHeatCapacity<T>) -> Self::Output {
1277 InverseTemperature{per_K: self.per_Gy.clone() * rhs.J_per_kgK}
1278 }
1279}
1280impl<T> core::ops::Mul<&SpecificHeatCapacity<T>> for InverseAbsorbedDose<T> where T: NumLike {
1282 type Output = InverseTemperature<T>;
1283 fn mul(self, rhs: &SpecificHeatCapacity<T>) -> Self::Output {
1284 InverseTemperature{per_K: self.per_Gy * rhs.J_per_kgK.clone()}
1285 }
1286}
1287impl<T> core::ops::Mul<&SpecificHeatCapacity<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1289 type Output = InverseTemperature<T>;
1290 fn mul(self, rhs: &SpecificHeatCapacity<T>) -> Self::Output {
1291 InverseTemperature{per_K: self.per_Gy.clone() * rhs.J_per_kgK.clone()}
1292 }
1293}
1294
1295impl<T> core::ops::Mul<Acceleration<T>> for InverseAbsorbedDose<T> where T: NumLike {
1298 type Output = InverseDistance<T>;
1299 fn mul(self, rhs: Acceleration<T>) -> Self::Output {
1300 InverseDistance{per_m: self.per_Gy * rhs.mps2}
1301 }
1302}
1303impl<T> core::ops::Mul<Acceleration<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1305 type Output = InverseDistance<T>;
1306 fn mul(self, rhs: Acceleration<T>) -> Self::Output {
1307 InverseDistance{per_m: self.per_Gy.clone() * rhs.mps2}
1308 }
1309}
1310impl<T> core::ops::Mul<&Acceleration<T>> for InverseAbsorbedDose<T> where T: NumLike {
1312 type Output = InverseDistance<T>;
1313 fn mul(self, rhs: &Acceleration<T>) -> Self::Output {
1314 InverseDistance{per_m: self.per_Gy * rhs.mps2.clone()}
1315 }
1316}
1317impl<T> core::ops::Mul<&Acceleration<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1319 type Output = InverseDistance<T>;
1320 fn mul(self, rhs: &Acceleration<T>) -> Self::Output {
1321 InverseDistance{per_m: self.per_Gy.clone() * rhs.mps2.clone()}
1322 }
1323}
1324
1325impl<T> core::ops::Div<Density<T>> for InverseAbsorbedDose<T> where T: NumLike {
1328 type Output = InversePressure<T>;
1329 fn div(self, rhs: Density<T>) -> Self::Output {
1330 InversePressure{per_Pa: self.per_Gy / rhs.kgpm3}
1331 }
1332}
1333impl<T> core::ops::Div<Density<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1335 type Output = InversePressure<T>;
1336 fn div(self, rhs: Density<T>) -> Self::Output {
1337 InversePressure{per_Pa: self.per_Gy.clone() / rhs.kgpm3}
1338 }
1339}
1340impl<T> core::ops::Div<&Density<T>> for InverseAbsorbedDose<T> where T: NumLike {
1342 type Output = InversePressure<T>;
1343 fn div(self, rhs: &Density<T>) -> Self::Output {
1344 InversePressure{per_Pa: self.per_Gy / rhs.kgpm3.clone()}
1345 }
1346}
1347impl<T> core::ops::Div<&Density<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1349 type Output = InversePressure<T>;
1350 fn div(self, rhs: &Density<T>) -> Self::Output {
1351 InversePressure{per_Pa: self.per_Gy.clone() / rhs.kgpm3.clone()}
1352 }
1353}
1354
1355impl<T> core::ops::Mul<Energy<T>> for InverseAbsorbedDose<T> where T: NumLike {
1358 type Output = Mass<T>;
1359 fn mul(self, rhs: Energy<T>) -> Self::Output {
1360 Mass{kg: self.per_Gy * rhs.J}
1361 }
1362}
1363impl<T> core::ops::Mul<Energy<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1365 type Output = Mass<T>;
1366 fn mul(self, rhs: Energy<T>) -> Self::Output {
1367 Mass{kg: self.per_Gy.clone() * rhs.J}
1368 }
1369}
1370impl<T> core::ops::Mul<&Energy<T>> for InverseAbsorbedDose<T> where T: NumLike {
1372 type Output = Mass<T>;
1373 fn mul(self, rhs: &Energy<T>) -> Self::Output {
1374 Mass{kg: self.per_Gy * rhs.J.clone()}
1375 }
1376}
1377impl<T> core::ops::Mul<&Energy<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1379 type Output = Mass<T>;
1380 fn mul(self, rhs: &Energy<T>) -> Self::Output {
1381 Mass{kg: self.per_Gy.clone() * rhs.J.clone()}
1382 }
1383}
1384
1385impl<T> core::ops::Mul<Torque<T>> for InverseAbsorbedDose<T> where T: NumLike {
1388 type Output = Mass<T>;
1389 fn mul(self, rhs: Torque<T>) -> Self::Output {
1390 Mass{kg: self.per_Gy * rhs.Nm}
1391 }
1392}
1393impl<T> core::ops::Mul<Torque<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1395 type Output = Mass<T>;
1396 fn mul(self, rhs: Torque<T>) -> Self::Output {
1397 Mass{kg: self.per_Gy.clone() * rhs.Nm}
1398 }
1399}
1400impl<T> core::ops::Mul<&Torque<T>> for InverseAbsorbedDose<T> where T: NumLike {
1402 type Output = Mass<T>;
1403 fn mul(self, rhs: &Torque<T>) -> Self::Output {
1404 Mass{kg: self.per_Gy * rhs.Nm.clone()}
1405 }
1406}
1407impl<T> core::ops::Mul<&Torque<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1409 type Output = Mass<T>;
1410 fn mul(self, rhs: &Torque<T>) -> Self::Output {
1411 Mass{kg: self.per_Gy.clone() * rhs.Nm.clone()}
1412 }
1413}
1414
1415impl<T> core::ops::Div<InverseAcceleration<T>> for InverseAbsorbedDose<T> where T: NumLike {
1418 type Output = InverseDistance<T>;
1419 fn div(self, rhs: InverseAcceleration<T>) -> Self::Output {
1420 InverseDistance{per_m: self.per_Gy / rhs.s2pm}
1421 }
1422}
1423impl<T> core::ops::Div<InverseAcceleration<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1425 type Output = InverseDistance<T>;
1426 fn div(self, rhs: InverseAcceleration<T>) -> Self::Output {
1427 InverseDistance{per_m: self.per_Gy.clone() / rhs.s2pm}
1428 }
1429}
1430impl<T> core::ops::Div<&InverseAcceleration<T>> for InverseAbsorbedDose<T> where T: NumLike {
1432 type Output = InverseDistance<T>;
1433 fn div(self, rhs: &InverseAcceleration<T>) -> Self::Output {
1434 InverseDistance{per_m: self.per_Gy / rhs.s2pm.clone()}
1435 }
1436}
1437impl<T> core::ops::Div<&InverseAcceleration<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1439 type Output = InverseDistance<T>;
1440 fn div(self, rhs: &InverseAcceleration<T>) -> Self::Output {
1441 InverseDistance{per_m: self.per_Gy.clone() / rhs.s2pm.clone()}
1442 }
1443}
1444
1445impl<T> core::ops::Div<InverseEnergy<T>> for InverseAbsorbedDose<T> where T: NumLike {
1448 type Output = Mass<T>;
1449 fn div(self, rhs: InverseEnergy<T>) -> Self::Output {
1450 Mass{kg: self.per_Gy / rhs.per_J}
1451 }
1452}
1453impl<T> core::ops::Div<InverseEnergy<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1455 type Output = Mass<T>;
1456 fn div(self, rhs: InverseEnergy<T>) -> Self::Output {
1457 Mass{kg: self.per_Gy.clone() / rhs.per_J}
1458 }
1459}
1460impl<T> core::ops::Div<&InverseEnergy<T>> for InverseAbsorbedDose<T> where T: NumLike {
1462 type Output = Mass<T>;
1463 fn div(self, rhs: &InverseEnergy<T>) -> Self::Output {
1464 Mass{kg: self.per_Gy / rhs.per_J.clone()}
1465 }
1466}
1467impl<T> core::ops::Div<&InverseEnergy<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1469 type Output = Mass<T>;
1470 fn div(self, rhs: &InverseEnergy<T>) -> Self::Output {
1471 Mass{kg: self.per_Gy.clone() / rhs.per_J.clone()}
1472 }
1473}
1474
1475impl<T> core::ops::Div<InverseTorque<T>> for InverseAbsorbedDose<T> where T: NumLike {
1478 type Output = Mass<T>;
1479 fn div(self, rhs: InverseTorque<T>) -> Self::Output {
1480 Mass{kg: self.per_Gy / rhs.per_Nm}
1481 }
1482}
1483impl<T> core::ops::Div<InverseTorque<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1485 type Output = Mass<T>;
1486 fn div(self, rhs: InverseTorque<T>) -> Self::Output {
1487 Mass{kg: self.per_Gy.clone() / rhs.per_Nm}
1488 }
1489}
1490impl<T> core::ops::Div<&InverseTorque<T>> for InverseAbsorbedDose<T> where T: NumLike {
1492 type Output = Mass<T>;
1493 fn div(self, rhs: &InverseTorque<T>) -> Self::Output {
1494 Mass{kg: self.per_Gy / rhs.per_Nm.clone()}
1495 }
1496}
1497impl<T> core::ops::Div<&InverseTorque<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1499 type Output = Mass<T>;
1500 fn div(self, rhs: &InverseTorque<T>) -> Self::Output {
1501 Mass{kg: self.per_Gy.clone() / rhs.per_Nm.clone()}
1502 }
1503}
1504
1505impl<T> core::ops::Div<InversePressure<T>> for InverseAbsorbedDose<T> where T: NumLike {
1508 type Output = Density<T>;
1509 fn div(self, rhs: InversePressure<T>) -> Self::Output {
1510 Density{kgpm3: self.per_Gy / rhs.per_Pa}
1511 }
1512}
1513impl<T> core::ops::Div<InversePressure<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1515 type Output = Density<T>;
1516 fn div(self, rhs: InversePressure<T>) -> Self::Output {
1517 Density{kgpm3: self.per_Gy.clone() / rhs.per_Pa}
1518 }
1519}
1520impl<T> core::ops::Div<&InversePressure<T>> for InverseAbsorbedDose<T> where T: NumLike {
1522 type Output = Density<T>;
1523 fn div(self, rhs: &InversePressure<T>) -> Self::Output {
1524 Density{kgpm3: self.per_Gy / rhs.per_Pa.clone()}
1525 }
1526}
1527impl<T> core::ops::Div<&InversePressure<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1529 type Output = Density<T>;
1530 fn div(self, rhs: &InversePressure<T>) -> Self::Output {
1531 Density{kgpm3: self.per_Gy.clone() / rhs.per_Pa.clone()}
1532 }
1533}
1534
1535impl<T> core::ops::Mul<Pressure<T>> for InverseAbsorbedDose<T> where T: NumLike {
1538 type Output = Density<T>;
1539 fn mul(self, rhs: Pressure<T>) -> Self::Output {
1540 Density{kgpm3: self.per_Gy * rhs.Pa}
1541 }
1542}
1543impl<T> core::ops::Mul<Pressure<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1545 type Output = Density<T>;
1546 fn mul(self, rhs: Pressure<T>) -> Self::Output {
1547 Density{kgpm3: self.per_Gy.clone() * rhs.Pa}
1548 }
1549}
1550impl<T> core::ops::Mul<&Pressure<T>> for InverseAbsorbedDose<T> where T: NumLike {
1552 type Output = Density<T>;
1553 fn mul(self, rhs: &Pressure<T>) -> Self::Output {
1554 Density{kgpm3: self.per_Gy * rhs.Pa.clone()}
1555 }
1556}
1557impl<T> core::ops::Mul<&Pressure<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1559 type Output = Density<T>;
1560 fn mul(self, rhs: &Pressure<T>) -> Self::Output {
1561 Density{kgpm3: self.per_Gy.clone() * rhs.Pa.clone()}
1562 }
1563}
1564
1565impl<T> core::ops::Div<TimePerDistance<T>> for InverseAbsorbedDose<T> where T: NumLike {
1568 type Output = TimePerDistance<T>;
1569 fn div(self, rhs: TimePerDistance<T>) -> Self::Output {
1570 TimePerDistance{spm: self.per_Gy / rhs.spm}
1571 }
1572}
1573impl<T> core::ops::Div<TimePerDistance<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1575 type Output = TimePerDistance<T>;
1576 fn div(self, rhs: TimePerDistance<T>) -> Self::Output {
1577 TimePerDistance{spm: self.per_Gy.clone() / rhs.spm}
1578 }
1579}
1580impl<T> core::ops::Div<&TimePerDistance<T>> for InverseAbsorbedDose<T> where T: NumLike {
1582 type Output = TimePerDistance<T>;
1583 fn div(self, rhs: &TimePerDistance<T>) -> Self::Output {
1584 TimePerDistance{spm: self.per_Gy / rhs.spm.clone()}
1585 }
1586}
1587impl<T> core::ops::Div<&TimePerDistance<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1589 type Output = TimePerDistance<T>;
1590 fn div(self, rhs: &TimePerDistance<T>) -> Self::Output {
1591 TimePerDistance{spm: self.per_Gy.clone() / rhs.spm.clone()}
1592 }
1593}
1594
1595impl<T> core::ops::Mul<Velocity<T>> for InverseAbsorbedDose<T> where T: NumLike {
1598 type Output = TimePerDistance<T>;
1599 fn mul(self, rhs: Velocity<T>) -> Self::Output {
1600 TimePerDistance{spm: self.per_Gy * rhs.mps}
1601 }
1602}
1603impl<T> core::ops::Mul<Velocity<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1605 type Output = TimePerDistance<T>;
1606 fn mul(self, rhs: Velocity<T>) -> Self::Output {
1607 TimePerDistance{spm: self.per_Gy.clone() * rhs.mps}
1608 }
1609}
1610impl<T> core::ops::Mul<&Velocity<T>> for InverseAbsorbedDose<T> where T: NumLike {
1612 type Output = TimePerDistance<T>;
1613 fn mul(self, rhs: &Velocity<T>) -> Self::Output {
1614 TimePerDistance{spm: self.per_Gy * rhs.mps.clone()}
1615 }
1616}
1617impl<T> core::ops::Mul<&Velocity<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1619 type Output = TimePerDistance<T>;
1620 fn mul(self, rhs: &Velocity<T>) -> Self::Output {
1621 TimePerDistance{spm: self.per_Gy.clone() * rhs.mps.clone()}
1622 }
1623}
1624
1625impl<T> core::ops::Mul<VolumePerMass<T>> for InverseAbsorbedDose<T> where T: NumLike {
1628 type Output = InversePressure<T>;
1629 fn mul(self, rhs: VolumePerMass<T>) -> Self::Output {
1630 InversePressure{per_Pa: self.per_Gy * rhs.m3_per_kg}
1631 }
1632}
1633impl<T> core::ops::Mul<VolumePerMass<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1635 type Output = InversePressure<T>;
1636 fn mul(self, rhs: VolumePerMass<T>) -> Self::Output {
1637 InversePressure{per_Pa: self.per_Gy.clone() * rhs.m3_per_kg}
1638 }
1639}
1640impl<T> core::ops::Mul<&VolumePerMass<T>> for InverseAbsorbedDose<T> where T: NumLike {
1642 type Output = InversePressure<T>;
1643 fn mul(self, rhs: &VolumePerMass<T>) -> Self::Output {
1644 InversePressure{per_Pa: self.per_Gy * rhs.m3_per_kg.clone()}
1645 }
1646}
1647impl<T> core::ops::Mul<&VolumePerMass<T>> for &InverseAbsorbedDose<T> where T: NumLike {
1649 type Output = InversePressure<T>;
1650 fn mul(self, rhs: &VolumePerMass<T>) -> Self::Output {
1651 InversePressure{per_Pa: self.per_Gy.clone() * rhs.m3_per_kg.clone()}
1652 }
1653}
1654
1655#[derive(UnitStruct, Debug, Clone)]
1657#[cfg_attr(feature="serde", derive(Serialize, Deserialize))]
1658pub struct InverseDoseEquivalent<T: NumLike>{
1659 pub per_Sv: T
1661}
1662
1663impl<T> InverseDoseEquivalent<T> where T: NumLike {
1664
1665 pub fn unit_name() -> &'static str { "inverse sieverts" }
1667
1668 pub fn unit_symbol() -> &'static str { "1/Sv" }
1670
1671 pub fn from_per_Sv(per_Sv: T) -> Self { InverseDoseEquivalent{per_Sv: per_Sv} }
1676
1677 pub fn to_per_Sv(&self) -> T { self.per_Sv.clone() }
1679
1680 pub fn from_per_sieverts(per_sieverts: T) -> Self { InverseDoseEquivalent{per_Sv: per_sieverts} }
1685
1686 pub fn to_per_sieverts(&self) -> T { self.per_Sv.clone() }
1688
1689}
1690
1691impl<T> fmt::Display for InverseDoseEquivalent<T> where T: NumLike {
1692 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1693 write!(f, "{} {}", &self.per_Sv, Self::unit_symbol())
1694 }
1695}
1696
1697impl<T> InverseDoseEquivalent<T> where T: NumLike+From<f64> {
1698
1699 pub fn to_per_mSv(&self) -> T {
1703 return self.per_Sv.clone() * T::from(0.001_f64);
1704 }
1705
1706 pub fn from_per_mSv(per_mSv: T) -> Self {
1713 InverseDoseEquivalent{per_Sv: per_mSv * T::from(1000.0_f64)}
1714 }
1715
1716 pub fn to_per_uSv(&self) -> T {
1720 return self.per_Sv.clone() * T::from(1e-06_f64);
1721 }
1722
1723 pub fn from_per_uSv(per_uSv: T) -> Self {
1730 InverseDoseEquivalent{per_Sv: per_uSv * T::from(1000000.0_f64)}
1731 }
1732
1733 pub fn to_per_nSv(&self) -> T {
1737 return self.per_Sv.clone() * T::from(1e-09_f64);
1738 }
1739
1740 pub fn from_per_nSv(per_nSv: T) -> Self {
1747 InverseDoseEquivalent{per_Sv: per_nSv * T::from(1000000000.0_f64)}
1748 }
1749
1750 pub fn to_per_kSv(&self) -> T {
1754 return self.per_Sv.clone() * T::from(1000.0_f64);
1755 }
1756
1757 pub fn from_per_kSv(per_kSv: T) -> Self {
1764 InverseDoseEquivalent{per_Sv: per_kSv * T::from(0.001_f64)}
1765 }
1766
1767 pub fn to_per_MSv(&self) -> T {
1771 return self.per_Sv.clone() * T::from(1000000.0_f64);
1772 }
1773
1774 pub fn from_per_MSv(per_MSv: T) -> Self {
1781 InverseDoseEquivalent{per_Sv: per_MSv * T::from(1e-06_f64)}
1782 }
1783
1784 pub fn to_per_GSv(&self) -> T {
1788 return self.per_Sv.clone() * T::from(1000000000.0_f64);
1789 }
1790
1791 pub fn from_per_GSv(per_GSv: T) -> Self {
1798 InverseDoseEquivalent{per_Sv: per_GSv * T::from(1e-09_f64)}
1799 }
1800
1801 pub fn to_per_rem(&self) -> T {
1805 return self.per_Sv.clone() * T::from(0.01_f64);
1806 }
1807
1808 pub fn from_per_rem(per_rem: T) -> Self {
1815 InverseDoseEquivalent{per_Sv: per_rem * T::from(100.0_f64)}
1816 }
1817
1818 pub fn to_per_mrem(&self) -> T {
1822 return self.per_Sv.clone() * T::from(1e-05_f64);
1823 }
1824
1825 pub fn from_per_mrem(per_mrem: T) -> Self {
1832 InverseDoseEquivalent{per_Sv: per_mrem * T::from(100000.0_f64)}
1833 }
1834
1835 pub fn to_per_krem(&self) -> T {
1839 return self.per_Sv.clone() * T::from(10.0_f64);
1840 }
1841
1842 pub fn from_per_krem(per_krem: T) -> Self {
1849 InverseDoseEquivalent{per_Sv: per_krem * T::from(0.1_f64)}
1850 }
1851
1852}
1853
1854
1855#[cfg(feature="num-bigfloat")]
1857impl core::ops::Mul<InverseDoseEquivalent<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
1858 type Output = InverseDoseEquivalent<num_bigfloat::BigFloat>;
1859 fn mul(self, rhs: InverseDoseEquivalent<num_bigfloat::BigFloat>) -> Self::Output {
1860 InverseDoseEquivalent{per_Sv: self * rhs.per_Sv}
1861 }
1862}
1863#[cfg(feature="num-bigfloat")]
1865impl core::ops::Mul<InverseDoseEquivalent<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
1866 type Output = InverseDoseEquivalent<num_bigfloat::BigFloat>;
1867 fn mul(self, rhs: InverseDoseEquivalent<num_bigfloat::BigFloat>) -> Self::Output {
1868 InverseDoseEquivalent{per_Sv: self.clone() * rhs.per_Sv}
1869 }
1870}
1871#[cfg(feature="num-bigfloat")]
1873impl core::ops::Mul<&InverseDoseEquivalent<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
1874 type Output = InverseDoseEquivalent<num_bigfloat::BigFloat>;
1875 fn mul(self, rhs: &InverseDoseEquivalent<num_bigfloat::BigFloat>) -> Self::Output {
1876 InverseDoseEquivalent{per_Sv: self * rhs.per_Sv.clone()}
1877 }
1878}
1879#[cfg(feature="num-bigfloat")]
1881impl core::ops::Mul<&InverseDoseEquivalent<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
1882 type Output = InverseDoseEquivalent<num_bigfloat::BigFloat>;
1883 fn mul(self, rhs: &InverseDoseEquivalent<num_bigfloat::BigFloat>) -> Self::Output {
1884 InverseDoseEquivalent{per_Sv: self.clone() * rhs.per_Sv.clone()}
1885 }
1886}
1887
1888#[cfg(feature="num-complex")]
1890impl core::ops::Mul<InverseDoseEquivalent<num_complex::Complex32>> for num_complex::Complex32 {
1891 type Output = InverseDoseEquivalent<num_complex::Complex32>;
1892 fn mul(self, rhs: InverseDoseEquivalent<num_complex::Complex32>) -> Self::Output {
1893 InverseDoseEquivalent{per_Sv: self * rhs.per_Sv}
1894 }
1895}
1896#[cfg(feature="num-complex")]
1898impl core::ops::Mul<InverseDoseEquivalent<num_complex::Complex32>> for &num_complex::Complex32 {
1899 type Output = InverseDoseEquivalent<num_complex::Complex32>;
1900 fn mul(self, rhs: InverseDoseEquivalent<num_complex::Complex32>) -> Self::Output {
1901 InverseDoseEquivalent{per_Sv: self.clone() * rhs.per_Sv}
1902 }
1903}
1904#[cfg(feature="num-complex")]
1906impl core::ops::Mul<&InverseDoseEquivalent<num_complex::Complex32>> for num_complex::Complex32 {
1907 type Output = InverseDoseEquivalent<num_complex::Complex32>;
1908 fn mul(self, rhs: &InverseDoseEquivalent<num_complex::Complex32>) -> Self::Output {
1909 InverseDoseEquivalent{per_Sv: self * rhs.per_Sv.clone()}
1910 }
1911}
1912#[cfg(feature="num-complex")]
1914impl core::ops::Mul<&InverseDoseEquivalent<num_complex::Complex32>> for &num_complex::Complex32 {
1915 type Output = InverseDoseEquivalent<num_complex::Complex32>;
1916 fn mul(self, rhs: &InverseDoseEquivalent<num_complex::Complex32>) -> Self::Output {
1917 InverseDoseEquivalent{per_Sv: self.clone() * rhs.per_Sv.clone()}
1918 }
1919}
1920
1921#[cfg(feature="num-complex")]
1923impl core::ops::Mul<InverseDoseEquivalent<num_complex::Complex64>> for num_complex::Complex64 {
1924 type Output = InverseDoseEquivalent<num_complex::Complex64>;
1925 fn mul(self, rhs: InverseDoseEquivalent<num_complex::Complex64>) -> Self::Output {
1926 InverseDoseEquivalent{per_Sv: self * rhs.per_Sv}
1927 }
1928}
1929#[cfg(feature="num-complex")]
1931impl core::ops::Mul<InverseDoseEquivalent<num_complex::Complex64>> for &num_complex::Complex64 {
1932 type Output = InverseDoseEquivalent<num_complex::Complex64>;
1933 fn mul(self, rhs: InverseDoseEquivalent<num_complex::Complex64>) -> Self::Output {
1934 InverseDoseEquivalent{per_Sv: self.clone() * rhs.per_Sv}
1935 }
1936}
1937#[cfg(feature="num-complex")]
1939impl core::ops::Mul<&InverseDoseEquivalent<num_complex::Complex64>> for num_complex::Complex64 {
1940 type Output = InverseDoseEquivalent<num_complex::Complex64>;
1941 fn mul(self, rhs: &InverseDoseEquivalent<num_complex::Complex64>) -> Self::Output {
1942 InverseDoseEquivalent{per_Sv: self * rhs.per_Sv.clone()}
1943 }
1944}
1945#[cfg(feature="num-complex")]
1947impl core::ops::Mul<&InverseDoseEquivalent<num_complex::Complex64>> for &num_complex::Complex64 {
1948 type Output = InverseDoseEquivalent<num_complex::Complex64>;
1949 fn mul(self, rhs: &InverseDoseEquivalent<num_complex::Complex64>) -> Self::Output {
1950 InverseDoseEquivalent{per_Sv: self.clone() * rhs.per_Sv.clone()}
1951 }
1952}
1953
1954
1955
1956
1957impl<T> core::ops::Mul<Distance<T>> for InverseDoseEquivalent<T> where T: NumLike {
1960 type Output = InverseAcceleration<T>;
1961 fn mul(self, rhs: Distance<T>) -> Self::Output {
1962 InverseAcceleration{s2pm: self.per_Sv * rhs.m}
1963 }
1964}
1965impl<T> core::ops::Mul<Distance<T>> for &InverseDoseEquivalent<T> where T: NumLike {
1967 type Output = InverseAcceleration<T>;
1968 fn mul(self, rhs: Distance<T>) -> Self::Output {
1969 InverseAcceleration{s2pm: self.per_Sv.clone() * rhs.m}
1970 }
1971}
1972impl<T> core::ops::Mul<&Distance<T>> for InverseDoseEquivalent<T> where T: NumLike {
1974 type Output = InverseAcceleration<T>;
1975 fn mul(self, rhs: &Distance<T>) -> Self::Output {
1976 InverseAcceleration{s2pm: self.per_Sv * rhs.m.clone()}
1977 }
1978}
1979impl<T> core::ops::Mul<&Distance<T>> for &InverseDoseEquivalent<T> where T: NumLike {
1981 type Output = InverseAcceleration<T>;
1982 fn mul(self, rhs: &Distance<T>) -> Self::Output {
1983 InverseAcceleration{s2pm: self.per_Sv.clone() * rhs.m.clone()}
1984 }
1985}
1986
1987impl<T> core::ops::Div<InverseDistance<T>> for InverseDoseEquivalent<T> where T: NumLike {
1990 type Output = InverseAcceleration<T>;
1991 fn div(self, rhs: InverseDistance<T>) -> Self::Output {
1992 InverseAcceleration{s2pm: self.per_Sv / rhs.per_m}
1993 }
1994}
1995impl<T> core::ops::Div<InverseDistance<T>> for &InverseDoseEquivalent<T> where T: NumLike {
1997 type Output = InverseAcceleration<T>;
1998 fn div(self, rhs: InverseDistance<T>) -> Self::Output {
1999 InverseAcceleration{s2pm: self.per_Sv.clone() / rhs.per_m}
2000 }
2001}
2002impl<T> core::ops::Div<&InverseDistance<T>> for InverseDoseEquivalent<T> where T: NumLike {
2004 type Output = InverseAcceleration<T>;
2005 fn div(self, rhs: &InverseDistance<T>) -> Self::Output {
2006 InverseAcceleration{s2pm: self.per_Sv / rhs.per_m.clone()}
2007 }
2008}
2009impl<T> core::ops::Div<&InverseDistance<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2011 type Output = InverseAcceleration<T>;
2012 fn div(self, rhs: &InverseDistance<T>) -> Self::Output {
2013 InverseAcceleration{s2pm: self.per_Sv.clone() / rhs.per_m.clone()}
2014 }
2015}
2016
2017impl<T> core::ops::Mul<InverseMass<T>> for InverseDoseEquivalent<T> where T: NumLike {
2020 type Output = InverseEnergy<T>;
2021 fn mul(self, rhs: InverseMass<T>) -> Self::Output {
2022 InverseEnergy{per_J: self.per_Sv * rhs.per_kg}
2023 }
2024}
2025impl<T> core::ops::Mul<InverseMass<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2027 type Output = InverseEnergy<T>;
2028 fn mul(self, rhs: InverseMass<T>) -> Self::Output {
2029 InverseEnergy{per_J: self.per_Sv.clone() * rhs.per_kg}
2030 }
2031}
2032impl<T> core::ops::Mul<&InverseMass<T>> for InverseDoseEquivalent<T> where T: NumLike {
2034 type Output = InverseEnergy<T>;
2035 fn mul(self, rhs: &InverseMass<T>) -> Self::Output {
2036 InverseEnergy{per_J: self.per_Sv * rhs.per_kg.clone()}
2037 }
2038}
2039impl<T> core::ops::Mul<&InverseMass<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2041 type Output = InverseEnergy<T>;
2042 fn mul(self, rhs: &InverseMass<T>) -> Self::Output {
2043 InverseEnergy{per_J: self.per_Sv.clone() * rhs.per_kg.clone()}
2044 }
2045}
2046
2047impl<T> core::ops::Div<InverseTemperature<T>> for InverseDoseEquivalent<T> where T: NumLike {
2050 type Output = InverseSpecificHeatCapacity<T>;
2051 fn div(self, rhs: InverseTemperature<T>) -> Self::Output {
2052 InverseSpecificHeatCapacity{kgK_per_J: self.per_Sv / rhs.per_K}
2053 }
2054}
2055impl<T> core::ops::Div<InverseTemperature<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2057 type Output = InverseSpecificHeatCapacity<T>;
2058 fn div(self, rhs: InverseTemperature<T>) -> Self::Output {
2059 InverseSpecificHeatCapacity{kgK_per_J: self.per_Sv.clone() / rhs.per_K}
2060 }
2061}
2062impl<T> core::ops::Div<&InverseTemperature<T>> for InverseDoseEquivalent<T> where T: NumLike {
2064 type Output = InverseSpecificHeatCapacity<T>;
2065 fn div(self, rhs: &InverseTemperature<T>) -> Self::Output {
2066 InverseSpecificHeatCapacity{kgK_per_J: self.per_Sv / rhs.per_K.clone()}
2067 }
2068}
2069impl<T> core::ops::Div<&InverseTemperature<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2071 type Output = InverseSpecificHeatCapacity<T>;
2072 fn div(self, rhs: &InverseTemperature<T>) -> Self::Output {
2073 InverseSpecificHeatCapacity{kgK_per_J: self.per_Sv.clone() / rhs.per_K.clone()}
2074 }
2075}
2076
2077impl<T> core::ops::Div<Mass<T>> for InverseDoseEquivalent<T> where T: NumLike {
2080 type Output = InverseEnergy<T>;
2081 fn div(self, rhs: Mass<T>) -> Self::Output {
2082 InverseEnergy{per_J: self.per_Sv / rhs.kg}
2083 }
2084}
2085impl<T> core::ops::Div<Mass<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2087 type Output = InverseEnergy<T>;
2088 fn div(self, rhs: Mass<T>) -> Self::Output {
2089 InverseEnergy{per_J: self.per_Sv.clone() / rhs.kg}
2090 }
2091}
2092impl<T> core::ops::Div<&Mass<T>> for InverseDoseEquivalent<T> where T: NumLike {
2094 type Output = InverseEnergy<T>;
2095 fn div(self, rhs: &Mass<T>) -> Self::Output {
2096 InverseEnergy{per_J: self.per_Sv / rhs.kg.clone()}
2097 }
2098}
2099impl<T> core::ops::Div<&Mass<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2101 type Output = InverseEnergy<T>;
2102 fn div(self, rhs: &Mass<T>) -> Self::Output {
2103 InverseEnergy{per_J: self.per_Sv.clone() / rhs.kg.clone()}
2104 }
2105}
2106
2107impl<T> core::ops::Mul<Temperature<T>> for InverseDoseEquivalent<T> where T: NumLike {
2110 type Output = InverseSpecificHeatCapacity<T>;
2111 fn mul(self, rhs: Temperature<T>) -> Self::Output {
2112 InverseSpecificHeatCapacity{kgK_per_J: self.per_Sv * rhs.K}
2113 }
2114}
2115impl<T> core::ops::Mul<Temperature<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2117 type Output = InverseSpecificHeatCapacity<T>;
2118 fn mul(self, rhs: Temperature<T>) -> Self::Output {
2119 InverseSpecificHeatCapacity{kgK_per_J: self.per_Sv.clone() * rhs.K}
2120 }
2121}
2122impl<T> core::ops::Mul<&Temperature<T>> for InverseDoseEquivalent<T> where T: NumLike {
2124 type Output = InverseSpecificHeatCapacity<T>;
2125 fn mul(self, rhs: &Temperature<T>) -> Self::Output {
2126 InverseSpecificHeatCapacity{kgK_per_J: self.per_Sv * rhs.K.clone()}
2127 }
2128}
2129impl<T> core::ops::Mul<&Temperature<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2131 type Output = InverseSpecificHeatCapacity<T>;
2132 fn mul(self, rhs: &Temperature<T>) -> Self::Output {
2133 InverseSpecificHeatCapacity{kgK_per_J: self.per_Sv.clone() * rhs.K.clone()}
2134 }
2135}
2136
2137impl<T> core::ops::Div<InverseSpecificHeatCapacity<T>> for InverseDoseEquivalent<T> where T: NumLike {
2140 type Output = InverseTemperature<T>;
2141 fn div(self, rhs: InverseSpecificHeatCapacity<T>) -> Self::Output {
2142 InverseTemperature{per_K: self.per_Sv / rhs.kgK_per_J}
2143 }
2144}
2145impl<T> core::ops::Div<InverseSpecificHeatCapacity<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2147 type Output = InverseTemperature<T>;
2148 fn div(self, rhs: InverseSpecificHeatCapacity<T>) -> Self::Output {
2149 InverseTemperature{per_K: self.per_Sv.clone() / rhs.kgK_per_J}
2150 }
2151}
2152impl<T> core::ops::Div<&InverseSpecificHeatCapacity<T>> for InverseDoseEquivalent<T> where T: NumLike {
2154 type Output = InverseTemperature<T>;
2155 fn div(self, rhs: &InverseSpecificHeatCapacity<T>) -> Self::Output {
2156 InverseTemperature{per_K: self.per_Sv / rhs.kgK_per_J.clone()}
2157 }
2158}
2159impl<T> core::ops::Div<&InverseSpecificHeatCapacity<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2161 type Output = InverseTemperature<T>;
2162 fn div(self, rhs: &InverseSpecificHeatCapacity<T>) -> Self::Output {
2163 InverseTemperature{per_K: self.per_Sv.clone() / rhs.kgK_per_J.clone()}
2164 }
2165}
2166
2167impl<T> core::ops::Mul<SpecificHeatCapacity<T>> for InverseDoseEquivalent<T> where T: NumLike {
2170 type Output = InverseTemperature<T>;
2171 fn mul(self, rhs: SpecificHeatCapacity<T>) -> Self::Output {
2172 InverseTemperature{per_K: self.per_Sv * rhs.J_per_kgK}
2173 }
2174}
2175impl<T> core::ops::Mul<SpecificHeatCapacity<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2177 type Output = InverseTemperature<T>;
2178 fn mul(self, rhs: SpecificHeatCapacity<T>) -> Self::Output {
2179 InverseTemperature{per_K: self.per_Sv.clone() * rhs.J_per_kgK}
2180 }
2181}
2182impl<T> core::ops::Mul<&SpecificHeatCapacity<T>> for InverseDoseEquivalent<T> where T: NumLike {
2184 type Output = InverseTemperature<T>;
2185 fn mul(self, rhs: &SpecificHeatCapacity<T>) -> Self::Output {
2186 InverseTemperature{per_K: self.per_Sv * rhs.J_per_kgK.clone()}
2187 }
2188}
2189impl<T> core::ops::Mul<&SpecificHeatCapacity<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2191 type Output = InverseTemperature<T>;
2192 fn mul(self, rhs: &SpecificHeatCapacity<T>) -> Self::Output {
2193 InverseTemperature{per_K: self.per_Sv.clone() * rhs.J_per_kgK.clone()}
2194 }
2195}
2196
2197impl<T> core::ops::Mul<Acceleration<T>> for InverseDoseEquivalent<T> where T: NumLike {
2200 type Output = InverseDistance<T>;
2201 fn mul(self, rhs: Acceleration<T>) -> Self::Output {
2202 InverseDistance{per_m: self.per_Sv * rhs.mps2}
2203 }
2204}
2205impl<T> core::ops::Mul<Acceleration<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2207 type Output = InverseDistance<T>;
2208 fn mul(self, rhs: Acceleration<T>) -> Self::Output {
2209 InverseDistance{per_m: self.per_Sv.clone() * rhs.mps2}
2210 }
2211}
2212impl<T> core::ops::Mul<&Acceleration<T>> for InverseDoseEquivalent<T> where T: NumLike {
2214 type Output = InverseDistance<T>;
2215 fn mul(self, rhs: &Acceleration<T>) -> Self::Output {
2216 InverseDistance{per_m: self.per_Sv * rhs.mps2.clone()}
2217 }
2218}
2219impl<T> core::ops::Mul<&Acceleration<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2221 type Output = InverseDistance<T>;
2222 fn mul(self, rhs: &Acceleration<T>) -> Self::Output {
2223 InverseDistance{per_m: self.per_Sv.clone() * rhs.mps2.clone()}
2224 }
2225}
2226
2227impl<T> core::ops::Div<Density<T>> for InverseDoseEquivalent<T> where T: NumLike {
2230 type Output = InversePressure<T>;
2231 fn div(self, rhs: Density<T>) -> Self::Output {
2232 InversePressure{per_Pa: self.per_Sv / rhs.kgpm3}
2233 }
2234}
2235impl<T> core::ops::Div<Density<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2237 type Output = InversePressure<T>;
2238 fn div(self, rhs: Density<T>) -> Self::Output {
2239 InversePressure{per_Pa: self.per_Sv.clone() / rhs.kgpm3}
2240 }
2241}
2242impl<T> core::ops::Div<&Density<T>> for InverseDoseEquivalent<T> where T: NumLike {
2244 type Output = InversePressure<T>;
2245 fn div(self, rhs: &Density<T>) -> Self::Output {
2246 InversePressure{per_Pa: self.per_Sv / rhs.kgpm3.clone()}
2247 }
2248}
2249impl<T> core::ops::Div<&Density<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2251 type Output = InversePressure<T>;
2252 fn div(self, rhs: &Density<T>) -> Self::Output {
2253 InversePressure{per_Pa: self.per_Sv.clone() / rhs.kgpm3.clone()}
2254 }
2255}
2256
2257impl<T> core::ops::Mul<Energy<T>> for InverseDoseEquivalent<T> where T: NumLike {
2260 type Output = Mass<T>;
2261 fn mul(self, rhs: Energy<T>) -> Self::Output {
2262 Mass{kg: self.per_Sv * rhs.J}
2263 }
2264}
2265impl<T> core::ops::Mul<Energy<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2267 type Output = Mass<T>;
2268 fn mul(self, rhs: Energy<T>) -> Self::Output {
2269 Mass{kg: self.per_Sv.clone() * rhs.J}
2270 }
2271}
2272impl<T> core::ops::Mul<&Energy<T>> for InverseDoseEquivalent<T> where T: NumLike {
2274 type Output = Mass<T>;
2275 fn mul(self, rhs: &Energy<T>) -> Self::Output {
2276 Mass{kg: self.per_Sv * rhs.J.clone()}
2277 }
2278}
2279impl<T> core::ops::Mul<&Energy<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2281 type Output = Mass<T>;
2282 fn mul(self, rhs: &Energy<T>) -> Self::Output {
2283 Mass{kg: self.per_Sv.clone() * rhs.J.clone()}
2284 }
2285}
2286
2287impl<T> core::ops::Mul<Torque<T>> for InverseDoseEquivalent<T> where T: NumLike {
2290 type Output = Mass<T>;
2291 fn mul(self, rhs: Torque<T>) -> Self::Output {
2292 Mass{kg: self.per_Sv * rhs.Nm}
2293 }
2294}
2295impl<T> core::ops::Mul<Torque<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2297 type Output = Mass<T>;
2298 fn mul(self, rhs: Torque<T>) -> Self::Output {
2299 Mass{kg: self.per_Sv.clone() * rhs.Nm}
2300 }
2301}
2302impl<T> core::ops::Mul<&Torque<T>> for InverseDoseEquivalent<T> where T: NumLike {
2304 type Output = Mass<T>;
2305 fn mul(self, rhs: &Torque<T>) -> Self::Output {
2306 Mass{kg: self.per_Sv * rhs.Nm.clone()}
2307 }
2308}
2309impl<T> core::ops::Mul<&Torque<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2311 type Output = Mass<T>;
2312 fn mul(self, rhs: &Torque<T>) -> Self::Output {
2313 Mass{kg: self.per_Sv.clone() * rhs.Nm.clone()}
2314 }
2315}
2316
2317impl<T> core::ops::Div<InverseAcceleration<T>> for InverseDoseEquivalent<T> where T: NumLike {
2320 type Output = InverseDistance<T>;
2321 fn div(self, rhs: InverseAcceleration<T>) -> Self::Output {
2322 InverseDistance{per_m: self.per_Sv / rhs.s2pm}
2323 }
2324}
2325impl<T> core::ops::Div<InverseAcceleration<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2327 type Output = InverseDistance<T>;
2328 fn div(self, rhs: InverseAcceleration<T>) -> Self::Output {
2329 InverseDistance{per_m: self.per_Sv.clone() / rhs.s2pm}
2330 }
2331}
2332impl<T> core::ops::Div<&InverseAcceleration<T>> for InverseDoseEquivalent<T> where T: NumLike {
2334 type Output = InverseDistance<T>;
2335 fn div(self, rhs: &InverseAcceleration<T>) -> Self::Output {
2336 InverseDistance{per_m: self.per_Sv / rhs.s2pm.clone()}
2337 }
2338}
2339impl<T> core::ops::Div<&InverseAcceleration<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2341 type Output = InverseDistance<T>;
2342 fn div(self, rhs: &InverseAcceleration<T>) -> Self::Output {
2343 InverseDistance{per_m: self.per_Sv.clone() / rhs.s2pm.clone()}
2344 }
2345}
2346
2347impl<T> core::ops::Div<InverseEnergy<T>> for InverseDoseEquivalent<T> where T: NumLike {
2350 type Output = Mass<T>;
2351 fn div(self, rhs: InverseEnergy<T>) -> Self::Output {
2352 Mass{kg: self.per_Sv / rhs.per_J}
2353 }
2354}
2355impl<T> core::ops::Div<InverseEnergy<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2357 type Output = Mass<T>;
2358 fn div(self, rhs: InverseEnergy<T>) -> Self::Output {
2359 Mass{kg: self.per_Sv.clone() / rhs.per_J}
2360 }
2361}
2362impl<T> core::ops::Div<&InverseEnergy<T>> for InverseDoseEquivalent<T> where T: NumLike {
2364 type Output = Mass<T>;
2365 fn div(self, rhs: &InverseEnergy<T>) -> Self::Output {
2366 Mass{kg: self.per_Sv / rhs.per_J.clone()}
2367 }
2368}
2369impl<T> core::ops::Div<&InverseEnergy<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2371 type Output = Mass<T>;
2372 fn div(self, rhs: &InverseEnergy<T>) -> Self::Output {
2373 Mass{kg: self.per_Sv.clone() / rhs.per_J.clone()}
2374 }
2375}
2376
2377impl<T> core::ops::Div<InverseTorque<T>> for InverseDoseEquivalent<T> where T: NumLike {
2380 type Output = Mass<T>;
2381 fn div(self, rhs: InverseTorque<T>) -> Self::Output {
2382 Mass{kg: self.per_Sv / rhs.per_Nm}
2383 }
2384}
2385impl<T> core::ops::Div<InverseTorque<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2387 type Output = Mass<T>;
2388 fn div(self, rhs: InverseTorque<T>) -> Self::Output {
2389 Mass{kg: self.per_Sv.clone() / rhs.per_Nm}
2390 }
2391}
2392impl<T> core::ops::Div<&InverseTorque<T>> for InverseDoseEquivalent<T> where T: NumLike {
2394 type Output = Mass<T>;
2395 fn div(self, rhs: &InverseTorque<T>) -> Self::Output {
2396 Mass{kg: self.per_Sv / rhs.per_Nm.clone()}
2397 }
2398}
2399impl<T> core::ops::Div<&InverseTorque<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2401 type Output = Mass<T>;
2402 fn div(self, rhs: &InverseTorque<T>) -> Self::Output {
2403 Mass{kg: self.per_Sv.clone() / rhs.per_Nm.clone()}
2404 }
2405}
2406
2407impl<T> core::ops::Div<InversePressure<T>> for InverseDoseEquivalent<T> where T: NumLike {
2410 type Output = Density<T>;
2411 fn div(self, rhs: InversePressure<T>) -> Self::Output {
2412 Density{kgpm3: self.per_Sv / rhs.per_Pa}
2413 }
2414}
2415impl<T> core::ops::Div<InversePressure<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2417 type Output = Density<T>;
2418 fn div(self, rhs: InversePressure<T>) -> Self::Output {
2419 Density{kgpm3: self.per_Sv.clone() / rhs.per_Pa}
2420 }
2421}
2422impl<T> core::ops::Div<&InversePressure<T>> for InverseDoseEquivalent<T> where T: NumLike {
2424 type Output = Density<T>;
2425 fn div(self, rhs: &InversePressure<T>) -> Self::Output {
2426 Density{kgpm3: self.per_Sv / rhs.per_Pa.clone()}
2427 }
2428}
2429impl<T> core::ops::Div<&InversePressure<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2431 type Output = Density<T>;
2432 fn div(self, rhs: &InversePressure<T>) -> Self::Output {
2433 Density{kgpm3: self.per_Sv.clone() / rhs.per_Pa.clone()}
2434 }
2435}
2436
2437impl<T> core::ops::Mul<Pressure<T>> for InverseDoseEquivalent<T> where T: NumLike {
2440 type Output = Density<T>;
2441 fn mul(self, rhs: Pressure<T>) -> Self::Output {
2442 Density{kgpm3: self.per_Sv * rhs.Pa}
2443 }
2444}
2445impl<T> core::ops::Mul<Pressure<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2447 type Output = Density<T>;
2448 fn mul(self, rhs: Pressure<T>) -> Self::Output {
2449 Density{kgpm3: self.per_Sv.clone() * rhs.Pa}
2450 }
2451}
2452impl<T> core::ops::Mul<&Pressure<T>> for InverseDoseEquivalent<T> where T: NumLike {
2454 type Output = Density<T>;
2455 fn mul(self, rhs: &Pressure<T>) -> Self::Output {
2456 Density{kgpm3: self.per_Sv * rhs.Pa.clone()}
2457 }
2458}
2459impl<T> core::ops::Mul<&Pressure<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2461 type Output = Density<T>;
2462 fn mul(self, rhs: &Pressure<T>) -> Self::Output {
2463 Density{kgpm3: self.per_Sv.clone() * rhs.Pa.clone()}
2464 }
2465}
2466
2467impl<T> core::ops::Div<TimePerDistance<T>> for InverseDoseEquivalent<T> where T: NumLike {
2470 type Output = TimePerDistance<T>;
2471 fn div(self, rhs: TimePerDistance<T>) -> Self::Output {
2472 TimePerDistance{spm: self.per_Sv / rhs.spm}
2473 }
2474}
2475impl<T> core::ops::Div<TimePerDistance<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2477 type Output = TimePerDistance<T>;
2478 fn div(self, rhs: TimePerDistance<T>) -> Self::Output {
2479 TimePerDistance{spm: self.per_Sv.clone() / rhs.spm}
2480 }
2481}
2482impl<T> core::ops::Div<&TimePerDistance<T>> for InverseDoseEquivalent<T> where T: NumLike {
2484 type Output = TimePerDistance<T>;
2485 fn div(self, rhs: &TimePerDistance<T>) -> Self::Output {
2486 TimePerDistance{spm: self.per_Sv / rhs.spm.clone()}
2487 }
2488}
2489impl<T> core::ops::Div<&TimePerDistance<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2491 type Output = TimePerDistance<T>;
2492 fn div(self, rhs: &TimePerDistance<T>) -> Self::Output {
2493 TimePerDistance{spm: self.per_Sv.clone() / rhs.spm.clone()}
2494 }
2495}
2496
2497impl<T> core::ops::Mul<Velocity<T>> for InverseDoseEquivalent<T> where T: NumLike {
2500 type Output = TimePerDistance<T>;
2501 fn mul(self, rhs: Velocity<T>) -> Self::Output {
2502 TimePerDistance{spm: self.per_Sv * rhs.mps}
2503 }
2504}
2505impl<T> core::ops::Mul<Velocity<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2507 type Output = TimePerDistance<T>;
2508 fn mul(self, rhs: Velocity<T>) -> Self::Output {
2509 TimePerDistance{spm: self.per_Sv.clone() * rhs.mps}
2510 }
2511}
2512impl<T> core::ops::Mul<&Velocity<T>> for InverseDoseEquivalent<T> where T: NumLike {
2514 type Output = TimePerDistance<T>;
2515 fn mul(self, rhs: &Velocity<T>) -> Self::Output {
2516 TimePerDistance{spm: self.per_Sv * rhs.mps.clone()}
2517 }
2518}
2519impl<T> core::ops::Mul<&Velocity<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2521 type Output = TimePerDistance<T>;
2522 fn mul(self, rhs: &Velocity<T>) -> Self::Output {
2523 TimePerDistance{spm: self.per_Sv.clone() * rhs.mps.clone()}
2524 }
2525}
2526
2527impl<T> core::ops::Mul<VolumePerMass<T>> for InverseDoseEquivalent<T> where T: NumLike {
2530 type Output = InversePressure<T>;
2531 fn mul(self, rhs: VolumePerMass<T>) -> Self::Output {
2532 InversePressure{per_Pa: self.per_Sv * rhs.m3_per_kg}
2533 }
2534}
2535impl<T> core::ops::Mul<VolumePerMass<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2537 type Output = InversePressure<T>;
2538 fn mul(self, rhs: VolumePerMass<T>) -> Self::Output {
2539 InversePressure{per_Pa: self.per_Sv.clone() * rhs.m3_per_kg}
2540 }
2541}
2542impl<T> core::ops::Mul<&VolumePerMass<T>> for InverseDoseEquivalent<T> where T: NumLike {
2544 type Output = InversePressure<T>;
2545 fn mul(self, rhs: &VolumePerMass<T>) -> Self::Output {
2546 InversePressure{per_Pa: self.per_Sv * rhs.m3_per_kg.clone()}
2547 }
2548}
2549impl<T> core::ops::Mul<&VolumePerMass<T>> for &InverseDoseEquivalent<T> where T: NumLike {
2551 type Output = InversePressure<T>;
2552 fn mul(self, rhs: &VolumePerMass<T>) -> Self::Output {
2553 InversePressure{per_Pa: self.per_Sv.clone() * rhs.m3_per_kg.clone()}
2554 }
2555}
2556
2557#[derive(UnitStruct, Debug, Clone)]
2559#[cfg_attr(feature="serde", derive(Serialize, Deserialize))]
2560pub struct Radioactivity<T: NumLike>{
2561 pub Bq: T
2563}
2564
2565impl<T> Radioactivity<T> where T: NumLike {
2566
2567 pub fn unit_name() -> &'static str { "becquerels" }
2569
2570 pub fn unit_symbol() -> &'static str { "Bq" }
2572
2573 pub fn from_Bq(Bq: T) -> Self { Radioactivity{Bq: Bq} }
2578
2579 pub fn to_Bq(&self) -> T { self.Bq.clone() }
2581
2582 pub fn from_becquerels(becquerels: T) -> Self { Radioactivity{Bq: becquerels} }
2587
2588 pub fn to_becquerels(&self) -> T { self.Bq.clone() }
2590
2591}
2592
2593impl<T> fmt::Display for Radioactivity<T> where T: NumLike {
2594 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2595 write!(f, "{} {}", &self.Bq, Self::unit_symbol())
2596 }
2597}
2598
2599impl<T> Radioactivity<T> where T: NumLike+From<f64> {
2600
2601 pub fn to_mBq(&self) -> T {
2605 return self.Bq.clone() * T::from(1000.0_f64);
2606 }
2607
2608 pub fn from_mBq(mBq: T) -> Self {
2615 Radioactivity{Bq: mBq * T::from(0.001_f64)}
2616 }
2617
2618 pub fn to_uBq(&self) -> T {
2622 return self.Bq.clone() * T::from(1000000.0_f64);
2623 }
2624
2625 pub fn from_uBq(uBq: T) -> Self {
2632 Radioactivity{Bq: uBq * T::from(1e-06_f64)}
2633 }
2634
2635 pub fn to_nBq(&self) -> T {
2639 return self.Bq.clone() * T::from(1000000000.0_f64);
2640 }
2641
2642 pub fn from_nBq(nBq: T) -> Self {
2649 Radioactivity{Bq: nBq * T::from(1e-09_f64)}
2650 }
2651
2652 pub fn to_kBq(&self) -> T {
2656 return self.Bq.clone() * T::from(0.001_f64);
2657 }
2658
2659 pub fn from_kBq(kBq: T) -> Self {
2666 Radioactivity{Bq: kBq * T::from(1000.0_f64)}
2667 }
2668
2669 pub fn to_MBq(&self) -> T {
2673 return self.Bq.clone() * T::from(1e-06_f64);
2674 }
2675
2676 pub fn from_MBq(MBq: T) -> Self {
2683 Radioactivity{Bq: MBq * T::from(1000000.0_f64)}
2684 }
2685
2686 pub fn to_GBq(&self) -> T {
2690 return self.Bq.clone() * T::from(1e-09_f64);
2691 }
2692
2693 pub fn from_GBq(GBq: T) -> Self {
2700 Radioactivity{Bq: GBq * T::from(1000000000.0_f64)}
2701 }
2702
2703 pub fn to_Ci(&self) -> T {
2707 return self.Bq.clone() * T::from(2.7027027027027e-11_f64);
2708 }
2709
2710 pub fn from_Ci(Ci: T) -> Self {
2717 Radioactivity{Bq: Ci * T::from(37000000000.0_f64)}
2718 }
2719
2720 pub fn to_mCi(&self) -> T {
2724 return self.Bq.clone() * T::from(2.7027027027027e-08_f64);
2725 }
2726
2727 pub fn from_mCi(mCi: T) -> Self {
2734 Radioactivity{Bq: mCi * T::from(37000000.0_f64)}
2735 }
2736
2737 pub fn to_uCi(&self) -> T {
2741 return self.Bq.clone() * T::from(2.7027027027027e-05_f64);
2742 }
2743
2744 pub fn from_uCi(uCi: T) -> Self {
2751 Radioactivity{Bq: uCi * T::from(37000.0_f64)}
2752 }
2753
2754 pub fn to_nCi(&self) -> T {
2758 return self.Bq.clone() * T::from(0.027027027027027_f64);
2759 }
2760
2761 pub fn from_nCi(nCi: T) -> Self {
2768 Radioactivity{Bq: nCi * T::from(37.0_f64)}
2769 }
2770
2771 pub fn to_pCi(&self) -> T {
2775 return self.Bq.clone() * T::from(27.027027027027_f64);
2776 }
2777
2778 pub fn from_pCi(pCi: T) -> Self {
2785 Radioactivity{Bq: pCi * T::from(0.037_f64)}
2786 }
2787
2788 pub fn to_Rd(&self) -> T {
2792 return self.Bq.clone() * T::from(1e-06_f64);
2793 }
2794
2795 pub fn from_Rd(Rd: T) -> Self {
2802 Radioactivity{Bq: Rd * T::from(1000000.0_f64)}
2803 }
2804
2805}
2806
2807
2808#[cfg(feature="num-bigfloat")]
2810impl core::ops::Mul<Radioactivity<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
2811 type Output = Radioactivity<num_bigfloat::BigFloat>;
2812 fn mul(self, rhs: Radioactivity<num_bigfloat::BigFloat>) -> Self::Output {
2813 Radioactivity{Bq: self * rhs.Bq}
2814 }
2815}
2816#[cfg(feature="num-bigfloat")]
2818impl core::ops::Mul<Radioactivity<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
2819 type Output = Radioactivity<num_bigfloat::BigFloat>;
2820 fn mul(self, rhs: Radioactivity<num_bigfloat::BigFloat>) -> Self::Output {
2821 Radioactivity{Bq: self.clone() * rhs.Bq}
2822 }
2823}
2824#[cfg(feature="num-bigfloat")]
2826impl core::ops::Mul<&Radioactivity<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
2827 type Output = Radioactivity<num_bigfloat::BigFloat>;
2828 fn mul(self, rhs: &Radioactivity<num_bigfloat::BigFloat>) -> Self::Output {
2829 Radioactivity{Bq: self * rhs.Bq.clone()}
2830 }
2831}
2832#[cfg(feature="num-bigfloat")]
2834impl core::ops::Mul<&Radioactivity<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
2835 type Output = Radioactivity<num_bigfloat::BigFloat>;
2836 fn mul(self, rhs: &Radioactivity<num_bigfloat::BigFloat>) -> Self::Output {
2837 Radioactivity{Bq: self.clone() * rhs.Bq.clone()}
2838 }
2839}
2840
2841#[cfg(feature="num-complex")]
2843impl core::ops::Mul<Radioactivity<num_complex::Complex32>> for num_complex::Complex32 {
2844 type Output = Radioactivity<num_complex::Complex32>;
2845 fn mul(self, rhs: Radioactivity<num_complex::Complex32>) -> Self::Output {
2846 Radioactivity{Bq: self * rhs.Bq}
2847 }
2848}
2849#[cfg(feature="num-complex")]
2851impl core::ops::Mul<Radioactivity<num_complex::Complex32>> for &num_complex::Complex32 {
2852 type Output = Radioactivity<num_complex::Complex32>;
2853 fn mul(self, rhs: Radioactivity<num_complex::Complex32>) -> Self::Output {
2854 Radioactivity{Bq: self.clone() * rhs.Bq}
2855 }
2856}
2857#[cfg(feature="num-complex")]
2859impl core::ops::Mul<&Radioactivity<num_complex::Complex32>> for num_complex::Complex32 {
2860 type Output = Radioactivity<num_complex::Complex32>;
2861 fn mul(self, rhs: &Radioactivity<num_complex::Complex32>) -> Self::Output {
2862 Radioactivity{Bq: self * rhs.Bq.clone()}
2863 }
2864}
2865#[cfg(feature="num-complex")]
2867impl core::ops::Mul<&Radioactivity<num_complex::Complex32>> for &num_complex::Complex32 {
2868 type Output = Radioactivity<num_complex::Complex32>;
2869 fn mul(self, rhs: &Radioactivity<num_complex::Complex32>) -> Self::Output {
2870 Radioactivity{Bq: self.clone() * rhs.Bq.clone()}
2871 }
2872}
2873
2874#[cfg(feature="num-complex")]
2876impl core::ops::Mul<Radioactivity<num_complex::Complex64>> for num_complex::Complex64 {
2877 type Output = Radioactivity<num_complex::Complex64>;
2878 fn mul(self, rhs: Radioactivity<num_complex::Complex64>) -> Self::Output {
2879 Radioactivity{Bq: self * rhs.Bq}
2880 }
2881}
2882#[cfg(feature="num-complex")]
2884impl core::ops::Mul<Radioactivity<num_complex::Complex64>> for &num_complex::Complex64 {
2885 type Output = Radioactivity<num_complex::Complex64>;
2886 fn mul(self, rhs: Radioactivity<num_complex::Complex64>) -> Self::Output {
2887 Radioactivity{Bq: self.clone() * rhs.Bq}
2888 }
2889}
2890#[cfg(feature="num-complex")]
2892impl core::ops::Mul<&Radioactivity<num_complex::Complex64>> for num_complex::Complex64 {
2893 type Output = Radioactivity<num_complex::Complex64>;
2894 fn mul(self, rhs: &Radioactivity<num_complex::Complex64>) -> Self::Output {
2895 Radioactivity{Bq: self * rhs.Bq.clone()}
2896 }
2897}
2898#[cfg(feature="num-complex")]
2900impl core::ops::Mul<&Radioactivity<num_complex::Complex64>> for &num_complex::Complex64 {
2901 type Output = Radioactivity<num_complex::Complex64>;
2902 fn mul(self, rhs: &Radioactivity<num_complex::Complex64>) -> Self::Output {
2903 Radioactivity{Bq: self.clone() * rhs.Bq.clone()}
2904 }
2905}
2906
2907
2908
2909#[cfg(feature = "uom")]
2911impl<T> Into<uom::si::f32::Radioactivity> for Radioactivity<T> where T: NumLike+Into<f32> {
2912 fn into(self) -> uom::si::f32::Radioactivity {
2913 uom::si::f32::Radioactivity::new::<uom::si::radioactivity::becquerel>(self.Bq.into())
2914 }
2915}
2916
2917#[cfg(feature = "uom")]
2919impl<T> From<uom::si::f32::Radioactivity> for Radioactivity<T> where T: NumLike+From<f32> {
2920 fn from(src: uom::si::f32::Radioactivity) -> Self {
2921 Radioactivity{Bq: T::from(src.value)}
2922 }
2923}
2924
2925#[cfg(feature = "uom")]
2927impl<T> Into<uom::si::f64::Radioactivity> for Radioactivity<T> where T: NumLike+Into<f64> {
2928 fn into(self) -> uom::si::f64::Radioactivity {
2929 uom::si::f64::Radioactivity::new::<uom::si::radioactivity::becquerel>(self.Bq.into())
2930 }
2931}
2932
2933#[cfg(feature = "uom")]
2935impl<T> From<uom::si::f64::Radioactivity> for Radioactivity<T> where T: NumLike+From<f64> {
2936 fn from(src: uom::si::f64::Radioactivity) -> Self {
2937 Radioactivity{Bq: T::from(src.value)}
2938 }
2939}
2940
2941
2942impl<T> core::ops::Div<Radioactivity<T>> for f64 where T: NumLike+From<f64> {
2945 type Output = Time<T>;
2946 fn div(self, rhs: Radioactivity<T>) -> Self::Output {
2947 Time{s: T::from(self) / rhs.Bq}
2948 }
2949}
2950impl<T> core::ops::Div<Radioactivity<T>> for &f64 where T: NumLike+From<f64> {
2952 type Output = Time<T>;
2953 fn div(self, rhs: Radioactivity<T>) -> Self::Output {
2954 Time{s: T::from(self.clone()) / rhs.Bq}
2955 }
2956}
2957impl<T> core::ops::Div<&Radioactivity<T>> for f64 where T: NumLike+From<f64> {
2959 type Output = Time<T>;
2960 fn div(self, rhs: &Radioactivity<T>) -> Self::Output {
2961 Time{s: T::from(self) / rhs.Bq.clone()}
2962 }
2963}
2964impl<T> core::ops::Div<&Radioactivity<T>> for &f64 where T: NumLike+From<f64> {
2966 type Output = Time<T>;
2967 fn div(self, rhs: &Radioactivity<T>) -> Self::Output {
2968 Time{s: T::from(self.clone()) / rhs.Bq.clone()}
2969 }
2970}
2971
2972impl<T> core::ops::Div<Radioactivity<T>> for f32 where T: NumLike+From<f32> {
2975 type Output = Time<T>;
2976 fn div(self, rhs: Radioactivity<T>) -> Self::Output {
2977 Time{s: T::from(self) / rhs.Bq}
2978 }
2979}
2980impl<T> core::ops::Div<Radioactivity<T>> for &f32 where T: NumLike+From<f32> {
2982 type Output = Time<T>;
2983 fn div(self, rhs: Radioactivity<T>) -> Self::Output {
2984 Time{s: T::from(self.clone()) / rhs.Bq}
2985 }
2986}
2987impl<T> core::ops::Div<&Radioactivity<T>> for f32 where T: NumLike+From<f32> {
2989 type Output = Time<T>;
2990 fn div(self, rhs: &Radioactivity<T>) -> Self::Output {
2991 Time{s: T::from(self) / rhs.Bq.clone()}
2992 }
2993}
2994impl<T> core::ops::Div<&Radioactivity<T>> for &f32 where T: NumLike+From<f32> {
2996 type Output = Time<T>;
2997 fn div(self, rhs: &Radioactivity<T>) -> Self::Output {
2998 Time{s: T::from(self.clone()) / rhs.Bq.clone()}
2999 }
3000}
3001
3002impl<T> core::ops::Div<Radioactivity<T>> for i64 where T: NumLike+From<i64> {
3005 type Output = Time<T>;
3006 fn div(self, rhs: Radioactivity<T>) -> Self::Output {
3007 Time{s: T::from(self) / rhs.Bq}
3008 }
3009}
3010impl<T> core::ops::Div<Radioactivity<T>> for &i64 where T: NumLike+From<i64> {
3012 type Output = Time<T>;
3013 fn div(self, rhs: Radioactivity<T>) -> Self::Output {
3014 Time{s: T::from(self.clone()) / rhs.Bq}
3015 }
3016}
3017impl<T> core::ops::Div<&Radioactivity<T>> for i64 where T: NumLike+From<i64> {
3019 type Output = Time<T>;
3020 fn div(self, rhs: &Radioactivity<T>) -> Self::Output {
3021 Time{s: T::from(self) / rhs.Bq.clone()}
3022 }
3023}
3024impl<T> core::ops::Div<&Radioactivity<T>> for &i64 where T: NumLike+From<i64> {
3026 type Output = Time<T>;
3027 fn div(self, rhs: &Radioactivity<T>) -> Self::Output {
3028 Time{s: T::from(self.clone()) / rhs.Bq.clone()}
3029 }
3030}
3031
3032impl<T> core::ops::Div<Radioactivity<T>> for i32 where T: NumLike+From<i32> {
3035 type Output = Time<T>;
3036 fn div(self, rhs: Radioactivity<T>) -> Self::Output {
3037 Time{s: T::from(self) / rhs.Bq}
3038 }
3039}
3040impl<T> core::ops::Div<Radioactivity<T>> for &i32 where T: NumLike+From<i32> {
3042 type Output = Time<T>;
3043 fn div(self, rhs: Radioactivity<T>) -> Self::Output {
3044 Time{s: T::from(self.clone()) / rhs.Bq}
3045 }
3046}
3047impl<T> core::ops::Div<&Radioactivity<T>> for i32 where T: NumLike+From<i32> {
3049 type Output = Time<T>;
3050 fn div(self, rhs: &Radioactivity<T>) -> Self::Output {
3051 Time{s: T::from(self) / rhs.Bq.clone()}
3052 }
3053}
3054impl<T> core::ops::Div<&Radioactivity<T>> for &i32 where T: NumLike+From<i32> {
3056 type Output = Time<T>;
3057 fn div(self, rhs: &Radioactivity<T>) -> Self::Output {
3058 Time{s: T::from(self.clone()) / rhs.Bq.clone()}
3059 }
3060}
3061
3062#[cfg(feature="num-bigfloat")]
3065impl<T> core::ops::Div<Radioactivity<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
3066 type Output = Time<T>;
3067 fn div(self, rhs: Radioactivity<T>) -> Self::Output {
3068 Time{s: T::from(self) / rhs.Bq}
3069 }
3070}
3071#[cfg(feature="num-bigfloat")]
3073impl<T> core::ops::Div<Radioactivity<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
3074 type Output = Time<T>;
3075 fn div(self, rhs: Radioactivity<T>) -> Self::Output {
3076 Time{s: T::from(self.clone()) / rhs.Bq}
3077 }
3078}
3079#[cfg(feature="num-bigfloat")]
3081impl<T> core::ops::Div<&Radioactivity<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
3082 type Output = Time<T>;
3083 fn div(self, rhs: &Radioactivity<T>) -> Self::Output {
3084 Time{s: T::from(self) / rhs.Bq.clone()}
3085 }
3086}
3087#[cfg(feature="num-bigfloat")]
3089impl<T> core::ops::Div<&Radioactivity<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
3090 type Output = Time<T>;
3091 fn div(self, rhs: &Radioactivity<T>) -> Self::Output {
3092 Time{s: T::from(self.clone()) / rhs.Bq.clone()}
3093 }
3094}
3095
3096#[cfg(feature="num-complex")]
3099impl<T> core::ops::Div<Radioactivity<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
3100 type Output = Time<T>;
3101 fn div(self, rhs: Radioactivity<T>) -> Self::Output {
3102 Time{s: T::from(self) / rhs.Bq}
3103 }
3104}
3105#[cfg(feature="num-complex")]
3107impl<T> core::ops::Div<Radioactivity<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
3108 type Output = Time<T>;
3109 fn div(self, rhs: Radioactivity<T>) -> Self::Output {
3110 Time{s: T::from(self.clone()) / rhs.Bq}
3111 }
3112}
3113#[cfg(feature="num-complex")]
3115impl<T> core::ops::Div<&Radioactivity<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
3116 type Output = Time<T>;
3117 fn div(self, rhs: &Radioactivity<T>) -> Self::Output {
3118 Time{s: T::from(self) / rhs.Bq.clone()}
3119 }
3120}
3121#[cfg(feature="num-complex")]
3123impl<T> core::ops::Div<&Radioactivity<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
3124 type Output = Time<T>;
3125 fn div(self, rhs: &Radioactivity<T>) -> Self::Output {
3126 Time{s: T::from(self.clone()) / rhs.Bq.clone()}
3127 }
3128}
3129
3130#[cfg(feature="num-complex")]
3133impl<T> core::ops::Div<Radioactivity<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
3134 type Output = Time<T>;
3135 fn div(self, rhs: Radioactivity<T>) -> Self::Output {
3136 Time{s: T::from(self) / rhs.Bq}
3137 }
3138}
3139#[cfg(feature="num-complex")]
3141impl<T> core::ops::Div<Radioactivity<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
3142 type Output = Time<T>;
3143 fn div(self, rhs: Radioactivity<T>) -> Self::Output {
3144 Time{s: T::from(self.clone()) / rhs.Bq}
3145 }
3146}
3147#[cfg(feature="num-complex")]
3149impl<T> core::ops::Div<&Radioactivity<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
3150 type Output = Time<T>;
3151 fn div(self, rhs: &Radioactivity<T>) -> Self::Output {
3152 Time{s: T::from(self) / rhs.Bq.clone()}
3153 }
3154}
3155#[cfg(feature="num-complex")]
3157impl<T> core::ops::Div<&Radioactivity<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
3158 type Output = Time<T>;
3159 fn div(self, rhs: &Radioactivity<T>) -> Self::Output {
3160 Time{s: T::from(self.clone()) / rhs.Bq.clone()}
3161 }
3162}
3163
3164
3165