1
2use core::fmt;
5use super::UnitStruct;
6use super::NumLike;
7use super::base::*;
8use super::chemical::*;
9use super::electromagnetic::*;
10use super::mechanical::*;
11
12#[cfg(feature="serde")]
14use serde::{Serialize, Deserialize};
15#[cfg(feature="num-bigfloat")]
16use num_bigfloat;
17#[cfg(feature="num-complex")]
18use num_complex;
19
20
21
22#[derive(UnitStruct, Debug, Clone)]
24#[cfg_attr(feature="serde", derive(Serialize, Deserialize))]
25pub struct Angle<T: NumLike>{
26 pub rad: T
28}
29
30impl<T> Angle<T> where T: NumLike {
31
32 pub fn unit_name() -> &'static str { "radians" }
34
35 pub fn unit_symbol() -> &'static str { "rad" }
37
38 pub fn from_rad(rad: T) -> Self { Angle{rad: rad} }
43
44 pub fn to_rad(&self) -> T { self.rad.clone() }
46
47 pub fn from_radians(radians: T) -> Self { Angle{rad: radians} }
52
53 pub fn to_radians(&self) -> T { self.rad.clone() }
55
56}
57
58impl<T> fmt::Display for Angle<T> where T: NumLike {
59 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
60 write!(f, "{} {}", &self.rad, Self::unit_symbol())
61 }
62}
63
64impl<T> Angle<T> where T: NumLike+From<f64> {
65
66 pub fn to_degrees(&self) -> T {
70 return self.rad.clone() * T::from(57.2957795130823_f64);
71 }
72
73 pub fn from_degrees(degrees: T) -> Self {
80 Angle{rad: degrees * T::from(0.0174532925199433_f64)}
81 }
82
83 pub fn to_deg(&self) -> T {
87 return self.rad.clone() * T::from(57.2957795130823_f64);
88 }
89
90 pub fn from_deg(deg: T) -> Self {
97 Angle{rad: deg * T::from(0.0174532925199433_f64)}
98 }
99
100}
101
102
103#[cfg(feature="num-bigfloat")]
105impl core::ops::Mul<Angle<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
106 type Output = Angle<num_bigfloat::BigFloat>;
107 fn mul(self, rhs: Angle<num_bigfloat::BigFloat>) -> Self::Output {
108 Angle{rad: self * rhs.rad}
109 }
110}
111#[cfg(feature="num-bigfloat")]
113impl core::ops::Mul<Angle<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
114 type Output = Angle<num_bigfloat::BigFloat>;
115 fn mul(self, rhs: Angle<num_bigfloat::BigFloat>) -> Self::Output {
116 Angle{rad: self.clone() * rhs.rad}
117 }
118}
119#[cfg(feature="num-bigfloat")]
121impl core::ops::Mul<&Angle<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
122 type Output = Angle<num_bigfloat::BigFloat>;
123 fn mul(self, rhs: &Angle<num_bigfloat::BigFloat>) -> Self::Output {
124 Angle{rad: self * rhs.rad.clone()}
125 }
126}
127#[cfg(feature="num-bigfloat")]
129impl core::ops::Mul<&Angle<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
130 type Output = Angle<num_bigfloat::BigFloat>;
131 fn mul(self, rhs: &Angle<num_bigfloat::BigFloat>) -> Self::Output {
132 Angle{rad: self.clone() * rhs.rad.clone()}
133 }
134}
135
136#[cfg(feature="num-complex")]
138impl core::ops::Mul<Angle<num_complex::Complex32>> for num_complex::Complex32 {
139 type Output = Angle<num_complex::Complex32>;
140 fn mul(self, rhs: Angle<num_complex::Complex32>) -> Self::Output {
141 Angle{rad: self * rhs.rad}
142 }
143}
144#[cfg(feature="num-complex")]
146impl core::ops::Mul<Angle<num_complex::Complex32>> for &num_complex::Complex32 {
147 type Output = Angle<num_complex::Complex32>;
148 fn mul(self, rhs: Angle<num_complex::Complex32>) -> Self::Output {
149 Angle{rad: self.clone() * rhs.rad}
150 }
151}
152#[cfg(feature="num-complex")]
154impl core::ops::Mul<&Angle<num_complex::Complex32>> for num_complex::Complex32 {
155 type Output = Angle<num_complex::Complex32>;
156 fn mul(self, rhs: &Angle<num_complex::Complex32>) -> Self::Output {
157 Angle{rad: self * rhs.rad.clone()}
158 }
159}
160#[cfg(feature="num-complex")]
162impl core::ops::Mul<&Angle<num_complex::Complex32>> for &num_complex::Complex32 {
163 type Output = Angle<num_complex::Complex32>;
164 fn mul(self, rhs: &Angle<num_complex::Complex32>) -> Self::Output {
165 Angle{rad: self.clone() * rhs.rad.clone()}
166 }
167}
168
169#[cfg(feature="num-complex")]
171impl core::ops::Mul<Angle<num_complex::Complex64>> for num_complex::Complex64 {
172 type Output = Angle<num_complex::Complex64>;
173 fn mul(self, rhs: Angle<num_complex::Complex64>) -> Self::Output {
174 Angle{rad: self * rhs.rad}
175 }
176}
177#[cfg(feature="num-complex")]
179impl core::ops::Mul<Angle<num_complex::Complex64>> for &num_complex::Complex64 {
180 type Output = Angle<num_complex::Complex64>;
181 fn mul(self, rhs: Angle<num_complex::Complex64>) -> Self::Output {
182 Angle{rad: self.clone() * rhs.rad}
183 }
184}
185#[cfg(feature="num-complex")]
187impl core::ops::Mul<&Angle<num_complex::Complex64>> for num_complex::Complex64 {
188 type Output = Angle<num_complex::Complex64>;
189 fn mul(self, rhs: &Angle<num_complex::Complex64>) -> Self::Output {
190 Angle{rad: self * rhs.rad.clone()}
191 }
192}
193#[cfg(feature="num-complex")]
195impl core::ops::Mul<&Angle<num_complex::Complex64>> for &num_complex::Complex64 {
196 type Output = Angle<num_complex::Complex64>;
197 fn mul(self, rhs: &Angle<num_complex::Complex64>) -> Self::Output {
198 Angle{rad: self.clone() * rhs.rad.clone()}
199 }
200}
201
202
203
204#[cfg(feature = "uom")]
206impl<T> Into<uom::si::f32::Angle> for Angle<T> where T: NumLike+Into<f32> {
207 fn into(self) -> uom::si::f32::Angle {
208 uom::si::f32::Angle::new::<uom::si::angle::radian>(self.rad.into())
209 }
210}
211
212#[cfg(feature = "uom")]
214impl<T> From<uom::si::f32::Angle> for Angle<T> where T: NumLike+From<f32> {
215 fn from(src: uom::si::f32::Angle) -> Self {
216 Angle{rad: T::from(src.value)}
217 }
218}
219
220#[cfg(feature = "uom")]
222impl<T> Into<uom::si::f64::Angle> for Angle<T> where T: NumLike+Into<f64> {
223 fn into(self) -> uom::si::f64::Angle {
224 uom::si::f64::Angle::new::<uom::si::angle::radian>(self.rad.into())
225 }
226}
227
228#[cfg(feature = "uom")]
230impl<T> From<uom::si::f64::Angle> for Angle<T> where T: NumLike+From<f64> {
231 fn from(src: uom::si::f64::Angle) -> Self {
232 Angle{rad: T::from(src.value)}
233 }
234}
235
236
237impl<T> core::ops::Div<Time<T>> for Angle<T> where T: NumLike {
240 type Output = AngularVelocity<T>;
241 fn div(self, rhs: Time<T>) -> Self::Output {
242 AngularVelocity{radps: self.rad / rhs.s}
243 }
244}
245impl<T> core::ops::Div<Time<T>> for &Angle<T> where T: NumLike {
247 type Output = AngularVelocity<T>;
248 fn div(self, rhs: Time<T>) -> Self::Output {
249 AngularVelocity{radps: self.rad.clone() / rhs.s}
250 }
251}
252impl<T> core::ops::Div<&Time<T>> for Angle<T> where T: NumLike {
254 type Output = AngularVelocity<T>;
255 fn div(self, rhs: &Time<T>) -> Self::Output {
256 AngularVelocity{radps: self.rad / rhs.s.clone()}
257 }
258}
259impl<T> core::ops::Div<&Time<T>> for &Angle<T> where T: NumLike {
261 type Output = AngularVelocity<T>;
262 fn div(self, rhs: &Time<T>) -> Self::Output {
263 AngularVelocity{radps: self.rad.clone() / rhs.s.clone()}
264 }
265}
266
267impl<T> core::ops::Mul<Angle<T>> for Angle<T> where T: NumLike {
270 type Output = SolidAngle<T>;
271 fn mul(self, rhs: Angle<T>) -> Self::Output {
272 SolidAngle{sr: self.rad * rhs.rad}
273 }
274}
275impl<T> core::ops::Mul<Angle<T>> for &Angle<T> where T: NumLike {
277 type Output = SolidAngle<T>;
278 fn mul(self, rhs: Angle<T>) -> Self::Output {
279 SolidAngle{sr: self.rad.clone() * rhs.rad}
280 }
281}
282impl<T> core::ops::Mul<&Angle<T>> for Angle<T> where T: NumLike {
284 type Output = SolidAngle<T>;
285 fn mul(self, rhs: &Angle<T>) -> Self::Output {
286 SolidAngle{sr: self.rad * rhs.rad.clone()}
287 }
288}
289impl<T> core::ops::Mul<&Angle<T>> for &Angle<T> where T: NumLike {
291 type Output = SolidAngle<T>;
292 fn mul(self, rhs: &Angle<T>) -> Self::Output {
293 SolidAngle{sr: self.rad.clone() * rhs.rad.clone()}
294 }
295}
296
297impl<T> core::ops::Div<InverseAngle<T>> for Angle<T> where T: NumLike {
300 type Output = SolidAngle<T>;
301 fn div(self, rhs: InverseAngle<T>) -> Self::Output {
302 SolidAngle{sr: self.rad / rhs.per_rad}
303 }
304}
305impl<T> core::ops::Div<InverseAngle<T>> for &Angle<T> where T: NumLike {
307 type Output = SolidAngle<T>;
308 fn div(self, rhs: InverseAngle<T>) -> Self::Output {
309 SolidAngle{sr: self.rad.clone() / rhs.per_rad}
310 }
311}
312impl<T> core::ops::Div<&InverseAngle<T>> for Angle<T> where T: NumLike {
314 type Output = SolidAngle<T>;
315 fn div(self, rhs: &InverseAngle<T>) -> Self::Output {
316 SolidAngle{sr: self.rad / rhs.per_rad.clone()}
317 }
318}
319impl<T> core::ops::Div<&InverseAngle<T>> for &Angle<T> where T: NumLike {
321 type Output = SolidAngle<T>;
322 fn div(self, rhs: &InverseAngle<T>) -> Self::Output {
323 SolidAngle{sr: self.rad.clone() / rhs.per_rad.clone()}
324 }
325}
326
327impl<T> core::ops::Mul<InverseSolidAngle<T>> for Angle<T> where T: NumLike {
330 type Output = InverseAngle<T>;
331 fn mul(self, rhs: InverseSolidAngle<T>) -> Self::Output {
332 InverseAngle{per_rad: self.rad * rhs.per_sr}
333 }
334}
335impl<T> core::ops::Mul<InverseSolidAngle<T>> for &Angle<T> where T: NumLike {
337 type Output = InverseAngle<T>;
338 fn mul(self, rhs: InverseSolidAngle<T>) -> Self::Output {
339 InverseAngle{per_rad: self.rad.clone() * rhs.per_sr}
340 }
341}
342impl<T> core::ops::Mul<&InverseSolidAngle<T>> for Angle<T> where T: NumLike {
344 type Output = InverseAngle<T>;
345 fn mul(self, rhs: &InverseSolidAngle<T>) -> Self::Output {
346 InverseAngle{per_rad: self.rad * rhs.per_sr.clone()}
347 }
348}
349impl<T> core::ops::Mul<&InverseSolidAngle<T>> for &Angle<T> where T: NumLike {
351 type Output = InverseAngle<T>;
352 fn mul(self, rhs: &InverseSolidAngle<T>) -> Self::Output {
353 InverseAngle{per_rad: self.rad.clone() * rhs.per_sr.clone()}
354 }
355}
356
357impl<T> core::ops::Div<SolidAngle<T>> for Angle<T> where T: NumLike {
360 type Output = InverseAngle<T>;
361 fn div(self, rhs: SolidAngle<T>) -> Self::Output {
362 InverseAngle{per_rad: self.rad / rhs.sr}
363 }
364}
365impl<T> core::ops::Div<SolidAngle<T>> for &Angle<T> where T: NumLike {
367 type Output = InverseAngle<T>;
368 fn div(self, rhs: SolidAngle<T>) -> Self::Output {
369 InverseAngle{per_rad: self.rad.clone() / rhs.sr}
370 }
371}
372impl<T> core::ops::Div<&SolidAngle<T>> for Angle<T> where T: NumLike {
374 type Output = InverseAngle<T>;
375 fn div(self, rhs: &SolidAngle<T>) -> Self::Output {
376 InverseAngle{per_rad: self.rad / rhs.sr.clone()}
377 }
378}
379impl<T> core::ops::Div<&SolidAngle<T>> for &Angle<T> where T: NumLike {
381 type Output = InverseAngle<T>;
382 fn div(self, rhs: &SolidAngle<T>) -> Self::Output {
383 InverseAngle{per_rad: self.rad.clone() / rhs.sr.clone()}
384 }
385}
386
387impl<T> core::ops::Div<AngularVelocity<T>> for Angle<T> where T: NumLike {
390 type Output = Time<T>;
391 fn div(self, rhs: AngularVelocity<T>) -> Self::Output {
392 Time{s: self.rad / rhs.radps}
393 }
394}
395impl<T> core::ops::Div<AngularVelocity<T>> for &Angle<T> where T: NumLike {
397 type Output = Time<T>;
398 fn div(self, rhs: AngularVelocity<T>) -> Self::Output {
399 Time{s: self.rad.clone() / rhs.radps}
400 }
401}
402impl<T> core::ops::Div<&AngularVelocity<T>> for Angle<T> where T: NumLike {
404 type Output = Time<T>;
405 fn div(self, rhs: &AngularVelocity<T>) -> Self::Output {
406 Time{s: self.rad / rhs.radps.clone()}
407 }
408}
409impl<T> core::ops::Div<&AngularVelocity<T>> for &Angle<T> where T: NumLike {
411 type Output = Time<T>;
412 fn div(self, rhs: &AngularVelocity<T>) -> Self::Output {
413 Time{s: self.rad.clone() / rhs.radps.clone()}
414 }
415}
416
417impl<T> core::ops::Mul<Frequency<T>> for Angle<T> where T: NumLike {
420 type Output = AngularVelocity<T>;
421 fn mul(self, rhs: Frequency<T>) -> Self::Output {
422 AngularVelocity{radps: self.rad * rhs.Hz}
423 }
424}
425impl<T> core::ops::Mul<Frequency<T>> for &Angle<T> where T: NumLike {
427 type Output = AngularVelocity<T>;
428 fn mul(self, rhs: Frequency<T>) -> Self::Output {
429 AngularVelocity{radps: self.rad.clone() * rhs.Hz}
430 }
431}
432impl<T> core::ops::Mul<&Frequency<T>> for Angle<T> where T: NumLike {
434 type Output = AngularVelocity<T>;
435 fn mul(self, rhs: &Frequency<T>) -> Self::Output {
436 AngularVelocity{radps: self.rad * rhs.Hz.clone()}
437 }
438}
439impl<T> core::ops::Mul<&Frequency<T>> for &Angle<T> where T: NumLike {
441 type Output = AngularVelocity<T>;
442 fn mul(self, rhs: &Frequency<T>) -> Self::Output {
443 AngularVelocity{radps: self.rad.clone() * rhs.Hz.clone()}
444 }
445}
446
447impl<T> core::ops::Mul<InverseAngularVelocity<T>> for Angle<T> where T: NumLike {
450 type Output = Time<T>;
451 fn mul(self, rhs: InverseAngularVelocity<T>) -> Self::Output {
452 Time{s: self.rad * rhs.s_per_rad}
453 }
454}
455impl<T> core::ops::Mul<InverseAngularVelocity<T>> for &Angle<T> where T: NumLike {
457 type Output = Time<T>;
458 fn mul(self, rhs: InverseAngularVelocity<T>) -> Self::Output {
459 Time{s: self.rad.clone() * rhs.s_per_rad}
460 }
461}
462impl<T> core::ops::Mul<&InverseAngularVelocity<T>> for Angle<T> where T: NumLike {
464 type Output = Time<T>;
465 fn mul(self, rhs: &InverseAngularVelocity<T>) -> Self::Output {
466 Time{s: self.rad * rhs.s_per_rad.clone()}
467 }
468}
469impl<T> core::ops::Mul<&InverseAngularVelocity<T>> for &Angle<T> where T: NumLike {
471 type Output = Time<T>;
472 fn mul(self, rhs: &InverseAngularVelocity<T>) -> Self::Output {
473 Time{s: self.rad.clone() * rhs.s_per_rad.clone()}
474 }
475}
476
477impl<T> core::ops::Div<Angle<T>> for f64 where T: NumLike+From<f64> {
480 type Output = InverseAngle<T>;
481 fn div(self, rhs: Angle<T>) -> Self::Output {
482 InverseAngle{per_rad: T::from(self) / rhs.rad}
483 }
484}
485impl<T> core::ops::Div<Angle<T>> for &f64 where T: NumLike+From<f64> {
487 type Output = InverseAngle<T>;
488 fn div(self, rhs: Angle<T>) -> Self::Output {
489 InverseAngle{per_rad: T::from(self.clone()) / rhs.rad}
490 }
491}
492impl<T> core::ops::Div<&Angle<T>> for f64 where T: NumLike+From<f64> {
494 type Output = InverseAngle<T>;
495 fn div(self, rhs: &Angle<T>) -> Self::Output {
496 InverseAngle{per_rad: T::from(self) / rhs.rad.clone()}
497 }
498}
499impl<T> core::ops::Div<&Angle<T>> for &f64 where T: NumLike+From<f64> {
501 type Output = InverseAngle<T>;
502 fn div(self, rhs: &Angle<T>) -> Self::Output {
503 InverseAngle{per_rad: T::from(self.clone()) / rhs.rad.clone()}
504 }
505}
506
507impl<T> core::ops::Div<Angle<T>> for f32 where T: NumLike+From<f32> {
510 type Output = InverseAngle<T>;
511 fn div(self, rhs: Angle<T>) -> Self::Output {
512 InverseAngle{per_rad: T::from(self) / rhs.rad}
513 }
514}
515impl<T> core::ops::Div<Angle<T>> for &f32 where T: NumLike+From<f32> {
517 type Output = InverseAngle<T>;
518 fn div(self, rhs: Angle<T>) -> Self::Output {
519 InverseAngle{per_rad: T::from(self.clone()) / rhs.rad}
520 }
521}
522impl<T> core::ops::Div<&Angle<T>> for f32 where T: NumLike+From<f32> {
524 type Output = InverseAngle<T>;
525 fn div(self, rhs: &Angle<T>) -> Self::Output {
526 InverseAngle{per_rad: T::from(self) / rhs.rad.clone()}
527 }
528}
529impl<T> core::ops::Div<&Angle<T>> for &f32 where T: NumLike+From<f32> {
531 type Output = InverseAngle<T>;
532 fn div(self, rhs: &Angle<T>) -> Self::Output {
533 InverseAngle{per_rad: T::from(self.clone()) / rhs.rad.clone()}
534 }
535}
536
537impl<T> core::ops::Div<Angle<T>> for i64 where T: NumLike+From<i64> {
540 type Output = InverseAngle<T>;
541 fn div(self, rhs: Angle<T>) -> Self::Output {
542 InverseAngle{per_rad: T::from(self) / rhs.rad}
543 }
544}
545impl<T> core::ops::Div<Angle<T>> for &i64 where T: NumLike+From<i64> {
547 type Output = InverseAngle<T>;
548 fn div(self, rhs: Angle<T>) -> Self::Output {
549 InverseAngle{per_rad: T::from(self.clone()) / rhs.rad}
550 }
551}
552impl<T> core::ops::Div<&Angle<T>> for i64 where T: NumLike+From<i64> {
554 type Output = InverseAngle<T>;
555 fn div(self, rhs: &Angle<T>) -> Self::Output {
556 InverseAngle{per_rad: T::from(self) / rhs.rad.clone()}
557 }
558}
559impl<T> core::ops::Div<&Angle<T>> for &i64 where T: NumLike+From<i64> {
561 type Output = InverseAngle<T>;
562 fn div(self, rhs: &Angle<T>) -> Self::Output {
563 InverseAngle{per_rad: T::from(self.clone()) / rhs.rad.clone()}
564 }
565}
566
567impl<T> core::ops::Div<Angle<T>> for i32 where T: NumLike+From<i32> {
570 type Output = InverseAngle<T>;
571 fn div(self, rhs: Angle<T>) -> Self::Output {
572 InverseAngle{per_rad: T::from(self) / rhs.rad}
573 }
574}
575impl<T> core::ops::Div<Angle<T>> for &i32 where T: NumLike+From<i32> {
577 type Output = InverseAngle<T>;
578 fn div(self, rhs: Angle<T>) -> Self::Output {
579 InverseAngle{per_rad: T::from(self.clone()) / rhs.rad}
580 }
581}
582impl<T> core::ops::Div<&Angle<T>> for i32 where T: NumLike+From<i32> {
584 type Output = InverseAngle<T>;
585 fn div(self, rhs: &Angle<T>) -> Self::Output {
586 InverseAngle{per_rad: T::from(self) / rhs.rad.clone()}
587 }
588}
589impl<T> core::ops::Div<&Angle<T>> for &i32 where T: NumLike+From<i32> {
591 type Output = InverseAngle<T>;
592 fn div(self, rhs: &Angle<T>) -> Self::Output {
593 InverseAngle{per_rad: T::from(self.clone()) / rhs.rad.clone()}
594 }
595}
596
597#[cfg(feature="num-bigfloat")]
600impl<T> core::ops::Div<Angle<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
601 type Output = InverseAngle<T>;
602 fn div(self, rhs: Angle<T>) -> Self::Output {
603 InverseAngle{per_rad: T::from(self) / rhs.rad}
604 }
605}
606#[cfg(feature="num-bigfloat")]
608impl<T> core::ops::Div<Angle<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
609 type Output = InverseAngle<T>;
610 fn div(self, rhs: Angle<T>) -> Self::Output {
611 InverseAngle{per_rad: T::from(self.clone()) / rhs.rad}
612 }
613}
614#[cfg(feature="num-bigfloat")]
616impl<T> core::ops::Div<&Angle<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
617 type Output = InverseAngle<T>;
618 fn div(self, rhs: &Angle<T>) -> Self::Output {
619 InverseAngle{per_rad: T::from(self) / rhs.rad.clone()}
620 }
621}
622#[cfg(feature="num-bigfloat")]
624impl<T> core::ops::Div<&Angle<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
625 type Output = InverseAngle<T>;
626 fn div(self, rhs: &Angle<T>) -> Self::Output {
627 InverseAngle{per_rad: T::from(self.clone()) / rhs.rad.clone()}
628 }
629}
630
631#[cfg(feature="num-complex")]
634impl<T> core::ops::Div<Angle<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
635 type Output = InverseAngle<T>;
636 fn div(self, rhs: Angle<T>) -> Self::Output {
637 InverseAngle{per_rad: T::from(self) / rhs.rad}
638 }
639}
640#[cfg(feature="num-complex")]
642impl<T> core::ops::Div<Angle<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
643 type Output = InverseAngle<T>;
644 fn div(self, rhs: Angle<T>) -> Self::Output {
645 InverseAngle{per_rad: T::from(self.clone()) / rhs.rad}
646 }
647}
648#[cfg(feature="num-complex")]
650impl<T> core::ops::Div<&Angle<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
651 type Output = InverseAngle<T>;
652 fn div(self, rhs: &Angle<T>) -> Self::Output {
653 InverseAngle{per_rad: T::from(self) / rhs.rad.clone()}
654 }
655}
656#[cfg(feature="num-complex")]
658impl<T> core::ops::Div<&Angle<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
659 type Output = InverseAngle<T>;
660 fn div(self, rhs: &Angle<T>) -> Self::Output {
661 InverseAngle{per_rad: T::from(self.clone()) / rhs.rad.clone()}
662 }
663}
664
665#[cfg(feature="num-complex")]
668impl<T> core::ops::Div<Angle<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
669 type Output = InverseAngle<T>;
670 fn div(self, rhs: Angle<T>) -> Self::Output {
671 InverseAngle{per_rad: T::from(self) / rhs.rad}
672 }
673}
674#[cfg(feature="num-complex")]
676impl<T> core::ops::Div<Angle<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
677 type Output = InverseAngle<T>;
678 fn div(self, rhs: Angle<T>) -> Self::Output {
679 InverseAngle{per_rad: T::from(self.clone()) / rhs.rad}
680 }
681}
682#[cfg(feature="num-complex")]
684impl<T> core::ops::Div<&Angle<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
685 type Output = InverseAngle<T>;
686 fn div(self, rhs: &Angle<T>) -> Self::Output {
687 InverseAngle{per_rad: T::from(self) / rhs.rad.clone()}
688 }
689}
690#[cfg(feature="num-complex")]
692impl<T> core::ops::Div<&Angle<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
693 type Output = InverseAngle<T>;
694 fn div(self, rhs: &Angle<T>) -> Self::Output {
695 InverseAngle{per_rad: T::from(self.clone()) / rhs.rad.clone()}
696 }
697}
698
699#[derive(UnitStruct, Debug, Clone)]
701#[cfg_attr(feature="serde", derive(Serialize, Deserialize))]
702pub struct Area<T: NumLike>{
703 pub m2: T
705}
706
707impl<T> Area<T> where T: NumLike {
708
709 pub fn unit_name() -> &'static str { "square meters" }
711
712 pub fn unit_symbol() -> &'static str { "m²" }
714
715 pub fn from_m2(m2: T) -> Self { Area{m2: m2} }
720
721 pub fn to_m2(&self) -> T { self.m2.clone() }
723
724 pub fn from_square_meters(square_meters: T) -> Self { Area{m2: square_meters} }
729
730 pub fn to_square_meters(&self) -> T { self.m2.clone() }
732
733}
734
735impl<T> fmt::Display for Area<T> where T: NumLike {
736 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
737 write!(f, "{} {}", &self.m2, Self::unit_symbol())
738 }
739}
740
741impl<T> Area<T> where T: NumLike+From<f64> {
742
743 pub fn to_cm2(&self) -> T {
747 return self.m2.clone() * T::from(10000.0_f64);
748 }
749
750 pub fn from_cm2(cm2: T) -> Self {
757 Area{m2: cm2 * T::from(0.0001_f64)}
758 }
759
760 pub fn to_square_cm(&self) -> T {
764 return self.m2.clone() * T::from(10000.0_f64);
765 }
766
767 pub fn from_square_cm(square_cm: T) -> Self {
774 Area{m2: square_cm * T::from(0.0001_f64)}
775 }
776
777 pub fn to_mm2(&self) -> T {
781 return self.m2.clone() * T::from(1000000.0_f64);
782 }
783
784 pub fn from_mm2(mm2: T) -> Self {
791 Area{m2: mm2 * T::from(1e-06_f64)}
792 }
793
794 pub fn to_um2(&self) -> T {
798 return self.m2.clone() * T::from(1000000000000.0_f64);
799 }
800
801 pub fn from_um2(um2: T) -> Self {
808 Area{m2: um2 * T::from(1e-12_f64)}
809 }
810
811 pub fn to_nm2(&self) -> T {
815 return self.m2.clone() * T::from(1e+18_f64);
816 }
817
818 pub fn from_nm2(nm2: T) -> Self {
825 Area{m2: nm2 * T::from(1e-18_f64)}
826 }
827
828 pub fn to_km2(&self) -> T {
832 return self.m2.clone() * T::from(1e-06_f64);
833 }
834
835 pub fn from_km2(km2: T) -> Self {
842 Area{m2: km2 * T::from(1000000.0_f64)}
843 }
844
845}
846
847
848#[cfg(feature="num-bigfloat")]
850impl core::ops::Mul<Area<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
851 type Output = Area<num_bigfloat::BigFloat>;
852 fn mul(self, rhs: Area<num_bigfloat::BigFloat>) -> Self::Output {
853 Area{m2: self * rhs.m2}
854 }
855}
856#[cfg(feature="num-bigfloat")]
858impl core::ops::Mul<Area<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
859 type Output = Area<num_bigfloat::BigFloat>;
860 fn mul(self, rhs: Area<num_bigfloat::BigFloat>) -> Self::Output {
861 Area{m2: self.clone() * rhs.m2}
862 }
863}
864#[cfg(feature="num-bigfloat")]
866impl core::ops::Mul<&Area<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
867 type Output = Area<num_bigfloat::BigFloat>;
868 fn mul(self, rhs: &Area<num_bigfloat::BigFloat>) -> Self::Output {
869 Area{m2: self * rhs.m2.clone()}
870 }
871}
872#[cfg(feature="num-bigfloat")]
874impl core::ops::Mul<&Area<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
875 type Output = Area<num_bigfloat::BigFloat>;
876 fn mul(self, rhs: &Area<num_bigfloat::BigFloat>) -> Self::Output {
877 Area{m2: self.clone() * rhs.m2.clone()}
878 }
879}
880
881#[cfg(feature="num-complex")]
883impl core::ops::Mul<Area<num_complex::Complex32>> for num_complex::Complex32 {
884 type Output = Area<num_complex::Complex32>;
885 fn mul(self, rhs: Area<num_complex::Complex32>) -> Self::Output {
886 Area{m2: self * rhs.m2}
887 }
888}
889#[cfg(feature="num-complex")]
891impl core::ops::Mul<Area<num_complex::Complex32>> for &num_complex::Complex32 {
892 type Output = Area<num_complex::Complex32>;
893 fn mul(self, rhs: Area<num_complex::Complex32>) -> Self::Output {
894 Area{m2: self.clone() * rhs.m2}
895 }
896}
897#[cfg(feature="num-complex")]
899impl core::ops::Mul<&Area<num_complex::Complex32>> for num_complex::Complex32 {
900 type Output = Area<num_complex::Complex32>;
901 fn mul(self, rhs: &Area<num_complex::Complex32>) -> Self::Output {
902 Area{m2: self * rhs.m2.clone()}
903 }
904}
905#[cfg(feature="num-complex")]
907impl core::ops::Mul<&Area<num_complex::Complex32>> for &num_complex::Complex32 {
908 type Output = Area<num_complex::Complex32>;
909 fn mul(self, rhs: &Area<num_complex::Complex32>) -> Self::Output {
910 Area{m2: self.clone() * rhs.m2.clone()}
911 }
912}
913
914#[cfg(feature="num-complex")]
916impl core::ops::Mul<Area<num_complex::Complex64>> for num_complex::Complex64 {
917 type Output = Area<num_complex::Complex64>;
918 fn mul(self, rhs: Area<num_complex::Complex64>) -> Self::Output {
919 Area{m2: self * rhs.m2}
920 }
921}
922#[cfg(feature="num-complex")]
924impl core::ops::Mul<Area<num_complex::Complex64>> for &num_complex::Complex64 {
925 type Output = Area<num_complex::Complex64>;
926 fn mul(self, rhs: Area<num_complex::Complex64>) -> Self::Output {
927 Area{m2: self.clone() * rhs.m2}
928 }
929}
930#[cfg(feature="num-complex")]
932impl core::ops::Mul<&Area<num_complex::Complex64>> for num_complex::Complex64 {
933 type Output = Area<num_complex::Complex64>;
934 fn mul(self, rhs: &Area<num_complex::Complex64>) -> Self::Output {
935 Area{m2: self * rhs.m2.clone()}
936 }
937}
938#[cfg(feature="num-complex")]
940impl core::ops::Mul<&Area<num_complex::Complex64>> for &num_complex::Complex64 {
941 type Output = Area<num_complex::Complex64>;
942 fn mul(self, rhs: &Area<num_complex::Complex64>) -> Self::Output {
943 Area{m2: self.clone() * rhs.m2.clone()}
944 }
945}
946
947
948
949#[cfg(feature = "uom")]
951impl<T> Into<uom::si::f32::Area> for Area<T> where T: NumLike+Into<f32> {
952 fn into(self) -> uom::si::f32::Area {
953 uom::si::f32::Area::new::<uom::si::area::square_meter>(self.m2.into())
954 }
955}
956
957#[cfg(feature = "uom")]
959impl<T> From<uom::si::f32::Area> for Area<T> where T: NumLike+From<f32> {
960 fn from(src: uom::si::f32::Area) -> Self {
961 Area{m2: T::from(src.value)}
962 }
963}
964
965#[cfg(feature = "uom")]
967impl<T> Into<uom::si::f64::Area> for Area<T> where T: NumLike+Into<f64> {
968 fn into(self) -> uom::si::f64::Area {
969 uom::si::f64::Area::new::<uom::si::area::square_meter>(self.m2.into())
970 }
971}
972
973#[cfg(feature = "uom")]
975impl<T> From<uom::si::f64::Area> for Area<T> where T: NumLike+From<f64> {
976 fn from(src: uom::si::f64::Area) -> Self {
977 Area{m2: T::from(src.value)}
978 }
979}
980
981
982impl<T> core::ops::Mul<Distance<T>> for Area<T> where T: NumLike {
985 type Output = Volume<T>;
986 fn mul(self, rhs: Distance<T>) -> Self::Output {
987 Volume{m3: self.m2 * rhs.m}
988 }
989}
990impl<T> core::ops::Mul<Distance<T>> for &Area<T> where T: NumLike {
992 type Output = Volume<T>;
993 fn mul(self, rhs: Distance<T>) -> Self::Output {
994 Volume{m3: self.m2.clone() * rhs.m}
995 }
996}
997impl<T> core::ops::Mul<&Distance<T>> for Area<T> where T: NumLike {
999 type Output = Volume<T>;
1000 fn mul(self, rhs: &Distance<T>) -> Self::Output {
1001 Volume{m3: self.m2 * rhs.m.clone()}
1002 }
1003}
1004impl<T> core::ops::Mul<&Distance<T>> for &Area<T> where T: NumLike {
1006 type Output = Volume<T>;
1007 fn mul(self, rhs: &Distance<T>) -> Self::Output {
1008 Volume{m3: self.m2.clone() * rhs.m.clone()}
1009 }
1010}
1011
1012impl<T> core::ops::Div<Distance<T>> for Area<T> where T: NumLike {
1015 type Output = Distance<T>;
1016 fn div(self, rhs: Distance<T>) -> Self::Output {
1017 Distance{m: self.m2 / rhs.m}
1018 }
1019}
1020impl<T> core::ops::Div<Distance<T>> for &Area<T> where T: NumLike {
1022 type Output = Distance<T>;
1023 fn div(self, rhs: Distance<T>) -> Self::Output {
1024 Distance{m: self.m2.clone() / rhs.m}
1025 }
1026}
1027impl<T> core::ops::Div<&Distance<T>> for Area<T> where T: NumLike {
1029 type Output = Distance<T>;
1030 fn div(self, rhs: &Distance<T>) -> Self::Output {
1031 Distance{m: self.m2 / rhs.m.clone()}
1032 }
1033}
1034impl<T> core::ops::Div<&Distance<T>> for &Area<T> where T: NumLike {
1036 type Output = Distance<T>;
1037 fn div(self, rhs: &Distance<T>) -> Self::Output {
1038 Distance{m: self.m2.clone() / rhs.m.clone()}
1039 }
1040}
1041
1042impl<T> core::ops::Mul<InverseDistance<T>> for Area<T> where T: NumLike {
1045 type Output = Distance<T>;
1046 fn mul(self, rhs: InverseDistance<T>) -> Self::Output {
1047 Distance{m: self.m2 * rhs.per_m}
1048 }
1049}
1050impl<T> core::ops::Mul<InverseDistance<T>> for &Area<T> where T: NumLike {
1052 type Output = Distance<T>;
1053 fn mul(self, rhs: InverseDistance<T>) -> Self::Output {
1054 Distance{m: self.m2.clone() * rhs.per_m}
1055 }
1056}
1057impl<T> core::ops::Mul<&InverseDistance<T>> for Area<T> where T: NumLike {
1059 type Output = Distance<T>;
1060 fn mul(self, rhs: &InverseDistance<T>) -> Self::Output {
1061 Distance{m: self.m2 * rhs.per_m.clone()}
1062 }
1063}
1064impl<T> core::ops::Mul<&InverseDistance<T>> for &Area<T> where T: NumLike {
1066 type Output = Distance<T>;
1067 fn mul(self, rhs: &InverseDistance<T>) -> Self::Output {
1068 Distance{m: self.m2.clone() * rhs.per_m.clone()}
1069 }
1070}
1071
1072impl<T> core::ops::Div<InverseDistance<T>> for Area<T> where T: NumLike {
1075 type Output = Volume<T>;
1076 fn div(self, rhs: InverseDistance<T>) -> Self::Output {
1077 Volume{m3: self.m2 / rhs.per_m}
1078 }
1079}
1080impl<T> core::ops::Div<InverseDistance<T>> for &Area<T> where T: NumLike {
1082 type Output = Volume<T>;
1083 fn div(self, rhs: InverseDistance<T>) -> Self::Output {
1084 Volume{m3: self.m2.clone() / rhs.per_m}
1085 }
1086}
1087impl<T> core::ops::Div<&InverseDistance<T>> for Area<T> where T: NumLike {
1089 type Output = Volume<T>;
1090 fn div(self, rhs: &InverseDistance<T>) -> Self::Output {
1091 Volume{m3: self.m2 / rhs.per_m.clone()}
1092 }
1093}
1094impl<T> core::ops::Div<&InverseDistance<T>> for &Area<T> where T: NumLike {
1096 type Output = Volume<T>;
1097 fn div(self, rhs: &InverseDistance<T>) -> Self::Output {
1098 Volume{m3: self.m2.clone() / rhs.per_m.clone()}
1099 }
1100}
1101
1102impl<T> core::ops::Mul<InverseMass<T>> for Area<T> where T: NumLike {
1105 type Output = AreaPerMass<T>;
1106 fn mul(self, rhs: InverseMass<T>) -> Self::Output {
1107 AreaPerMass{m2_per_kg: self.m2 * rhs.per_kg}
1108 }
1109}
1110impl<T> core::ops::Mul<InverseMass<T>> for &Area<T> where T: NumLike {
1112 type Output = AreaPerMass<T>;
1113 fn mul(self, rhs: InverseMass<T>) -> Self::Output {
1114 AreaPerMass{m2_per_kg: self.m2.clone() * rhs.per_kg}
1115 }
1116}
1117impl<T> core::ops::Mul<&InverseMass<T>> for Area<T> where T: NumLike {
1119 type Output = AreaPerMass<T>;
1120 fn mul(self, rhs: &InverseMass<T>) -> Self::Output {
1121 AreaPerMass{m2_per_kg: self.m2 * rhs.per_kg.clone()}
1122 }
1123}
1124impl<T> core::ops::Mul<&InverseMass<T>> for &Area<T> where T: NumLike {
1126 type Output = AreaPerMass<T>;
1127 fn mul(self, rhs: &InverseMass<T>) -> Self::Output {
1128 AreaPerMass{m2_per_kg: self.m2.clone() * rhs.per_kg.clone()}
1129 }
1130}
1131
1132impl<T> core::ops::Div<Mass<T>> for Area<T> where T: NumLike {
1135 type Output = AreaPerMass<T>;
1136 fn div(self, rhs: Mass<T>) -> Self::Output {
1137 AreaPerMass{m2_per_kg: self.m2 / rhs.kg}
1138 }
1139}
1140impl<T> core::ops::Div<Mass<T>> for &Area<T> where T: NumLike {
1142 type Output = AreaPerMass<T>;
1143 fn div(self, rhs: Mass<T>) -> Self::Output {
1144 AreaPerMass{m2_per_kg: self.m2.clone() / rhs.kg}
1145 }
1146}
1147impl<T> core::ops::Div<&Mass<T>> for Area<T> where T: NumLike {
1149 type Output = AreaPerMass<T>;
1150 fn div(self, rhs: &Mass<T>) -> Self::Output {
1151 AreaPerMass{m2_per_kg: self.m2 / rhs.kg.clone()}
1152 }
1153}
1154impl<T> core::ops::Div<&Mass<T>> for &Area<T> where T: NumLike {
1156 type Output = AreaPerMass<T>;
1157 fn div(self, rhs: &Mass<T>) -> Self::Output {
1158 AreaPerMass{m2_per_kg: self.m2.clone() / rhs.kg.clone()}
1159 }
1160}
1161
1162impl<T> core::ops::Div<AreaPerLumen<T>> for Area<T> where T: NumLike {
1165 type Output = LuminousFlux<T>;
1166 fn div(self, rhs: AreaPerLumen<T>) -> Self::Output {
1167 LuminousFlux{lm: self.m2 / rhs.m2_per_lm}
1168 }
1169}
1170impl<T> core::ops::Div<AreaPerLumen<T>> for &Area<T> where T: NumLike {
1172 type Output = LuminousFlux<T>;
1173 fn div(self, rhs: AreaPerLumen<T>) -> Self::Output {
1174 LuminousFlux{lm: self.m2.clone() / rhs.m2_per_lm}
1175 }
1176}
1177impl<T> core::ops::Div<&AreaPerLumen<T>> for Area<T> where T: NumLike {
1179 type Output = LuminousFlux<T>;
1180 fn div(self, rhs: &AreaPerLumen<T>) -> Self::Output {
1181 LuminousFlux{lm: self.m2 / rhs.m2_per_lm.clone()}
1182 }
1183}
1184impl<T> core::ops::Div<&AreaPerLumen<T>> for &Area<T> where T: NumLike {
1186 type Output = LuminousFlux<T>;
1187 fn div(self, rhs: &AreaPerLumen<T>) -> Self::Output {
1188 LuminousFlux{lm: self.m2.clone() / rhs.m2_per_lm.clone()}
1189 }
1190}
1191
1192impl<T> core::ops::Mul<Illuminance<T>> for Area<T> where T: NumLike {
1195 type Output = LuminousFlux<T>;
1196 fn mul(self, rhs: Illuminance<T>) -> Self::Output {
1197 LuminousFlux{lm: self.m2 * rhs.lux}
1198 }
1199}
1200impl<T> core::ops::Mul<Illuminance<T>> for &Area<T> where T: NumLike {
1202 type Output = LuminousFlux<T>;
1203 fn mul(self, rhs: Illuminance<T>) -> Self::Output {
1204 LuminousFlux{lm: self.m2.clone() * rhs.lux}
1205 }
1206}
1207impl<T> core::ops::Mul<&Illuminance<T>> for Area<T> where T: NumLike {
1209 type Output = LuminousFlux<T>;
1210 fn mul(self, rhs: &Illuminance<T>) -> Self::Output {
1211 LuminousFlux{lm: self.m2 * rhs.lux.clone()}
1212 }
1213}
1214impl<T> core::ops::Mul<&Illuminance<T>> for &Area<T> where T: NumLike {
1216 type Output = LuminousFlux<T>;
1217 fn mul(self, rhs: &Illuminance<T>) -> Self::Output {
1218 LuminousFlux{lm: self.m2.clone() * rhs.lux.clone()}
1219 }
1220}
1221
1222impl<T> core::ops::Mul<InverseLuminousFlux<T>> for Area<T> where T: NumLike {
1225 type Output = AreaPerLumen<T>;
1226 fn mul(self, rhs: InverseLuminousFlux<T>) -> Self::Output {
1227 AreaPerLumen{m2_per_lm: self.m2 * rhs.per_lm}
1228 }
1229}
1230impl<T> core::ops::Mul<InverseLuminousFlux<T>> for &Area<T> where T: NumLike {
1232 type Output = AreaPerLumen<T>;
1233 fn mul(self, rhs: InverseLuminousFlux<T>) -> Self::Output {
1234 AreaPerLumen{m2_per_lm: self.m2.clone() * rhs.per_lm}
1235 }
1236}
1237impl<T> core::ops::Mul<&InverseLuminousFlux<T>> for Area<T> where T: NumLike {
1239 type Output = AreaPerLumen<T>;
1240 fn mul(self, rhs: &InverseLuminousFlux<T>) -> Self::Output {
1241 AreaPerLumen{m2_per_lm: self.m2 * rhs.per_lm.clone()}
1242 }
1243}
1244impl<T> core::ops::Mul<&InverseLuminousFlux<T>> for &Area<T> where T: NumLike {
1246 type Output = AreaPerLumen<T>;
1247 fn mul(self, rhs: &InverseLuminousFlux<T>) -> Self::Output {
1248 AreaPerLumen{m2_per_lm: self.m2.clone() * rhs.per_lm.clone()}
1249 }
1250}
1251
1252impl<T> core::ops::Mul<InverseMagneticFlux<T>> for Area<T> where T: NumLike {
1255 type Output = InverseMagneticFluxDensity<T>;
1256 fn mul(self, rhs: InverseMagneticFlux<T>) -> Self::Output {
1257 InverseMagneticFluxDensity{m2_per_Wb: self.m2 * rhs.per_Wb}
1258 }
1259}
1260impl<T> core::ops::Mul<InverseMagneticFlux<T>> for &Area<T> where T: NumLike {
1262 type Output = InverseMagneticFluxDensity<T>;
1263 fn mul(self, rhs: InverseMagneticFlux<T>) -> Self::Output {
1264 InverseMagneticFluxDensity{m2_per_Wb: self.m2.clone() * rhs.per_Wb}
1265 }
1266}
1267impl<T> core::ops::Mul<&InverseMagneticFlux<T>> for Area<T> where T: NumLike {
1269 type Output = InverseMagneticFluxDensity<T>;
1270 fn mul(self, rhs: &InverseMagneticFlux<T>) -> Self::Output {
1271 InverseMagneticFluxDensity{m2_per_Wb: self.m2 * rhs.per_Wb.clone()}
1272 }
1273}
1274impl<T> core::ops::Mul<&InverseMagneticFlux<T>> for &Area<T> where T: NumLike {
1276 type Output = InverseMagneticFluxDensity<T>;
1277 fn mul(self, rhs: &InverseMagneticFlux<T>) -> Self::Output {
1278 InverseMagneticFluxDensity{m2_per_Wb: self.m2.clone() * rhs.per_Wb.clone()}
1279 }
1280}
1281
1282impl<T> core::ops::Div<InverseMagneticFluxDensity<T>> for Area<T> where T: NumLike {
1285 type Output = MagneticFlux<T>;
1286 fn div(self, rhs: InverseMagneticFluxDensity<T>) -> Self::Output {
1287 MagneticFlux{Wb: self.m2 / rhs.m2_per_Wb}
1288 }
1289}
1290impl<T> core::ops::Div<InverseMagneticFluxDensity<T>> for &Area<T> where T: NumLike {
1292 type Output = MagneticFlux<T>;
1293 fn div(self, rhs: InverseMagneticFluxDensity<T>) -> Self::Output {
1294 MagneticFlux{Wb: self.m2.clone() / rhs.m2_per_Wb}
1295 }
1296}
1297impl<T> core::ops::Div<&InverseMagneticFluxDensity<T>> for Area<T> where T: NumLike {
1299 type Output = MagneticFlux<T>;
1300 fn div(self, rhs: &InverseMagneticFluxDensity<T>) -> Self::Output {
1301 MagneticFlux{Wb: self.m2 / rhs.m2_per_Wb.clone()}
1302 }
1303}
1304impl<T> core::ops::Div<&InverseMagneticFluxDensity<T>> for &Area<T> where T: NumLike {
1306 type Output = MagneticFlux<T>;
1307 fn div(self, rhs: &InverseMagneticFluxDensity<T>) -> Self::Output {
1308 MagneticFlux{Wb: self.m2.clone() / rhs.m2_per_Wb.clone()}
1309 }
1310}
1311
1312impl<T> core::ops::Div<LuminousFlux<T>> for Area<T> where T: NumLike {
1315 type Output = AreaPerLumen<T>;
1316 fn div(self, rhs: LuminousFlux<T>) -> Self::Output {
1317 AreaPerLumen{m2_per_lm: self.m2 / rhs.lm}
1318 }
1319}
1320impl<T> core::ops::Div<LuminousFlux<T>> for &Area<T> where T: NumLike {
1322 type Output = AreaPerLumen<T>;
1323 fn div(self, rhs: LuminousFlux<T>) -> Self::Output {
1324 AreaPerLumen{m2_per_lm: self.m2.clone() / rhs.lm}
1325 }
1326}
1327impl<T> core::ops::Div<&LuminousFlux<T>> for Area<T> where T: NumLike {
1329 type Output = AreaPerLumen<T>;
1330 fn div(self, rhs: &LuminousFlux<T>) -> Self::Output {
1331 AreaPerLumen{m2_per_lm: self.m2 / rhs.lm.clone()}
1332 }
1333}
1334impl<T> core::ops::Div<&LuminousFlux<T>> for &Area<T> where T: NumLike {
1336 type Output = AreaPerLumen<T>;
1337 fn div(self, rhs: &LuminousFlux<T>) -> Self::Output {
1338 AreaPerLumen{m2_per_lm: self.m2.clone() / rhs.lm.clone()}
1339 }
1340}
1341
1342impl<T> core::ops::Div<MagneticFlux<T>> for Area<T> where T: NumLike {
1345 type Output = InverseMagneticFluxDensity<T>;
1346 fn div(self, rhs: MagneticFlux<T>) -> Self::Output {
1347 InverseMagneticFluxDensity{m2_per_Wb: self.m2 / rhs.Wb}
1348 }
1349}
1350impl<T> core::ops::Div<MagneticFlux<T>> for &Area<T> where T: NumLike {
1352 type Output = InverseMagneticFluxDensity<T>;
1353 fn div(self, rhs: MagneticFlux<T>) -> Self::Output {
1354 InverseMagneticFluxDensity{m2_per_Wb: self.m2.clone() / rhs.Wb}
1355 }
1356}
1357impl<T> core::ops::Div<&MagneticFlux<T>> for Area<T> where T: NumLike {
1359 type Output = InverseMagneticFluxDensity<T>;
1360 fn div(self, rhs: &MagneticFlux<T>) -> Self::Output {
1361 InverseMagneticFluxDensity{m2_per_Wb: self.m2 / rhs.Wb.clone()}
1362 }
1363}
1364impl<T> core::ops::Div<&MagneticFlux<T>> for &Area<T> where T: NumLike {
1366 type Output = InverseMagneticFluxDensity<T>;
1367 fn div(self, rhs: &MagneticFlux<T>) -> Self::Output {
1368 InverseMagneticFluxDensity{m2_per_Wb: self.m2.clone() / rhs.Wb.clone()}
1369 }
1370}
1371
1372impl<T> core::ops::Mul<MagneticFluxDensity<T>> for Area<T> where T: NumLike {
1375 type Output = MagneticFlux<T>;
1376 fn mul(self, rhs: MagneticFluxDensity<T>) -> Self::Output {
1377 MagneticFlux{Wb: self.m2 * rhs.T}
1378 }
1379}
1380impl<T> core::ops::Mul<MagneticFluxDensity<T>> for &Area<T> where T: NumLike {
1382 type Output = MagneticFlux<T>;
1383 fn mul(self, rhs: MagneticFluxDensity<T>) -> Self::Output {
1384 MagneticFlux{Wb: self.m2.clone() * rhs.T}
1385 }
1386}
1387impl<T> core::ops::Mul<&MagneticFluxDensity<T>> for Area<T> where T: NumLike {
1389 type Output = MagneticFlux<T>;
1390 fn mul(self, rhs: &MagneticFluxDensity<T>) -> Self::Output {
1391 MagneticFlux{Wb: self.m2 * rhs.T.clone()}
1392 }
1393}
1394impl<T> core::ops::Mul<&MagneticFluxDensity<T>> for &Area<T> where T: NumLike {
1396 type Output = MagneticFlux<T>;
1397 fn mul(self, rhs: &MagneticFluxDensity<T>) -> Self::Output {
1398 MagneticFlux{Wb: self.m2.clone() * rhs.T.clone()}
1399 }
1400}
1401
1402impl<T> core::ops::Mul<InverseVolume<T>> for Area<T> where T: NumLike {
1405 type Output = InverseDistance<T>;
1406 fn mul(self, rhs: InverseVolume<T>) -> Self::Output {
1407 InverseDistance{per_m: self.m2 * rhs.per_m3}
1408 }
1409}
1410impl<T> core::ops::Mul<InverseVolume<T>> for &Area<T> where T: NumLike {
1412 type Output = InverseDistance<T>;
1413 fn mul(self, rhs: InverseVolume<T>) -> Self::Output {
1414 InverseDistance{per_m: self.m2.clone() * rhs.per_m3}
1415 }
1416}
1417impl<T> core::ops::Mul<&InverseVolume<T>> for Area<T> where T: NumLike {
1419 type Output = InverseDistance<T>;
1420 fn mul(self, rhs: &InverseVolume<T>) -> Self::Output {
1421 InverseDistance{per_m: self.m2 * rhs.per_m3.clone()}
1422 }
1423}
1424impl<T> core::ops::Mul<&InverseVolume<T>> for &Area<T> where T: NumLike {
1426 type Output = InverseDistance<T>;
1427 fn mul(self, rhs: &InverseVolume<T>) -> Self::Output {
1428 InverseDistance{per_m: self.m2.clone() * rhs.per_m3.clone()}
1429 }
1430}
1431
1432impl<T> core::ops::Div<Volume<T>> for Area<T> where T: NumLike {
1435 type Output = InverseDistance<T>;
1436 fn div(self, rhs: Volume<T>) -> Self::Output {
1437 InverseDistance{per_m: self.m2 / rhs.m3}
1438 }
1439}
1440impl<T> core::ops::Div<Volume<T>> for &Area<T> where T: NumLike {
1442 type Output = InverseDistance<T>;
1443 fn div(self, rhs: Volume<T>) -> Self::Output {
1444 InverseDistance{per_m: self.m2.clone() / rhs.m3}
1445 }
1446}
1447impl<T> core::ops::Div<&Volume<T>> for Area<T> where T: NumLike {
1449 type Output = InverseDistance<T>;
1450 fn div(self, rhs: &Volume<T>) -> Self::Output {
1451 InverseDistance{per_m: self.m2 / rhs.m3.clone()}
1452 }
1453}
1454impl<T> core::ops::Div<&Volume<T>> for &Area<T> where T: NumLike {
1456 type Output = InverseDistance<T>;
1457 fn div(self, rhs: &Volume<T>) -> Self::Output {
1458 InverseDistance{per_m: self.m2.clone() / rhs.m3.clone()}
1459 }
1460}
1461
1462impl<T> core::ops::Mul<AreaDensity<T>> for Area<T> where T: NumLike {
1465 type Output = Mass<T>;
1466 fn mul(self, rhs: AreaDensity<T>) -> Self::Output {
1467 Mass{kg: self.m2 * rhs.kgpm2}
1468 }
1469}
1470impl<T> core::ops::Mul<AreaDensity<T>> for &Area<T> where T: NumLike {
1472 type Output = Mass<T>;
1473 fn mul(self, rhs: AreaDensity<T>) -> Self::Output {
1474 Mass{kg: self.m2.clone() * rhs.kgpm2}
1475 }
1476}
1477impl<T> core::ops::Mul<&AreaDensity<T>> for Area<T> where T: NumLike {
1479 type Output = Mass<T>;
1480 fn mul(self, rhs: &AreaDensity<T>) -> Self::Output {
1481 Mass{kg: self.m2 * rhs.kgpm2.clone()}
1482 }
1483}
1484impl<T> core::ops::Mul<&AreaDensity<T>> for &Area<T> where T: NumLike {
1486 type Output = Mass<T>;
1487 fn mul(self, rhs: &AreaDensity<T>) -> Self::Output {
1488 Mass{kg: self.m2.clone() * rhs.kgpm2.clone()}
1489 }
1490}
1491
1492impl<T> core::ops::Div<AreaPerMass<T>> for Area<T> where T: NumLike {
1495 type Output = Mass<T>;
1496 fn div(self, rhs: AreaPerMass<T>) -> Self::Output {
1497 Mass{kg: self.m2 / rhs.m2_per_kg}
1498 }
1499}
1500impl<T> core::ops::Div<AreaPerMass<T>> for &Area<T> where T: NumLike {
1502 type Output = Mass<T>;
1503 fn div(self, rhs: AreaPerMass<T>) -> Self::Output {
1504 Mass{kg: self.m2.clone() / rhs.m2_per_kg}
1505 }
1506}
1507impl<T> core::ops::Div<&AreaPerMass<T>> for Area<T> where T: NumLike {
1509 type Output = Mass<T>;
1510 fn div(self, rhs: &AreaPerMass<T>) -> Self::Output {
1511 Mass{kg: self.m2 / rhs.m2_per_kg.clone()}
1512 }
1513}
1514impl<T> core::ops::Div<&AreaPerMass<T>> for &Area<T> where T: NumLike {
1516 type Output = Mass<T>;
1517 fn div(self, rhs: &AreaPerMass<T>) -> Self::Output {
1518 Mass{kg: self.m2.clone() / rhs.m2_per_kg.clone()}
1519 }
1520}
1521
1522impl<T> core::ops::Div<Force<T>> for Area<T> where T: NumLike {
1525 type Output = InversePressure<T>;
1526 fn div(self, rhs: Force<T>) -> Self::Output {
1527 InversePressure{per_Pa: self.m2 / rhs.N}
1528 }
1529}
1530impl<T> core::ops::Div<Force<T>> for &Area<T> where T: NumLike {
1532 type Output = InversePressure<T>;
1533 fn div(self, rhs: Force<T>) -> Self::Output {
1534 InversePressure{per_Pa: self.m2.clone() / rhs.N}
1535 }
1536}
1537impl<T> core::ops::Div<&Force<T>> for Area<T> where T: NumLike {
1539 type Output = InversePressure<T>;
1540 fn div(self, rhs: &Force<T>) -> Self::Output {
1541 InversePressure{per_Pa: self.m2 / rhs.N.clone()}
1542 }
1543}
1544impl<T> core::ops::Div<&Force<T>> for &Area<T> where T: NumLike {
1546 type Output = InversePressure<T>;
1547 fn div(self, rhs: &Force<T>) -> Self::Output {
1548 InversePressure{per_Pa: self.m2.clone() / rhs.N.clone()}
1549 }
1550}
1551
1552impl<T> core::ops::Mul<InverseForce<T>> for Area<T> where T: NumLike {
1555 type Output = InversePressure<T>;
1556 fn mul(self, rhs: InverseForce<T>) -> Self::Output {
1557 InversePressure{per_Pa: self.m2 * rhs.per_N}
1558 }
1559}
1560impl<T> core::ops::Mul<InverseForce<T>> for &Area<T> where T: NumLike {
1562 type Output = InversePressure<T>;
1563 fn mul(self, rhs: InverseForce<T>) -> Self::Output {
1564 InversePressure{per_Pa: self.m2.clone() * rhs.per_N}
1565 }
1566}
1567impl<T> core::ops::Mul<&InverseForce<T>> for Area<T> where T: NumLike {
1569 type Output = InversePressure<T>;
1570 fn mul(self, rhs: &InverseForce<T>) -> Self::Output {
1571 InversePressure{per_Pa: self.m2 * rhs.per_N.clone()}
1572 }
1573}
1574impl<T> core::ops::Mul<&InverseForce<T>> for &Area<T> where T: NumLike {
1576 type Output = InversePressure<T>;
1577 fn mul(self, rhs: &InverseForce<T>) -> Self::Output {
1578 InversePressure{per_Pa: self.m2.clone() * rhs.per_N.clone()}
1579 }
1580}
1581
1582impl<T> core::ops::Mul<InverseMomentOfInertia<T>> for Area<T> where T: NumLike {
1585 type Output = InverseMass<T>;
1586 fn mul(self, rhs: InverseMomentOfInertia<T>) -> Self::Output {
1587 InverseMass{per_kg: self.m2 * rhs.per_kgm2}
1588 }
1589}
1590impl<T> core::ops::Mul<InverseMomentOfInertia<T>> for &Area<T> where T: NumLike {
1592 type Output = InverseMass<T>;
1593 fn mul(self, rhs: InverseMomentOfInertia<T>) -> Self::Output {
1594 InverseMass{per_kg: self.m2.clone() * rhs.per_kgm2}
1595 }
1596}
1597impl<T> core::ops::Mul<&InverseMomentOfInertia<T>> for Area<T> where T: NumLike {
1599 type Output = InverseMass<T>;
1600 fn mul(self, rhs: &InverseMomentOfInertia<T>) -> Self::Output {
1601 InverseMass{per_kg: self.m2 * rhs.per_kgm2.clone()}
1602 }
1603}
1604impl<T> core::ops::Mul<&InverseMomentOfInertia<T>> for &Area<T> where T: NumLike {
1606 type Output = InverseMass<T>;
1607 fn mul(self, rhs: &InverseMomentOfInertia<T>) -> Self::Output {
1608 InverseMass{per_kg: self.m2.clone() * rhs.per_kgm2.clone()}
1609 }
1610}
1611
1612impl<T> core::ops::Div<InversePressure<T>> for Area<T> where T: NumLike {
1615 type Output = Force<T>;
1616 fn div(self, rhs: InversePressure<T>) -> Self::Output {
1617 Force{N: self.m2 / rhs.per_Pa}
1618 }
1619}
1620impl<T> core::ops::Div<InversePressure<T>> for &Area<T> where T: NumLike {
1622 type Output = Force<T>;
1623 fn div(self, rhs: InversePressure<T>) -> Self::Output {
1624 Force{N: self.m2.clone() / rhs.per_Pa}
1625 }
1626}
1627impl<T> core::ops::Div<&InversePressure<T>> for Area<T> where T: NumLike {
1629 type Output = Force<T>;
1630 fn div(self, rhs: &InversePressure<T>) -> Self::Output {
1631 Force{N: self.m2 / rhs.per_Pa.clone()}
1632 }
1633}
1634impl<T> core::ops::Div<&InversePressure<T>> for &Area<T> where T: NumLike {
1636 type Output = Force<T>;
1637 fn div(self, rhs: &InversePressure<T>) -> Self::Output {
1638 Force{N: self.m2.clone() / rhs.per_Pa.clone()}
1639 }
1640}
1641
1642impl<T> core::ops::Div<MomentOfInertia<T>> for Area<T> where T: NumLike {
1645 type Output = InverseMass<T>;
1646 fn div(self, rhs: MomentOfInertia<T>) -> Self::Output {
1647 InverseMass{per_kg: self.m2 / rhs.kgm2}
1648 }
1649}
1650impl<T> core::ops::Div<MomentOfInertia<T>> for &Area<T> where T: NumLike {
1652 type Output = InverseMass<T>;
1653 fn div(self, rhs: MomentOfInertia<T>) -> Self::Output {
1654 InverseMass{per_kg: self.m2.clone() / rhs.kgm2}
1655 }
1656}
1657impl<T> core::ops::Div<&MomentOfInertia<T>> for Area<T> where T: NumLike {
1659 type Output = InverseMass<T>;
1660 fn div(self, rhs: &MomentOfInertia<T>) -> Self::Output {
1661 InverseMass{per_kg: self.m2 / rhs.kgm2.clone()}
1662 }
1663}
1664impl<T> core::ops::Div<&MomentOfInertia<T>> for &Area<T> where T: NumLike {
1666 type Output = InverseMass<T>;
1667 fn div(self, rhs: &MomentOfInertia<T>) -> Self::Output {
1668 InverseMass{per_kg: self.m2.clone() / rhs.kgm2.clone()}
1669 }
1670}
1671
1672impl<T> core::ops::Mul<Pressure<T>> for Area<T> where T: NumLike {
1675 type Output = Force<T>;
1676 fn mul(self, rhs: Pressure<T>) -> Self::Output {
1677 Force{N: self.m2 * rhs.Pa}
1678 }
1679}
1680impl<T> core::ops::Mul<Pressure<T>> for &Area<T> where T: NumLike {
1682 type Output = Force<T>;
1683 fn mul(self, rhs: Pressure<T>) -> Self::Output {
1684 Force{N: self.m2.clone() * rhs.Pa}
1685 }
1686}
1687impl<T> core::ops::Mul<&Pressure<T>> for Area<T> where T: NumLike {
1689 type Output = Force<T>;
1690 fn mul(self, rhs: &Pressure<T>) -> Self::Output {
1691 Force{N: self.m2 * rhs.Pa.clone()}
1692 }
1693}
1694impl<T> core::ops::Mul<&Pressure<T>> for &Area<T> where T: NumLike {
1696 type Output = Force<T>;
1697 fn mul(self, rhs: &Pressure<T>) -> Self::Output {
1698 Force{N: self.m2.clone() * rhs.Pa.clone()}
1699 }
1700}
1701
1702impl<T> core::ops::Div<Area<T>> for f64 where T: NumLike+From<f64> {
1705 type Output = InverseArea<T>;
1706 fn div(self, rhs: Area<T>) -> Self::Output {
1707 InverseArea{per_m2: T::from(self) / rhs.m2}
1708 }
1709}
1710impl<T> core::ops::Div<Area<T>> for &f64 where T: NumLike+From<f64> {
1712 type Output = InverseArea<T>;
1713 fn div(self, rhs: Area<T>) -> Self::Output {
1714 InverseArea{per_m2: T::from(self.clone()) / rhs.m2}
1715 }
1716}
1717impl<T> core::ops::Div<&Area<T>> for f64 where T: NumLike+From<f64> {
1719 type Output = InverseArea<T>;
1720 fn div(self, rhs: &Area<T>) -> Self::Output {
1721 InverseArea{per_m2: T::from(self) / rhs.m2.clone()}
1722 }
1723}
1724impl<T> core::ops::Div<&Area<T>> for &f64 where T: NumLike+From<f64> {
1726 type Output = InverseArea<T>;
1727 fn div(self, rhs: &Area<T>) -> Self::Output {
1728 InverseArea{per_m2: T::from(self.clone()) / rhs.m2.clone()}
1729 }
1730}
1731
1732impl<T> core::ops::Div<Area<T>> for f32 where T: NumLike+From<f32> {
1735 type Output = InverseArea<T>;
1736 fn div(self, rhs: Area<T>) -> Self::Output {
1737 InverseArea{per_m2: T::from(self) / rhs.m2}
1738 }
1739}
1740impl<T> core::ops::Div<Area<T>> for &f32 where T: NumLike+From<f32> {
1742 type Output = InverseArea<T>;
1743 fn div(self, rhs: Area<T>) -> Self::Output {
1744 InverseArea{per_m2: T::from(self.clone()) / rhs.m2}
1745 }
1746}
1747impl<T> core::ops::Div<&Area<T>> for f32 where T: NumLike+From<f32> {
1749 type Output = InverseArea<T>;
1750 fn div(self, rhs: &Area<T>) -> Self::Output {
1751 InverseArea{per_m2: T::from(self) / rhs.m2.clone()}
1752 }
1753}
1754impl<T> core::ops::Div<&Area<T>> for &f32 where T: NumLike+From<f32> {
1756 type Output = InverseArea<T>;
1757 fn div(self, rhs: &Area<T>) -> Self::Output {
1758 InverseArea{per_m2: T::from(self.clone()) / rhs.m2.clone()}
1759 }
1760}
1761
1762impl<T> core::ops::Div<Area<T>> for i64 where T: NumLike+From<i64> {
1765 type Output = InverseArea<T>;
1766 fn div(self, rhs: Area<T>) -> Self::Output {
1767 InverseArea{per_m2: T::from(self) / rhs.m2}
1768 }
1769}
1770impl<T> core::ops::Div<Area<T>> for &i64 where T: NumLike+From<i64> {
1772 type Output = InverseArea<T>;
1773 fn div(self, rhs: Area<T>) -> Self::Output {
1774 InverseArea{per_m2: T::from(self.clone()) / rhs.m2}
1775 }
1776}
1777impl<T> core::ops::Div<&Area<T>> for i64 where T: NumLike+From<i64> {
1779 type Output = InverseArea<T>;
1780 fn div(self, rhs: &Area<T>) -> Self::Output {
1781 InverseArea{per_m2: T::from(self) / rhs.m2.clone()}
1782 }
1783}
1784impl<T> core::ops::Div<&Area<T>> for &i64 where T: NumLike+From<i64> {
1786 type Output = InverseArea<T>;
1787 fn div(self, rhs: &Area<T>) -> Self::Output {
1788 InverseArea{per_m2: T::from(self.clone()) / rhs.m2.clone()}
1789 }
1790}
1791
1792impl<T> core::ops::Div<Area<T>> for i32 where T: NumLike+From<i32> {
1795 type Output = InverseArea<T>;
1796 fn div(self, rhs: Area<T>) -> Self::Output {
1797 InverseArea{per_m2: T::from(self) / rhs.m2}
1798 }
1799}
1800impl<T> core::ops::Div<Area<T>> for &i32 where T: NumLike+From<i32> {
1802 type Output = InverseArea<T>;
1803 fn div(self, rhs: Area<T>) -> Self::Output {
1804 InverseArea{per_m2: T::from(self.clone()) / rhs.m2}
1805 }
1806}
1807impl<T> core::ops::Div<&Area<T>> for i32 where T: NumLike+From<i32> {
1809 type Output = InverseArea<T>;
1810 fn div(self, rhs: &Area<T>) -> Self::Output {
1811 InverseArea{per_m2: T::from(self) / rhs.m2.clone()}
1812 }
1813}
1814impl<T> core::ops::Div<&Area<T>> for &i32 where T: NumLike+From<i32> {
1816 type Output = InverseArea<T>;
1817 fn div(self, rhs: &Area<T>) -> Self::Output {
1818 InverseArea{per_m2: T::from(self.clone()) / rhs.m2.clone()}
1819 }
1820}
1821
1822#[cfg(feature="num-bigfloat")]
1825impl<T> core::ops::Div<Area<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
1826 type Output = InverseArea<T>;
1827 fn div(self, rhs: Area<T>) -> Self::Output {
1828 InverseArea{per_m2: T::from(self) / rhs.m2}
1829 }
1830}
1831#[cfg(feature="num-bigfloat")]
1833impl<T> core::ops::Div<Area<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
1834 type Output = InverseArea<T>;
1835 fn div(self, rhs: Area<T>) -> Self::Output {
1836 InverseArea{per_m2: T::from(self.clone()) / rhs.m2}
1837 }
1838}
1839#[cfg(feature="num-bigfloat")]
1841impl<T> core::ops::Div<&Area<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
1842 type Output = InverseArea<T>;
1843 fn div(self, rhs: &Area<T>) -> Self::Output {
1844 InverseArea{per_m2: T::from(self) / rhs.m2.clone()}
1845 }
1846}
1847#[cfg(feature="num-bigfloat")]
1849impl<T> core::ops::Div<&Area<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
1850 type Output = InverseArea<T>;
1851 fn div(self, rhs: &Area<T>) -> Self::Output {
1852 InverseArea{per_m2: T::from(self.clone()) / rhs.m2.clone()}
1853 }
1854}
1855
1856#[cfg(feature="num-complex")]
1859impl<T> core::ops::Div<Area<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
1860 type Output = InverseArea<T>;
1861 fn div(self, rhs: Area<T>) -> Self::Output {
1862 InverseArea{per_m2: T::from(self) / rhs.m2}
1863 }
1864}
1865#[cfg(feature="num-complex")]
1867impl<T> core::ops::Div<Area<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
1868 type Output = InverseArea<T>;
1869 fn div(self, rhs: Area<T>) -> Self::Output {
1870 InverseArea{per_m2: T::from(self.clone()) / rhs.m2}
1871 }
1872}
1873#[cfg(feature="num-complex")]
1875impl<T> core::ops::Div<&Area<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
1876 type Output = InverseArea<T>;
1877 fn div(self, rhs: &Area<T>) -> Self::Output {
1878 InverseArea{per_m2: T::from(self) / rhs.m2.clone()}
1879 }
1880}
1881#[cfg(feature="num-complex")]
1883impl<T> core::ops::Div<&Area<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
1884 type Output = InverseArea<T>;
1885 fn div(self, rhs: &Area<T>) -> Self::Output {
1886 InverseArea{per_m2: T::from(self.clone()) / rhs.m2.clone()}
1887 }
1888}
1889
1890#[cfg(feature="num-complex")]
1893impl<T> core::ops::Div<Area<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
1894 type Output = InverseArea<T>;
1895 fn div(self, rhs: Area<T>) -> Self::Output {
1896 InverseArea{per_m2: T::from(self) / rhs.m2}
1897 }
1898}
1899#[cfg(feature="num-complex")]
1901impl<T> core::ops::Div<Area<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
1902 type Output = InverseArea<T>;
1903 fn div(self, rhs: Area<T>) -> Self::Output {
1904 InverseArea{per_m2: T::from(self.clone()) / rhs.m2}
1905 }
1906}
1907#[cfg(feature="num-complex")]
1909impl<T> core::ops::Div<&Area<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
1910 type Output = InverseArea<T>;
1911 fn div(self, rhs: &Area<T>) -> Self::Output {
1912 InverseArea{per_m2: T::from(self) / rhs.m2.clone()}
1913 }
1914}
1915#[cfg(feature="num-complex")]
1917impl<T> core::ops::Div<&Area<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
1918 type Output = InverseArea<T>;
1919 fn div(self, rhs: &Area<T>) -> Self::Output {
1920 InverseArea{per_m2: T::from(self.clone()) / rhs.m2.clone()}
1921 }
1922}
1923
1924#[derive(UnitStruct, Debug, Clone)]
1926#[cfg_attr(feature="serde", derive(Serialize, Deserialize))]
1927pub struct InverseAngle<T: NumLike>{
1928 pub per_rad: T
1930}
1931
1932impl<T> InverseAngle<T> where T: NumLike {
1933
1934 pub fn unit_name() -> &'static str { "inverse radians" }
1936
1937 pub fn unit_symbol() -> &'static str { "1/rad" }
1939
1940 pub fn from_per_rad(per_rad: T) -> Self { InverseAngle{per_rad: per_rad} }
1945
1946 pub fn to_per_rad(&self) -> T { self.per_rad.clone() }
1948
1949 pub fn from_per_radians(per_radians: T) -> Self { InverseAngle{per_rad: per_radians} }
1954
1955 pub fn to_per_radians(&self) -> T { self.per_rad.clone() }
1957
1958}
1959
1960impl<T> fmt::Display for InverseAngle<T> where T: NumLike {
1961 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1962 write!(f, "{} {}", &self.per_rad, Self::unit_symbol())
1963 }
1964}
1965
1966impl<T> InverseAngle<T> where T: NumLike+From<f64> {
1967
1968 pub fn to_per_degrees(&self) -> T {
1972 return self.per_rad.clone() * T::from(0.0174532925199433_f64);
1973 }
1974
1975 pub fn from_per_degrees(per_degrees: T) -> Self {
1982 InverseAngle{per_rad: per_degrees * T::from(57.2957795130823_f64)}
1983 }
1984
1985 pub fn to_per_deg(&self) -> T {
1989 return self.per_rad.clone() * T::from(0.0174532925199433_f64);
1990 }
1991
1992 pub fn from_per_deg(per_deg: T) -> Self {
1999 InverseAngle{per_rad: per_deg * T::from(57.2957795130823_f64)}
2000 }
2001
2002}
2003
2004
2005#[cfg(feature="num-bigfloat")]
2007impl core::ops::Mul<InverseAngle<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
2008 type Output = InverseAngle<num_bigfloat::BigFloat>;
2009 fn mul(self, rhs: InverseAngle<num_bigfloat::BigFloat>) -> Self::Output {
2010 InverseAngle{per_rad: self * rhs.per_rad}
2011 }
2012}
2013#[cfg(feature="num-bigfloat")]
2015impl core::ops::Mul<InverseAngle<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
2016 type Output = InverseAngle<num_bigfloat::BigFloat>;
2017 fn mul(self, rhs: InverseAngle<num_bigfloat::BigFloat>) -> Self::Output {
2018 InverseAngle{per_rad: self.clone() * rhs.per_rad}
2019 }
2020}
2021#[cfg(feature="num-bigfloat")]
2023impl core::ops::Mul<&InverseAngle<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
2024 type Output = InverseAngle<num_bigfloat::BigFloat>;
2025 fn mul(self, rhs: &InverseAngle<num_bigfloat::BigFloat>) -> Self::Output {
2026 InverseAngle{per_rad: self * rhs.per_rad.clone()}
2027 }
2028}
2029#[cfg(feature="num-bigfloat")]
2031impl core::ops::Mul<&InverseAngle<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
2032 type Output = InverseAngle<num_bigfloat::BigFloat>;
2033 fn mul(self, rhs: &InverseAngle<num_bigfloat::BigFloat>) -> Self::Output {
2034 InverseAngle{per_rad: self.clone() * rhs.per_rad.clone()}
2035 }
2036}
2037
2038#[cfg(feature="num-complex")]
2040impl core::ops::Mul<InverseAngle<num_complex::Complex32>> for num_complex::Complex32 {
2041 type Output = InverseAngle<num_complex::Complex32>;
2042 fn mul(self, rhs: InverseAngle<num_complex::Complex32>) -> Self::Output {
2043 InverseAngle{per_rad: self * rhs.per_rad}
2044 }
2045}
2046#[cfg(feature="num-complex")]
2048impl core::ops::Mul<InverseAngle<num_complex::Complex32>> for &num_complex::Complex32 {
2049 type Output = InverseAngle<num_complex::Complex32>;
2050 fn mul(self, rhs: InverseAngle<num_complex::Complex32>) -> Self::Output {
2051 InverseAngle{per_rad: self.clone() * rhs.per_rad}
2052 }
2053}
2054#[cfg(feature="num-complex")]
2056impl core::ops::Mul<&InverseAngle<num_complex::Complex32>> for num_complex::Complex32 {
2057 type Output = InverseAngle<num_complex::Complex32>;
2058 fn mul(self, rhs: &InverseAngle<num_complex::Complex32>) -> Self::Output {
2059 InverseAngle{per_rad: self * rhs.per_rad.clone()}
2060 }
2061}
2062#[cfg(feature="num-complex")]
2064impl core::ops::Mul<&InverseAngle<num_complex::Complex32>> for &num_complex::Complex32 {
2065 type Output = InverseAngle<num_complex::Complex32>;
2066 fn mul(self, rhs: &InverseAngle<num_complex::Complex32>) -> Self::Output {
2067 InverseAngle{per_rad: self.clone() * rhs.per_rad.clone()}
2068 }
2069}
2070
2071#[cfg(feature="num-complex")]
2073impl core::ops::Mul<InverseAngle<num_complex::Complex64>> for num_complex::Complex64 {
2074 type Output = InverseAngle<num_complex::Complex64>;
2075 fn mul(self, rhs: InverseAngle<num_complex::Complex64>) -> Self::Output {
2076 InverseAngle{per_rad: self * rhs.per_rad}
2077 }
2078}
2079#[cfg(feature="num-complex")]
2081impl core::ops::Mul<InverseAngle<num_complex::Complex64>> for &num_complex::Complex64 {
2082 type Output = InverseAngle<num_complex::Complex64>;
2083 fn mul(self, rhs: InverseAngle<num_complex::Complex64>) -> Self::Output {
2084 InverseAngle{per_rad: self.clone() * rhs.per_rad}
2085 }
2086}
2087#[cfg(feature="num-complex")]
2089impl core::ops::Mul<&InverseAngle<num_complex::Complex64>> for num_complex::Complex64 {
2090 type Output = InverseAngle<num_complex::Complex64>;
2091 fn mul(self, rhs: &InverseAngle<num_complex::Complex64>) -> Self::Output {
2092 InverseAngle{per_rad: self * rhs.per_rad.clone()}
2093 }
2094}
2095#[cfg(feature="num-complex")]
2097impl core::ops::Mul<&InverseAngle<num_complex::Complex64>> for &num_complex::Complex64 {
2098 type Output = InverseAngle<num_complex::Complex64>;
2099 fn mul(self, rhs: &InverseAngle<num_complex::Complex64>) -> Self::Output {
2100 InverseAngle{per_rad: self.clone() * rhs.per_rad.clone()}
2101 }
2102}
2103
2104
2105
2106
2107impl<T> core::ops::Mul<Time<T>> for InverseAngle<T> where T: NumLike {
2110 type Output = InverseAngularVelocity<T>;
2111 fn mul(self, rhs: Time<T>) -> Self::Output {
2112 InverseAngularVelocity{s_per_rad: self.per_rad * rhs.s}
2113 }
2114}
2115impl<T> core::ops::Mul<Time<T>> for &InverseAngle<T> where T: NumLike {
2117 type Output = InverseAngularVelocity<T>;
2118 fn mul(self, rhs: Time<T>) -> Self::Output {
2119 InverseAngularVelocity{s_per_rad: self.per_rad.clone() * rhs.s}
2120 }
2121}
2122impl<T> core::ops::Mul<&Time<T>> for InverseAngle<T> where T: NumLike {
2124 type Output = InverseAngularVelocity<T>;
2125 fn mul(self, rhs: &Time<T>) -> Self::Output {
2126 InverseAngularVelocity{s_per_rad: self.per_rad * rhs.s.clone()}
2127 }
2128}
2129impl<T> core::ops::Mul<&Time<T>> for &InverseAngle<T> where T: NumLike {
2131 type Output = InverseAngularVelocity<T>;
2132 fn mul(self, rhs: &Time<T>) -> Self::Output {
2133 InverseAngularVelocity{s_per_rad: self.per_rad.clone() * rhs.s.clone()}
2134 }
2135}
2136
2137impl<T> core::ops::Div<Angle<T>> for InverseAngle<T> where T: NumLike {
2140 type Output = InverseSolidAngle<T>;
2141 fn div(self, rhs: Angle<T>) -> Self::Output {
2142 InverseSolidAngle{per_sr: self.per_rad / rhs.rad}
2143 }
2144}
2145impl<T> core::ops::Div<Angle<T>> for &InverseAngle<T> where T: NumLike {
2147 type Output = InverseSolidAngle<T>;
2148 fn div(self, rhs: Angle<T>) -> Self::Output {
2149 InverseSolidAngle{per_sr: self.per_rad.clone() / rhs.rad}
2150 }
2151}
2152impl<T> core::ops::Div<&Angle<T>> for InverseAngle<T> where T: NumLike {
2154 type Output = InverseSolidAngle<T>;
2155 fn div(self, rhs: &Angle<T>) -> Self::Output {
2156 InverseSolidAngle{per_sr: self.per_rad / rhs.rad.clone()}
2157 }
2158}
2159impl<T> core::ops::Div<&Angle<T>> for &InverseAngle<T> where T: NumLike {
2161 type Output = InverseSolidAngle<T>;
2162 fn div(self, rhs: &Angle<T>) -> Self::Output {
2163 InverseSolidAngle{per_sr: self.per_rad.clone() / rhs.rad.clone()}
2164 }
2165}
2166
2167impl<T> core::ops::Mul<InverseAngle<T>> for InverseAngle<T> where T: NumLike {
2170 type Output = InverseSolidAngle<T>;
2171 fn mul(self, rhs: InverseAngle<T>) -> Self::Output {
2172 InverseSolidAngle{per_sr: self.per_rad * rhs.per_rad}
2173 }
2174}
2175impl<T> core::ops::Mul<InverseAngle<T>> for &InverseAngle<T> where T: NumLike {
2177 type Output = InverseSolidAngle<T>;
2178 fn mul(self, rhs: InverseAngle<T>) -> Self::Output {
2179 InverseSolidAngle{per_sr: self.per_rad.clone() * rhs.per_rad}
2180 }
2181}
2182impl<T> core::ops::Mul<&InverseAngle<T>> for InverseAngle<T> where T: NumLike {
2184 type Output = InverseSolidAngle<T>;
2185 fn mul(self, rhs: &InverseAngle<T>) -> Self::Output {
2186 InverseSolidAngle{per_sr: self.per_rad * rhs.per_rad.clone()}
2187 }
2188}
2189impl<T> core::ops::Mul<&InverseAngle<T>> for &InverseAngle<T> where T: NumLike {
2191 type Output = InverseSolidAngle<T>;
2192 fn mul(self, rhs: &InverseAngle<T>) -> Self::Output {
2193 InverseSolidAngle{per_sr: self.per_rad.clone() * rhs.per_rad.clone()}
2194 }
2195}
2196
2197impl<T> core::ops::Div<InverseSolidAngle<T>> for InverseAngle<T> where T: NumLike {
2200 type Output = Angle<T>;
2201 fn div(self, rhs: InverseSolidAngle<T>) -> Self::Output {
2202 Angle{rad: self.per_rad / rhs.per_sr}
2203 }
2204}
2205impl<T> core::ops::Div<InverseSolidAngle<T>> for &InverseAngle<T> where T: NumLike {
2207 type Output = Angle<T>;
2208 fn div(self, rhs: InverseSolidAngle<T>) -> Self::Output {
2209 Angle{rad: self.per_rad.clone() / rhs.per_sr}
2210 }
2211}
2212impl<T> core::ops::Div<&InverseSolidAngle<T>> for InverseAngle<T> where T: NumLike {
2214 type Output = Angle<T>;
2215 fn div(self, rhs: &InverseSolidAngle<T>) -> Self::Output {
2216 Angle{rad: self.per_rad / rhs.per_sr.clone()}
2217 }
2218}
2219impl<T> core::ops::Div<&InverseSolidAngle<T>> for &InverseAngle<T> where T: NumLike {
2221 type Output = Angle<T>;
2222 fn div(self, rhs: &InverseSolidAngle<T>) -> Self::Output {
2223 Angle{rad: self.per_rad.clone() / rhs.per_sr.clone()}
2224 }
2225}
2226
2227impl<T> core::ops::Mul<SolidAngle<T>> for InverseAngle<T> where T: NumLike {
2230 type Output = Angle<T>;
2231 fn mul(self, rhs: SolidAngle<T>) -> Self::Output {
2232 Angle{rad: self.per_rad * rhs.sr}
2233 }
2234}
2235impl<T> core::ops::Mul<SolidAngle<T>> for &InverseAngle<T> where T: NumLike {
2237 type Output = Angle<T>;
2238 fn mul(self, rhs: SolidAngle<T>) -> Self::Output {
2239 Angle{rad: self.per_rad.clone() * rhs.sr}
2240 }
2241}
2242impl<T> core::ops::Mul<&SolidAngle<T>> for InverseAngle<T> where T: NumLike {
2244 type Output = Angle<T>;
2245 fn mul(self, rhs: &SolidAngle<T>) -> Self::Output {
2246 Angle{rad: self.per_rad * rhs.sr.clone()}
2247 }
2248}
2249impl<T> core::ops::Mul<&SolidAngle<T>> for &InverseAngle<T> where T: NumLike {
2251 type Output = Angle<T>;
2252 fn mul(self, rhs: &SolidAngle<T>) -> Self::Output {
2253 Angle{rad: self.per_rad.clone() * rhs.sr.clone()}
2254 }
2255}
2256
2257impl<T> core::ops::Mul<AngularVelocity<T>> for InverseAngle<T> where T: NumLike {
2260 type Output = Frequency<T>;
2261 fn mul(self, rhs: AngularVelocity<T>) -> Self::Output {
2262 Frequency{Hz: self.per_rad * rhs.radps}
2263 }
2264}
2265impl<T> core::ops::Mul<AngularVelocity<T>> for &InverseAngle<T> where T: NumLike {
2267 type Output = Frequency<T>;
2268 fn mul(self, rhs: AngularVelocity<T>) -> Self::Output {
2269 Frequency{Hz: self.per_rad.clone() * rhs.radps}
2270 }
2271}
2272impl<T> core::ops::Mul<&AngularVelocity<T>> for InverseAngle<T> where T: NumLike {
2274 type Output = Frequency<T>;
2275 fn mul(self, rhs: &AngularVelocity<T>) -> Self::Output {
2276 Frequency{Hz: self.per_rad * rhs.radps.clone()}
2277 }
2278}
2279impl<T> core::ops::Mul<&AngularVelocity<T>> for &InverseAngle<T> where T: NumLike {
2281 type Output = Frequency<T>;
2282 fn mul(self, rhs: &AngularVelocity<T>) -> Self::Output {
2283 Frequency{Hz: self.per_rad.clone() * rhs.radps.clone()}
2284 }
2285}
2286
2287impl<T> core::ops::Div<Frequency<T>> for InverseAngle<T> where T: NumLike {
2290 type Output = InverseAngularVelocity<T>;
2291 fn div(self, rhs: Frequency<T>) -> Self::Output {
2292 InverseAngularVelocity{s_per_rad: self.per_rad / rhs.Hz}
2293 }
2294}
2295impl<T> core::ops::Div<Frequency<T>> for &InverseAngle<T> where T: NumLike {
2297 type Output = InverseAngularVelocity<T>;
2298 fn div(self, rhs: Frequency<T>) -> Self::Output {
2299 InverseAngularVelocity{s_per_rad: self.per_rad.clone() / rhs.Hz}
2300 }
2301}
2302impl<T> core::ops::Div<&Frequency<T>> for InverseAngle<T> where T: NumLike {
2304 type Output = InverseAngularVelocity<T>;
2305 fn div(self, rhs: &Frequency<T>) -> Self::Output {
2306 InverseAngularVelocity{s_per_rad: self.per_rad / rhs.Hz.clone()}
2307 }
2308}
2309impl<T> core::ops::Div<&Frequency<T>> for &InverseAngle<T> where T: NumLike {
2311 type Output = InverseAngularVelocity<T>;
2312 fn div(self, rhs: &Frequency<T>) -> Self::Output {
2313 InverseAngularVelocity{s_per_rad: self.per_rad.clone() / rhs.Hz.clone()}
2314 }
2315}
2316
2317impl<T> core::ops::Div<InverseAngularVelocity<T>> for InverseAngle<T> where T: NumLike {
2320 type Output = Frequency<T>;
2321 fn div(self, rhs: InverseAngularVelocity<T>) -> Self::Output {
2322 Frequency{Hz: self.per_rad / rhs.s_per_rad}
2323 }
2324}
2325impl<T> core::ops::Div<InverseAngularVelocity<T>> for &InverseAngle<T> where T: NumLike {
2327 type Output = Frequency<T>;
2328 fn div(self, rhs: InverseAngularVelocity<T>) -> Self::Output {
2329 Frequency{Hz: self.per_rad.clone() / rhs.s_per_rad}
2330 }
2331}
2332impl<T> core::ops::Div<&InverseAngularVelocity<T>> for InverseAngle<T> where T: NumLike {
2334 type Output = Frequency<T>;
2335 fn div(self, rhs: &InverseAngularVelocity<T>) -> Self::Output {
2336 Frequency{Hz: self.per_rad / rhs.s_per_rad.clone()}
2337 }
2338}
2339impl<T> core::ops::Div<&InverseAngularVelocity<T>> for &InverseAngle<T> where T: NumLike {
2341 type Output = Frequency<T>;
2342 fn div(self, rhs: &InverseAngularVelocity<T>) -> Self::Output {
2343 Frequency{Hz: self.per_rad.clone() / rhs.s_per_rad.clone()}
2344 }
2345}
2346
2347impl<T> core::ops::Div<InverseAngle<T>> for f64 where T: NumLike+From<f64> {
2350 type Output = Angle<T>;
2351 fn div(self, rhs: InverseAngle<T>) -> Self::Output {
2352 Angle{rad: T::from(self) / rhs.per_rad}
2353 }
2354}
2355impl<T> core::ops::Div<InverseAngle<T>> for &f64 where T: NumLike+From<f64> {
2357 type Output = Angle<T>;
2358 fn div(self, rhs: InverseAngle<T>) -> Self::Output {
2359 Angle{rad: T::from(self.clone()) / rhs.per_rad}
2360 }
2361}
2362impl<T> core::ops::Div<&InverseAngle<T>> for f64 where T: NumLike+From<f64> {
2364 type Output = Angle<T>;
2365 fn div(self, rhs: &InverseAngle<T>) -> Self::Output {
2366 Angle{rad: T::from(self) / rhs.per_rad.clone()}
2367 }
2368}
2369impl<T> core::ops::Div<&InverseAngle<T>> for &f64 where T: NumLike+From<f64> {
2371 type Output = Angle<T>;
2372 fn div(self, rhs: &InverseAngle<T>) -> Self::Output {
2373 Angle{rad: T::from(self.clone()) / rhs.per_rad.clone()}
2374 }
2375}
2376
2377impl<T> core::ops::Div<InverseAngle<T>> for f32 where T: NumLike+From<f32> {
2380 type Output = Angle<T>;
2381 fn div(self, rhs: InverseAngle<T>) -> Self::Output {
2382 Angle{rad: T::from(self) / rhs.per_rad}
2383 }
2384}
2385impl<T> core::ops::Div<InverseAngle<T>> for &f32 where T: NumLike+From<f32> {
2387 type Output = Angle<T>;
2388 fn div(self, rhs: InverseAngle<T>) -> Self::Output {
2389 Angle{rad: T::from(self.clone()) / rhs.per_rad}
2390 }
2391}
2392impl<T> core::ops::Div<&InverseAngle<T>> for f32 where T: NumLike+From<f32> {
2394 type Output = Angle<T>;
2395 fn div(self, rhs: &InverseAngle<T>) -> Self::Output {
2396 Angle{rad: T::from(self) / rhs.per_rad.clone()}
2397 }
2398}
2399impl<T> core::ops::Div<&InverseAngle<T>> for &f32 where T: NumLike+From<f32> {
2401 type Output = Angle<T>;
2402 fn div(self, rhs: &InverseAngle<T>) -> Self::Output {
2403 Angle{rad: T::from(self.clone()) / rhs.per_rad.clone()}
2404 }
2405}
2406
2407impl<T> core::ops::Div<InverseAngle<T>> for i64 where T: NumLike+From<i64> {
2410 type Output = Angle<T>;
2411 fn div(self, rhs: InverseAngle<T>) -> Self::Output {
2412 Angle{rad: T::from(self) / rhs.per_rad}
2413 }
2414}
2415impl<T> core::ops::Div<InverseAngle<T>> for &i64 where T: NumLike+From<i64> {
2417 type Output = Angle<T>;
2418 fn div(self, rhs: InverseAngle<T>) -> Self::Output {
2419 Angle{rad: T::from(self.clone()) / rhs.per_rad}
2420 }
2421}
2422impl<T> core::ops::Div<&InverseAngle<T>> for i64 where T: NumLike+From<i64> {
2424 type Output = Angle<T>;
2425 fn div(self, rhs: &InverseAngle<T>) -> Self::Output {
2426 Angle{rad: T::from(self) / rhs.per_rad.clone()}
2427 }
2428}
2429impl<T> core::ops::Div<&InverseAngle<T>> for &i64 where T: NumLike+From<i64> {
2431 type Output = Angle<T>;
2432 fn div(self, rhs: &InverseAngle<T>) -> Self::Output {
2433 Angle{rad: T::from(self.clone()) / rhs.per_rad.clone()}
2434 }
2435}
2436
2437impl<T> core::ops::Div<InverseAngle<T>> for i32 where T: NumLike+From<i32> {
2440 type Output = Angle<T>;
2441 fn div(self, rhs: InverseAngle<T>) -> Self::Output {
2442 Angle{rad: T::from(self) / rhs.per_rad}
2443 }
2444}
2445impl<T> core::ops::Div<InverseAngle<T>> for &i32 where T: NumLike+From<i32> {
2447 type Output = Angle<T>;
2448 fn div(self, rhs: InverseAngle<T>) -> Self::Output {
2449 Angle{rad: T::from(self.clone()) / rhs.per_rad}
2450 }
2451}
2452impl<T> core::ops::Div<&InverseAngle<T>> for i32 where T: NumLike+From<i32> {
2454 type Output = Angle<T>;
2455 fn div(self, rhs: &InverseAngle<T>) -> Self::Output {
2456 Angle{rad: T::from(self) / rhs.per_rad.clone()}
2457 }
2458}
2459impl<T> core::ops::Div<&InverseAngle<T>> for &i32 where T: NumLike+From<i32> {
2461 type Output = Angle<T>;
2462 fn div(self, rhs: &InverseAngle<T>) -> Self::Output {
2463 Angle{rad: T::from(self.clone()) / rhs.per_rad.clone()}
2464 }
2465}
2466
2467#[cfg(feature="num-bigfloat")]
2470impl<T> core::ops::Div<InverseAngle<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
2471 type Output = Angle<T>;
2472 fn div(self, rhs: InverseAngle<T>) -> Self::Output {
2473 Angle{rad: T::from(self) / rhs.per_rad}
2474 }
2475}
2476#[cfg(feature="num-bigfloat")]
2478impl<T> core::ops::Div<InverseAngle<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
2479 type Output = Angle<T>;
2480 fn div(self, rhs: InverseAngle<T>) -> Self::Output {
2481 Angle{rad: T::from(self.clone()) / rhs.per_rad}
2482 }
2483}
2484#[cfg(feature="num-bigfloat")]
2486impl<T> core::ops::Div<&InverseAngle<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
2487 type Output = Angle<T>;
2488 fn div(self, rhs: &InverseAngle<T>) -> Self::Output {
2489 Angle{rad: T::from(self) / rhs.per_rad.clone()}
2490 }
2491}
2492#[cfg(feature="num-bigfloat")]
2494impl<T> core::ops::Div<&InverseAngle<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
2495 type Output = Angle<T>;
2496 fn div(self, rhs: &InverseAngle<T>) -> Self::Output {
2497 Angle{rad: T::from(self.clone()) / rhs.per_rad.clone()}
2498 }
2499}
2500
2501#[cfg(feature="num-complex")]
2504impl<T> core::ops::Div<InverseAngle<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
2505 type Output = Angle<T>;
2506 fn div(self, rhs: InverseAngle<T>) -> Self::Output {
2507 Angle{rad: T::from(self) / rhs.per_rad}
2508 }
2509}
2510#[cfg(feature="num-complex")]
2512impl<T> core::ops::Div<InverseAngle<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
2513 type Output = Angle<T>;
2514 fn div(self, rhs: InverseAngle<T>) -> Self::Output {
2515 Angle{rad: T::from(self.clone()) / rhs.per_rad}
2516 }
2517}
2518#[cfg(feature="num-complex")]
2520impl<T> core::ops::Div<&InverseAngle<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
2521 type Output = Angle<T>;
2522 fn div(self, rhs: &InverseAngle<T>) -> Self::Output {
2523 Angle{rad: T::from(self) / rhs.per_rad.clone()}
2524 }
2525}
2526#[cfg(feature="num-complex")]
2528impl<T> core::ops::Div<&InverseAngle<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
2529 type Output = Angle<T>;
2530 fn div(self, rhs: &InverseAngle<T>) -> Self::Output {
2531 Angle{rad: T::from(self.clone()) / rhs.per_rad.clone()}
2532 }
2533}
2534
2535#[cfg(feature="num-complex")]
2538impl<T> core::ops::Div<InverseAngle<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
2539 type Output = Angle<T>;
2540 fn div(self, rhs: InverseAngle<T>) -> Self::Output {
2541 Angle{rad: T::from(self) / rhs.per_rad}
2542 }
2543}
2544#[cfg(feature="num-complex")]
2546impl<T> core::ops::Div<InverseAngle<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
2547 type Output = Angle<T>;
2548 fn div(self, rhs: InverseAngle<T>) -> Self::Output {
2549 Angle{rad: T::from(self.clone()) / rhs.per_rad}
2550 }
2551}
2552#[cfg(feature="num-complex")]
2554impl<T> core::ops::Div<&InverseAngle<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
2555 type Output = Angle<T>;
2556 fn div(self, rhs: &InverseAngle<T>) -> Self::Output {
2557 Angle{rad: T::from(self) / rhs.per_rad.clone()}
2558 }
2559}
2560#[cfg(feature="num-complex")]
2562impl<T> core::ops::Div<&InverseAngle<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
2563 type Output = Angle<T>;
2564 fn div(self, rhs: &InverseAngle<T>) -> Self::Output {
2565 Angle{rad: T::from(self.clone()) / rhs.per_rad.clone()}
2566 }
2567}
2568
2569#[derive(UnitStruct, Debug, Clone)]
2571#[cfg_attr(feature="serde", derive(Serialize, Deserialize))]
2572pub struct InverseArea<T: NumLike>{
2573 pub per_m2: T
2575}
2576
2577impl<T> InverseArea<T> where T: NumLike {
2578
2579 pub fn unit_name() -> &'static str { "inverse square meters" }
2581
2582 pub fn unit_symbol() -> &'static str { "1/m²" }
2584
2585 pub fn from_per_m2(per_m2: T) -> Self { InverseArea{per_m2: per_m2} }
2590
2591 pub fn to_per_m2(&self) -> T { self.per_m2.clone() }
2593
2594 pub fn from_per_square_meter(per_square_meter: T) -> Self { InverseArea{per_m2: per_square_meter} }
2599
2600 pub fn to_per_square_meter(&self) -> T { self.per_m2.clone() }
2602
2603}
2604
2605impl<T> fmt::Display for InverseArea<T> where T: NumLike {
2606 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2607 write!(f, "{} {}", &self.per_m2, Self::unit_symbol())
2608 }
2609}
2610
2611impl<T> InverseArea<T> where T: NumLike+From<f64> {
2612
2613 pub fn to_per_cm2(&self) -> T {
2617 return self.per_m2.clone() * T::from(0.0001_f64);
2618 }
2619
2620 pub fn from_per_cm2(per_cm2: T) -> Self {
2627 InverseArea{per_m2: per_cm2 * T::from(10000.0_f64)}
2628 }
2629
2630 pub fn to_per_square_cm(&self) -> T {
2634 return self.per_m2.clone() * T::from(0.0001_f64);
2635 }
2636
2637 pub fn from_per_square_cm(per_square_cm: T) -> Self {
2644 InverseArea{per_m2: per_square_cm * T::from(10000.0_f64)}
2645 }
2646
2647 pub fn to_per_mm2(&self) -> T {
2651 return self.per_m2.clone() * T::from(1e-06_f64);
2652 }
2653
2654 pub fn from_per_mm2(per_mm2: T) -> Self {
2661 InverseArea{per_m2: per_mm2 * T::from(1000000.0_f64)}
2662 }
2663
2664 pub fn to_per_um2(&self) -> T {
2668 return self.per_m2.clone() * T::from(1e-12_f64);
2669 }
2670
2671 pub fn from_per_um2(per_um2: T) -> Self {
2678 InverseArea{per_m2: per_um2 * T::from(1000000000000.0_f64)}
2679 }
2680
2681 pub fn to_per_nm2(&self) -> T {
2685 return self.per_m2.clone() * T::from(1e-18_f64);
2686 }
2687
2688 pub fn from_per_nm2(per_nm2: T) -> Self {
2695 InverseArea{per_m2: per_nm2 * T::from(1e+18_f64)}
2696 }
2697
2698 pub fn to_per_km2(&self) -> T {
2702 return self.per_m2.clone() * T::from(1000000.0_f64);
2703 }
2704
2705 pub fn from_per_km2(per_km2: T) -> Self {
2712 InverseArea{per_m2: per_km2 * T::from(1e-06_f64)}
2713 }
2714
2715}
2716
2717
2718#[cfg(feature="num-bigfloat")]
2720impl core::ops::Mul<InverseArea<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
2721 type Output = InverseArea<num_bigfloat::BigFloat>;
2722 fn mul(self, rhs: InverseArea<num_bigfloat::BigFloat>) -> Self::Output {
2723 InverseArea{per_m2: self * rhs.per_m2}
2724 }
2725}
2726#[cfg(feature="num-bigfloat")]
2728impl core::ops::Mul<InverseArea<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
2729 type Output = InverseArea<num_bigfloat::BigFloat>;
2730 fn mul(self, rhs: InverseArea<num_bigfloat::BigFloat>) -> Self::Output {
2731 InverseArea{per_m2: self.clone() * rhs.per_m2}
2732 }
2733}
2734#[cfg(feature="num-bigfloat")]
2736impl core::ops::Mul<&InverseArea<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
2737 type Output = InverseArea<num_bigfloat::BigFloat>;
2738 fn mul(self, rhs: &InverseArea<num_bigfloat::BigFloat>) -> Self::Output {
2739 InverseArea{per_m2: self * rhs.per_m2.clone()}
2740 }
2741}
2742#[cfg(feature="num-bigfloat")]
2744impl core::ops::Mul<&InverseArea<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
2745 type Output = InverseArea<num_bigfloat::BigFloat>;
2746 fn mul(self, rhs: &InverseArea<num_bigfloat::BigFloat>) -> Self::Output {
2747 InverseArea{per_m2: self.clone() * rhs.per_m2.clone()}
2748 }
2749}
2750
2751#[cfg(feature="num-complex")]
2753impl core::ops::Mul<InverseArea<num_complex::Complex32>> for num_complex::Complex32 {
2754 type Output = InverseArea<num_complex::Complex32>;
2755 fn mul(self, rhs: InverseArea<num_complex::Complex32>) -> Self::Output {
2756 InverseArea{per_m2: self * rhs.per_m2}
2757 }
2758}
2759#[cfg(feature="num-complex")]
2761impl core::ops::Mul<InverseArea<num_complex::Complex32>> for &num_complex::Complex32 {
2762 type Output = InverseArea<num_complex::Complex32>;
2763 fn mul(self, rhs: InverseArea<num_complex::Complex32>) -> Self::Output {
2764 InverseArea{per_m2: self.clone() * rhs.per_m2}
2765 }
2766}
2767#[cfg(feature="num-complex")]
2769impl core::ops::Mul<&InverseArea<num_complex::Complex32>> for num_complex::Complex32 {
2770 type Output = InverseArea<num_complex::Complex32>;
2771 fn mul(self, rhs: &InverseArea<num_complex::Complex32>) -> Self::Output {
2772 InverseArea{per_m2: self * rhs.per_m2.clone()}
2773 }
2774}
2775#[cfg(feature="num-complex")]
2777impl core::ops::Mul<&InverseArea<num_complex::Complex32>> for &num_complex::Complex32 {
2778 type Output = InverseArea<num_complex::Complex32>;
2779 fn mul(self, rhs: &InverseArea<num_complex::Complex32>) -> Self::Output {
2780 InverseArea{per_m2: self.clone() * rhs.per_m2.clone()}
2781 }
2782}
2783
2784#[cfg(feature="num-complex")]
2786impl core::ops::Mul<InverseArea<num_complex::Complex64>> for num_complex::Complex64 {
2787 type Output = InverseArea<num_complex::Complex64>;
2788 fn mul(self, rhs: InverseArea<num_complex::Complex64>) -> Self::Output {
2789 InverseArea{per_m2: self * rhs.per_m2}
2790 }
2791}
2792#[cfg(feature="num-complex")]
2794impl core::ops::Mul<InverseArea<num_complex::Complex64>> for &num_complex::Complex64 {
2795 type Output = InverseArea<num_complex::Complex64>;
2796 fn mul(self, rhs: InverseArea<num_complex::Complex64>) -> Self::Output {
2797 InverseArea{per_m2: self.clone() * rhs.per_m2}
2798 }
2799}
2800#[cfg(feature="num-complex")]
2802impl core::ops::Mul<&InverseArea<num_complex::Complex64>> for num_complex::Complex64 {
2803 type Output = InverseArea<num_complex::Complex64>;
2804 fn mul(self, rhs: &InverseArea<num_complex::Complex64>) -> Self::Output {
2805 InverseArea{per_m2: self * rhs.per_m2.clone()}
2806 }
2807}
2808#[cfg(feature="num-complex")]
2810impl core::ops::Mul<&InverseArea<num_complex::Complex64>> for &num_complex::Complex64 {
2811 type Output = InverseArea<num_complex::Complex64>;
2812 fn mul(self, rhs: &InverseArea<num_complex::Complex64>) -> Self::Output {
2813 InverseArea{per_m2: self.clone() * rhs.per_m2.clone()}
2814 }
2815}
2816
2817
2818
2819#[cfg(feature = "uom")]
2821impl<T> Into<uom::si::f32::ArealNumberDensity> for InverseArea<T> where T: NumLike+Into<f32> {
2822 fn into(self) -> uom::si::f32::ArealNumberDensity {
2823 uom::si::f32::ArealNumberDensity::new::<uom::si::areal_number_density::per_square_meter>(self.per_m2.into())
2824 }
2825}
2826
2827#[cfg(feature = "uom")]
2829impl<T> From<uom::si::f32::ArealNumberDensity> for InverseArea<T> where T: NumLike+From<f32> {
2830 fn from(src: uom::si::f32::ArealNumberDensity) -> Self {
2831 InverseArea{per_m2: T::from(src.value)}
2832 }
2833}
2834
2835#[cfg(feature = "uom")]
2837impl<T> Into<uom::si::f64::ArealNumberDensity> for InverseArea<T> where T: NumLike+Into<f64> {
2838 fn into(self) -> uom::si::f64::ArealNumberDensity {
2839 uom::si::f64::ArealNumberDensity::new::<uom::si::areal_number_density::per_square_meter>(self.per_m2.into())
2840 }
2841}
2842
2843#[cfg(feature = "uom")]
2845impl<T> From<uom::si::f64::ArealNumberDensity> for InverseArea<T> where T: NumLike+From<f64> {
2846 fn from(src: uom::si::f64::ArealNumberDensity) -> Self {
2847 InverseArea{per_m2: T::from(src.value)}
2848 }
2849}
2850
2851
2852impl<T> core::ops::Mul<Distance<T>> for InverseArea<T> where T: NumLike {
2855 type Output = InverseDistance<T>;
2856 fn mul(self, rhs: Distance<T>) -> Self::Output {
2857 InverseDistance{per_m: self.per_m2 * rhs.m}
2858 }
2859}
2860impl<T> core::ops::Mul<Distance<T>> for &InverseArea<T> where T: NumLike {
2862 type Output = InverseDistance<T>;
2863 fn mul(self, rhs: Distance<T>) -> Self::Output {
2864 InverseDistance{per_m: self.per_m2.clone() * rhs.m}
2865 }
2866}
2867impl<T> core::ops::Mul<&Distance<T>> for InverseArea<T> where T: NumLike {
2869 type Output = InverseDistance<T>;
2870 fn mul(self, rhs: &Distance<T>) -> Self::Output {
2871 InverseDistance{per_m: self.per_m2 * rhs.m.clone()}
2872 }
2873}
2874impl<T> core::ops::Mul<&Distance<T>> for &InverseArea<T> where T: NumLike {
2876 type Output = InverseDistance<T>;
2877 fn mul(self, rhs: &Distance<T>) -> Self::Output {
2878 InverseDistance{per_m: self.per_m2.clone() * rhs.m.clone()}
2879 }
2880}
2881
2882impl<T> core::ops::Div<Distance<T>> for InverseArea<T> where T: NumLike {
2885 type Output = InverseVolume<T>;
2886 fn div(self, rhs: Distance<T>) -> Self::Output {
2887 InverseVolume{per_m3: self.per_m2 / rhs.m}
2888 }
2889}
2890impl<T> core::ops::Div<Distance<T>> for &InverseArea<T> where T: NumLike {
2892 type Output = InverseVolume<T>;
2893 fn div(self, rhs: Distance<T>) -> Self::Output {
2894 InverseVolume{per_m3: self.per_m2.clone() / rhs.m}
2895 }
2896}
2897impl<T> core::ops::Div<&Distance<T>> for InverseArea<T> where T: NumLike {
2899 type Output = InverseVolume<T>;
2900 fn div(self, rhs: &Distance<T>) -> Self::Output {
2901 InverseVolume{per_m3: self.per_m2 / rhs.m.clone()}
2902 }
2903}
2904impl<T> core::ops::Div<&Distance<T>> for &InverseArea<T> where T: NumLike {
2906 type Output = InverseVolume<T>;
2907 fn div(self, rhs: &Distance<T>) -> Self::Output {
2908 InverseVolume{per_m3: self.per_m2.clone() / rhs.m.clone()}
2909 }
2910}
2911
2912impl<T> core::ops::Mul<InverseDistance<T>> for InverseArea<T> where T: NumLike {
2915 type Output = InverseVolume<T>;
2916 fn mul(self, rhs: InverseDistance<T>) -> Self::Output {
2917 InverseVolume{per_m3: self.per_m2 * rhs.per_m}
2918 }
2919}
2920impl<T> core::ops::Mul<InverseDistance<T>> for &InverseArea<T> where T: NumLike {
2922 type Output = InverseVolume<T>;
2923 fn mul(self, rhs: InverseDistance<T>) -> Self::Output {
2924 InverseVolume{per_m3: self.per_m2.clone() * rhs.per_m}
2925 }
2926}
2927impl<T> core::ops::Mul<&InverseDistance<T>> for InverseArea<T> where T: NumLike {
2929 type Output = InverseVolume<T>;
2930 fn mul(self, rhs: &InverseDistance<T>) -> Self::Output {
2931 InverseVolume{per_m3: self.per_m2 * rhs.per_m.clone()}
2932 }
2933}
2934impl<T> core::ops::Mul<&InverseDistance<T>> for &InverseArea<T> where T: NumLike {
2936 type Output = InverseVolume<T>;
2937 fn mul(self, rhs: &InverseDistance<T>) -> Self::Output {
2938 InverseVolume{per_m3: self.per_m2.clone() * rhs.per_m.clone()}
2939 }
2940}
2941
2942impl<T> core::ops::Div<InverseDistance<T>> for InverseArea<T> where T: NumLike {
2945 type Output = InverseDistance<T>;
2946 fn div(self, rhs: InverseDistance<T>) -> Self::Output {
2947 InverseDistance{per_m: self.per_m2 / rhs.per_m}
2948 }
2949}
2950impl<T> core::ops::Div<InverseDistance<T>> for &InverseArea<T> where T: NumLike {
2952 type Output = InverseDistance<T>;
2953 fn div(self, rhs: InverseDistance<T>) -> Self::Output {
2954 InverseDistance{per_m: self.per_m2.clone() / rhs.per_m}
2955 }
2956}
2957impl<T> core::ops::Div<&InverseDistance<T>> for InverseArea<T> where T: NumLike {
2959 type Output = InverseDistance<T>;
2960 fn div(self, rhs: &InverseDistance<T>) -> Self::Output {
2961 InverseDistance{per_m: self.per_m2 / rhs.per_m.clone()}
2962 }
2963}
2964impl<T> core::ops::Div<&InverseDistance<T>> for &InverseArea<T> where T: NumLike {
2966 type Output = InverseDistance<T>;
2967 fn div(self, rhs: &InverseDistance<T>) -> Self::Output {
2968 InverseDistance{per_m: self.per_m2.clone() / rhs.per_m.clone()}
2969 }
2970}
2971
2972impl<T> core::ops::Div<InverseMass<T>> for InverseArea<T> where T: NumLike {
2975 type Output = AreaDensity<T>;
2976 fn div(self, rhs: InverseMass<T>) -> Self::Output {
2977 AreaDensity{kgpm2: self.per_m2 / rhs.per_kg}
2978 }
2979}
2980impl<T> core::ops::Div<InverseMass<T>> for &InverseArea<T> where T: NumLike {
2982 type Output = AreaDensity<T>;
2983 fn div(self, rhs: InverseMass<T>) -> Self::Output {
2984 AreaDensity{kgpm2: self.per_m2.clone() / rhs.per_kg}
2985 }
2986}
2987impl<T> core::ops::Div<&InverseMass<T>> for InverseArea<T> where T: NumLike {
2989 type Output = AreaDensity<T>;
2990 fn div(self, rhs: &InverseMass<T>) -> Self::Output {
2991 AreaDensity{kgpm2: self.per_m2 / rhs.per_kg.clone()}
2992 }
2993}
2994impl<T> core::ops::Div<&InverseMass<T>> for &InverseArea<T> where T: NumLike {
2996 type Output = AreaDensity<T>;
2997 fn div(self, rhs: &InverseMass<T>) -> Self::Output {
2998 AreaDensity{kgpm2: self.per_m2.clone() / rhs.per_kg.clone()}
2999 }
3000}
3001
3002impl<T> core::ops::Mul<Mass<T>> for InverseArea<T> where T: NumLike {
3005 type Output = AreaDensity<T>;
3006 fn mul(self, rhs: Mass<T>) -> Self::Output {
3007 AreaDensity{kgpm2: self.per_m2 * rhs.kg}
3008 }
3009}
3010impl<T> core::ops::Mul<Mass<T>> for &InverseArea<T> where T: NumLike {
3012 type Output = AreaDensity<T>;
3013 fn mul(self, rhs: Mass<T>) -> Self::Output {
3014 AreaDensity{kgpm2: self.per_m2.clone() * rhs.kg}
3015 }
3016}
3017impl<T> core::ops::Mul<&Mass<T>> for InverseArea<T> where T: NumLike {
3019 type Output = AreaDensity<T>;
3020 fn mul(self, rhs: &Mass<T>) -> Self::Output {
3021 AreaDensity{kgpm2: self.per_m2 * rhs.kg.clone()}
3022 }
3023}
3024impl<T> core::ops::Mul<&Mass<T>> for &InverseArea<T> where T: NumLike {
3026 type Output = AreaDensity<T>;
3027 fn mul(self, rhs: &Mass<T>) -> Self::Output {
3028 AreaDensity{kgpm2: self.per_m2.clone() * rhs.kg.clone()}
3029 }
3030}
3031
3032impl<T> core::ops::Mul<AreaPerLumen<T>> for InverseArea<T> where T: NumLike {
3035 type Output = InverseLuminousFlux<T>;
3036 fn mul(self, rhs: AreaPerLumen<T>) -> Self::Output {
3037 InverseLuminousFlux{per_lm: self.per_m2 * rhs.m2_per_lm}
3038 }
3039}
3040impl<T> core::ops::Mul<AreaPerLumen<T>> for &InverseArea<T> where T: NumLike {
3042 type Output = InverseLuminousFlux<T>;
3043 fn mul(self, rhs: AreaPerLumen<T>) -> Self::Output {
3044 InverseLuminousFlux{per_lm: self.per_m2.clone() * rhs.m2_per_lm}
3045 }
3046}
3047impl<T> core::ops::Mul<&AreaPerLumen<T>> for InverseArea<T> where T: NumLike {
3049 type Output = InverseLuminousFlux<T>;
3050 fn mul(self, rhs: &AreaPerLumen<T>) -> Self::Output {
3051 InverseLuminousFlux{per_lm: self.per_m2 * rhs.m2_per_lm.clone()}
3052 }
3053}
3054impl<T> core::ops::Mul<&AreaPerLumen<T>> for &InverseArea<T> where T: NumLike {
3056 type Output = InverseLuminousFlux<T>;
3057 fn mul(self, rhs: &AreaPerLumen<T>) -> Self::Output {
3058 InverseLuminousFlux{per_lm: self.per_m2.clone() * rhs.m2_per_lm.clone()}
3059 }
3060}
3061
3062impl<T> core::ops::Div<Illuminance<T>> for InverseArea<T> where T: NumLike {
3065 type Output = InverseLuminousFlux<T>;
3066 fn div(self, rhs: Illuminance<T>) -> Self::Output {
3067 InverseLuminousFlux{per_lm: self.per_m2 / rhs.lux}
3068 }
3069}
3070impl<T> core::ops::Div<Illuminance<T>> for &InverseArea<T> where T: NumLike {
3072 type Output = InverseLuminousFlux<T>;
3073 fn div(self, rhs: Illuminance<T>) -> Self::Output {
3074 InverseLuminousFlux{per_lm: self.per_m2.clone() / rhs.lux}
3075 }
3076}
3077impl<T> core::ops::Div<&Illuminance<T>> for InverseArea<T> where T: NumLike {
3079 type Output = InverseLuminousFlux<T>;
3080 fn div(self, rhs: &Illuminance<T>) -> Self::Output {
3081 InverseLuminousFlux{per_lm: self.per_m2 / rhs.lux.clone()}
3082 }
3083}
3084impl<T> core::ops::Div<&Illuminance<T>> for &InverseArea<T> where T: NumLike {
3086 type Output = InverseLuminousFlux<T>;
3087 fn div(self, rhs: &Illuminance<T>) -> Self::Output {
3088 InverseLuminousFlux{per_lm: self.per_m2.clone() / rhs.lux.clone()}
3089 }
3090}
3091
3092impl<T> core::ops::Div<InverseLuminousFlux<T>> for InverseArea<T> where T: NumLike {
3095 type Output = Illuminance<T>;
3096 fn div(self, rhs: InverseLuminousFlux<T>) -> Self::Output {
3097 Illuminance{lux: self.per_m2 / rhs.per_lm}
3098 }
3099}
3100impl<T> core::ops::Div<InverseLuminousFlux<T>> for &InverseArea<T> where T: NumLike {
3102 type Output = Illuminance<T>;
3103 fn div(self, rhs: InverseLuminousFlux<T>) -> Self::Output {
3104 Illuminance{lux: self.per_m2.clone() / rhs.per_lm}
3105 }
3106}
3107impl<T> core::ops::Div<&InverseLuminousFlux<T>> for InverseArea<T> where T: NumLike {
3109 type Output = Illuminance<T>;
3110 fn div(self, rhs: &InverseLuminousFlux<T>) -> Self::Output {
3111 Illuminance{lux: self.per_m2 / rhs.per_lm.clone()}
3112 }
3113}
3114impl<T> core::ops::Div<&InverseLuminousFlux<T>> for &InverseArea<T> where T: NumLike {
3116 type Output = Illuminance<T>;
3117 fn div(self, rhs: &InverseLuminousFlux<T>) -> Self::Output {
3118 Illuminance{lux: self.per_m2.clone() / rhs.per_lm.clone()}
3119 }
3120}
3121
3122impl<T> core::ops::Div<InverseMagneticFlux<T>> for InverseArea<T> where T: NumLike {
3125 type Output = MagneticFluxDensity<T>;
3126 fn div(self, rhs: InverseMagneticFlux<T>) -> Self::Output {
3127 MagneticFluxDensity{T: self.per_m2 / rhs.per_Wb}
3128 }
3129}
3130impl<T> core::ops::Div<InverseMagneticFlux<T>> for &InverseArea<T> where T: NumLike {
3132 type Output = MagneticFluxDensity<T>;
3133 fn div(self, rhs: InverseMagneticFlux<T>) -> Self::Output {
3134 MagneticFluxDensity{T: self.per_m2.clone() / rhs.per_Wb}
3135 }
3136}
3137impl<T> core::ops::Div<&InverseMagneticFlux<T>> for InverseArea<T> where T: NumLike {
3139 type Output = MagneticFluxDensity<T>;
3140 fn div(self, rhs: &InverseMagneticFlux<T>) -> Self::Output {
3141 MagneticFluxDensity{T: self.per_m2 / rhs.per_Wb.clone()}
3142 }
3143}
3144impl<T> core::ops::Div<&InverseMagneticFlux<T>> for &InverseArea<T> where T: NumLike {
3146 type Output = MagneticFluxDensity<T>;
3147 fn div(self, rhs: &InverseMagneticFlux<T>) -> Self::Output {
3148 MagneticFluxDensity{T: self.per_m2.clone() / rhs.per_Wb.clone()}
3149 }
3150}
3151
3152impl<T> core::ops::Mul<InverseMagneticFluxDensity<T>> for InverseArea<T> where T: NumLike {
3155 type Output = InverseMagneticFlux<T>;
3156 fn mul(self, rhs: InverseMagneticFluxDensity<T>) -> Self::Output {
3157 InverseMagneticFlux{per_Wb: self.per_m2 * rhs.m2_per_Wb}
3158 }
3159}
3160impl<T> core::ops::Mul<InverseMagneticFluxDensity<T>> for &InverseArea<T> where T: NumLike {
3162 type Output = InverseMagneticFlux<T>;
3163 fn mul(self, rhs: InverseMagneticFluxDensity<T>) -> Self::Output {
3164 InverseMagneticFlux{per_Wb: self.per_m2.clone() * rhs.m2_per_Wb}
3165 }
3166}
3167impl<T> core::ops::Mul<&InverseMagneticFluxDensity<T>> for InverseArea<T> where T: NumLike {
3169 type Output = InverseMagneticFlux<T>;
3170 fn mul(self, rhs: &InverseMagneticFluxDensity<T>) -> Self::Output {
3171 InverseMagneticFlux{per_Wb: self.per_m2 * rhs.m2_per_Wb.clone()}
3172 }
3173}
3174impl<T> core::ops::Mul<&InverseMagneticFluxDensity<T>> for &InverseArea<T> where T: NumLike {
3176 type Output = InverseMagneticFlux<T>;
3177 fn mul(self, rhs: &InverseMagneticFluxDensity<T>) -> Self::Output {
3178 InverseMagneticFlux{per_Wb: self.per_m2.clone() * rhs.m2_per_Wb.clone()}
3179 }
3180}
3181
3182impl<T> core::ops::Mul<LuminousFlux<T>> for InverseArea<T> where T: NumLike {
3185 type Output = Illuminance<T>;
3186 fn mul(self, rhs: LuminousFlux<T>) -> Self::Output {
3187 Illuminance{lux: self.per_m2 * rhs.lm}
3188 }
3189}
3190impl<T> core::ops::Mul<LuminousFlux<T>> for &InverseArea<T> where T: NumLike {
3192 type Output = Illuminance<T>;
3193 fn mul(self, rhs: LuminousFlux<T>) -> Self::Output {
3194 Illuminance{lux: self.per_m2.clone() * rhs.lm}
3195 }
3196}
3197impl<T> core::ops::Mul<&LuminousFlux<T>> for InverseArea<T> where T: NumLike {
3199 type Output = Illuminance<T>;
3200 fn mul(self, rhs: &LuminousFlux<T>) -> Self::Output {
3201 Illuminance{lux: self.per_m2 * rhs.lm.clone()}
3202 }
3203}
3204impl<T> core::ops::Mul<&LuminousFlux<T>> for &InverseArea<T> where T: NumLike {
3206 type Output = Illuminance<T>;
3207 fn mul(self, rhs: &LuminousFlux<T>) -> Self::Output {
3208 Illuminance{lux: self.per_m2.clone() * rhs.lm.clone()}
3209 }
3210}
3211
3212impl<T> core::ops::Mul<MagneticFlux<T>> for InverseArea<T> where T: NumLike {
3215 type Output = MagneticFluxDensity<T>;
3216 fn mul(self, rhs: MagneticFlux<T>) -> Self::Output {
3217 MagneticFluxDensity{T: self.per_m2 * rhs.Wb}
3218 }
3219}
3220impl<T> core::ops::Mul<MagneticFlux<T>> for &InverseArea<T> where T: NumLike {
3222 type Output = MagneticFluxDensity<T>;
3223 fn mul(self, rhs: MagneticFlux<T>) -> Self::Output {
3224 MagneticFluxDensity{T: self.per_m2.clone() * rhs.Wb}
3225 }
3226}
3227impl<T> core::ops::Mul<&MagneticFlux<T>> for InverseArea<T> where T: NumLike {
3229 type Output = MagneticFluxDensity<T>;
3230 fn mul(self, rhs: &MagneticFlux<T>) -> Self::Output {
3231 MagneticFluxDensity{T: self.per_m2 * rhs.Wb.clone()}
3232 }
3233}
3234impl<T> core::ops::Mul<&MagneticFlux<T>> for &InverseArea<T> where T: NumLike {
3236 type Output = MagneticFluxDensity<T>;
3237 fn mul(self, rhs: &MagneticFlux<T>) -> Self::Output {
3238 MagneticFluxDensity{T: self.per_m2.clone() * rhs.Wb.clone()}
3239 }
3240}
3241
3242impl<T> core::ops::Div<MagneticFluxDensity<T>> for InverseArea<T> where T: NumLike {
3245 type Output = InverseMagneticFlux<T>;
3246 fn div(self, rhs: MagneticFluxDensity<T>) -> Self::Output {
3247 InverseMagneticFlux{per_Wb: self.per_m2 / rhs.T}
3248 }
3249}
3250impl<T> core::ops::Div<MagneticFluxDensity<T>> for &InverseArea<T> where T: NumLike {
3252 type Output = InverseMagneticFlux<T>;
3253 fn div(self, rhs: MagneticFluxDensity<T>) -> Self::Output {
3254 InverseMagneticFlux{per_Wb: self.per_m2.clone() / rhs.T}
3255 }
3256}
3257impl<T> core::ops::Div<&MagneticFluxDensity<T>> for InverseArea<T> where T: NumLike {
3259 type Output = InverseMagneticFlux<T>;
3260 fn div(self, rhs: &MagneticFluxDensity<T>) -> Self::Output {
3261 InverseMagneticFlux{per_Wb: self.per_m2 / rhs.T.clone()}
3262 }
3263}
3264impl<T> core::ops::Div<&MagneticFluxDensity<T>> for &InverseArea<T> where T: NumLike {
3266 type Output = InverseMagneticFlux<T>;
3267 fn div(self, rhs: &MagneticFluxDensity<T>) -> Self::Output {
3268 InverseMagneticFlux{per_Wb: self.per_m2.clone() / rhs.T.clone()}
3269 }
3270}
3271
3272impl<T> core::ops::Div<InverseVolume<T>> for InverseArea<T> where T: NumLike {
3275 type Output = Distance<T>;
3276 fn div(self, rhs: InverseVolume<T>) -> Self::Output {
3277 Distance{m: self.per_m2 / rhs.per_m3}
3278 }
3279}
3280impl<T> core::ops::Div<InverseVolume<T>> for &InverseArea<T> where T: NumLike {
3282 type Output = Distance<T>;
3283 fn div(self, rhs: InverseVolume<T>) -> Self::Output {
3284 Distance{m: self.per_m2.clone() / rhs.per_m3}
3285 }
3286}
3287impl<T> core::ops::Div<&InverseVolume<T>> for InverseArea<T> where T: NumLike {
3289 type Output = Distance<T>;
3290 fn div(self, rhs: &InverseVolume<T>) -> Self::Output {
3291 Distance{m: self.per_m2 / rhs.per_m3.clone()}
3292 }
3293}
3294impl<T> core::ops::Div<&InverseVolume<T>> for &InverseArea<T> where T: NumLike {
3296 type Output = Distance<T>;
3297 fn div(self, rhs: &InverseVolume<T>) -> Self::Output {
3298 Distance{m: self.per_m2.clone() / rhs.per_m3.clone()}
3299 }
3300}
3301
3302impl<T> core::ops::Mul<Volume<T>> for InverseArea<T> where T: NumLike {
3305 type Output = Distance<T>;
3306 fn mul(self, rhs: Volume<T>) -> Self::Output {
3307 Distance{m: self.per_m2 * rhs.m3}
3308 }
3309}
3310impl<T> core::ops::Mul<Volume<T>> for &InverseArea<T> where T: NumLike {
3312 type Output = Distance<T>;
3313 fn mul(self, rhs: Volume<T>) -> Self::Output {
3314 Distance{m: self.per_m2.clone() * rhs.m3}
3315 }
3316}
3317impl<T> core::ops::Mul<&Volume<T>> for InverseArea<T> where T: NumLike {
3319 type Output = Distance<T>;
3320 fn mul(self, rhs: &Volume<T>) -> Self::Output {
3321 Distance{m: self.per_m2 * rhs.m3.clone()}
3322 }
3323}
3324impl<T> core::ops::Mul<&Volume<T>> for &InverseArea<T> where T: NumLike {
3326 type Output = Distance<T>;
3327 fn mul(self, rhs: &Volume<T>) -> Self::Output {
3328 Distance{m: self.per_m2.clone() * rhs.m3.clone()}
3329 }
3330}
3331
3332impl<T> core::ops::Div<AreaDensity<T>> for InverseArea<T> where T: NumLike {
3335 type Output = InverseMass<T>;
3336 fn div(self, rhs: AreaDensity<T>) -> Self::Output {
3337 InverseMass{per_kg: self.per_m2 / rhs.kgpm2}
3338 }
3339}
3340impl<T> core::ops::Div<AreaDensity<T>> for &InverseArea<T> where T: NumLike {
3342 type Output = InverseMass<T>;
3343 fn div(self, rhs: AreaDensity<T>) -> Self::Output {
3344 InverseMass{per_kg: self.per_m2.clone() / rhs.kgpm2}
3345 }
3346}
3347impl<T> core::ops::Div<&AreaDensity<T>> for InverseArea<T> where T: NumLike {
3349 type Output = InverseMass<T>;
3350 fn div(self, rhs: &AreaDensity<T>) -> Self::Output {
3351 InverseMass{per_kg: self.per_m2 / rhs.kgpm2.clone()}
3352 }
3353}
3354impl<T> core::ops::Div<&AreaDensity<T>> for &InverseArea<T> where T: NumLike {
3356 type Output = InverseMass<T>;
3357 fn div(self, rhs: &AreaDensity<T>) -> Self::Output {
3358 InverseMass{per_kg: self.per_m2.clone() / rhs.kgpm2.clone()}
3359 }
3360}
3361
3362impl<T> core::ops::Mul<AreaPerMass<T>> for InverseArea<T> where T: NumLike {
3365 type Output = InverseMass<T>;
3366 fn mul(self, rhs: AreaPerMass<T>) -> Self::Output {
3367 InverseMass{per_kg: self.per_m2 * rhs.m2_per_kg}
3368 }
3369}
3370impl<T> core::ops::Mul<AreaPerMass<T>> for &InverseArea<T> where T: NumLike {
3372 type Output = InverseMass<T>;
3373 fn mul(self, rhs: AreaPerMass<T>) -> Self::Output {
3374 InverseMass{per_kg: self.per_m2.clone() * rhs.m2_per_kg}
3375 }
3376}
3377impl<T> core::ops::Mul<&AreaPerMass<T>> for InverseArea<T> where T: NumLike {
3379 type Output = InverseMass<T>;
3380 fn mul(self, rhs: &AreaPerMass<T>) -> Self::Output {
3381 InverseMass{per_kg: self.per_m2 * rhs.m2_per_kg.clone()}
3382 }
3383}
3384impl<T> core::ops::Mul<&AreaPerMass<T>> for &InverseArea<T> where T: NumLike {
3386 type Output = InverseMass<T>;
3387 fn mul(self, rhs: &AreaPerMass<T>) -> Self::Output {
3388 InverseMass{per_kg: self.per_m2.clone() * rhs.m2_per_kg.clone()}
3389 }
3390}
3391
3392impl<T> core::ops::Mul<Force<T>> for InverseArea<T> where T: NumLike {
3395 type Output = Pressure<T>;
3396 fn mul(self, rhs: Force<T>) -> Self::Output {
3397 Pressure{Pa: self.per_m2 * rhs.N}
3398 }
3399}
3400impl<T> core::ops::Mul<Force<T>> for &InverseArea<T> where T: NumLike {
3402 type Output = Pressure<T>;
3403 fn mul(self, rhs: Force<T>) -> Self::Output {
3404 Pressure{Pa: self.per_m2.clone() * rhs.N}
3405 }
3406}
3407impl<T> core::ops::Mul<&Force<T>> for InverseArea<T> where T: NumLike {
3409 type Output = Pressure<T>;
3410 fn mul(self, rhs: &Force<T>) -> Self::Output {
3411 Pressure{Pa: self.per_m2 * rhs.N.clone()}
3412 }
3413}
3414impl<T> core::ops::Mul<&Force<T>> for &InverseArea<T> where T: NumLike {
3416 type Output = Pressure<T>;
3417 fn mul(self, rhs: &Force<T>) -> Self::Output {
3418 Pressure{Pa: self.per_m2.clone() * rhs.N.clone()}
3419 }
3420}
3421
3422impl<T> core::ops::Div<InverseForce<T>> for InverseArea<T> where T: NumLike {
3425 type Output = Pressure<T>;
3426 fn div(self, rhs: InverseForce<T>) -> Self::Output {
3427 Pressure{Pa: self.per_m2 / rhs.per_N}
3428 }
3429}
3430impl<T> core::ops::Div<InverseForce<T>> for &InverseArea<T> where T: NumLike {
3432 type Output = Pressure<T>;
3433 fn div(self, rhs: InverseForce<T>) -> Self::Output {
3434 Pressure{Pa: self.per_m2.clone() / rhs.per_N}
3435 }
3436}
3437impl<T> core::ops::Div<&InverseForce<T>> for InverseArea<T> where T: NumLike {
3439 type Output = Pressure<T>;
3440 fn div(self, rhs: &InverseForce<T>) -> Self::Output {
3441 Pressure{Pa: self.per_m2 / rhs.per_N.clone()}
3442 }
3443}
3444impl<T> core::ops::Div<&InverseForce<T>> for &InverseArea<T> where T: NumLike {
3446 type Output = Pressure<T>;
3447 fn div(self, rhs: &InverseForce<T>) -> Self::Output {
3448 Pressure{Pa: self.per_m2.clone() / rhs.per_N.clone()}
3449 }
3450}
3451
3452impl<T> core::ops::Div<InverseMomentOfInertia<T>> for InverseArea<T> where T: NumLike {
3455 type Output = Mass<T>;
3456 fn div(self, rhs: InverseMomentOfInertia<T>) -> Self::Output {
3457 Mass{kg: self.per_m2 / rhs.per_kgm2}
3458 }
3459}
3460impl<T> core::ops::Div<InverseMomentOfInertia<T>> for &InverseArea<T> where T: NumLike {
3462 type Output = Mass<T>;
3463 fn div(self, rhs: InverseMomentOfInertia<T>) -> Self::Output {
3464 Mass{kg: self.per_m2.clone() / rhs.per_kgm2}
3465 }
3466}
3467impl<T> core::ops::Div<&InverseMomentOfInertia<T>> for InverseArea<T> where T: NumLike {
3469 type Output = Mass<T>;
3470 fn div(self, rhs: &InverseMomentOfInertia<T>) -> Self::Output {
3471 Mass{kg: self.per_m2 / rhs.per_kgm2.clone()}
3472 }
3473}
3474impl<T> core::ops::Div<&InverseMomentOfInertia<T>> for &InverseArea<T> where T: NumLike {
3476 type Output = Mass<T>;
3477 fn div(self, rhs: &InverseMomentOfInertia<T>) -> Self::Output {
3478 Mass{kg: self.per_m2.clone() / rhs.per_kgm2.clone()}
3479 }
3480}
3481
3482impl<T> core::ops::Mul<InversePressure<T>> for InverseArea<T> where T: NumLike {
3485 type Output = InverseForce<T>;
3486 fn mul(self, rhs: InversePressure<T>) -> Self::Output {
3487 InverseForce{per_N: self.per_m2 * rhs.per_Pa}
3488 }
3489}
3490impl<T> core::ops::Mul<InversePressure<T>> for &InverseArea<T> where T: NumLike {
3492 type Output = InverseForce<T>;
3493 fn mul(self, rhs: InversePressure<T>) -> Self::Output {
3494 InverseForce{per_N: self.per_m2.clone() * rhs.per_Pa}
3495 }
3496}
3497impl<T> core::ops::Mul<&InversePressure<T>> for InverseArea<T> where T: NumLike {
3499 type Output = InverseForce<T>;
3500 fn mul(self, rhs: &InversePressure<T>) -> Self::Output {
3501 InverseForce{per_N: self.per_m2 * rhs.per_Pa.clone()}
3502 }
3503}
3504impl<T> core::ops::Mul<&InversePressure<T>> for &InverseArea<T> where T: NumLike {
3506 type Output = InverseForce<T>;
3507 fn mul(self, rhs: &InversePressure<T>) -> Self::Output {
3508 InverseForce{per_N: self.per_m2.clone() * rhs.per_Pa.clone()}
3509 }
3510}
3511
3512impl<T> core::ops::Mul<MomentOfInertia<T>> for InverseArea<T> where T: NumLike {
3515 type Output = Mass<T>;
3516 fn mul(self, rhs: MomentOfInertia<T>) -> Self::Output {
3517 Mass{kg: self.per_m2 * rhs.kgm2}
3518 }
3519}
3520impl<T> core::ops::Mul<MomentOfInertia<T>> for &InverseArea<T> where T: NumLike {
3522 type Output = Mass<T>;
3523 fn mul(self, rhs: MomentOfInertia<T>) -> Self::Output {
3524 Mass{kg: self.per_m2.clone() * rhs.kgm2}
3525 }
3526}
3527impl<T> core::ops::Mul<&MomentOfInertia<T>> for InverseArea<T> where T: NumLike {
3529 type Output = Mass<T>;
3530 fn mul(self, rhs: &MomentOfInertia<T>) -> Self::Output {
3531 Mass{kg: self.per_m2 * rhs.kgm2.clone()}
3532 }
3533}
3534impl<T> core::ops::Mul<&MomentOfInertia<T>> for &InverseArea<T> where T: NumLike {
3536 type Output = Mass<T>;
3537 fn mul(self, rhs: &MomentOfInertia<T>) -> Self::Output {
3538 Mass{kg: self.per_m2.clone() * rhs.kgm2.clone()}
3539 }
3540}
3541
3542impl<T> core::ops::Div<Pressure<T>> for InverseArea<T> where T: NumLike {
3545 type Output = InverseForce<T>;
3546 fn div(self, rhs: Pressure<T>) -> Self::Output {
3547 InverseForce{per_N: self.per_m2 / rhs.Pa}
3548 }
3549}
3550impl<T> core::ops::Div<Pressure<T>> for &InverseArea<T> where T: NumLike {
3552 type Output = InverseForce<T>;
3553 fn div(self, rhs: Pressure<T>) -> Self::Output {
3554 InverseForce{per_N: self.per_m2.clone() / rhs.Pa}
3555 }
3556}
3557impl<T> core::ops::Div<&Pressure<T>> for InverseArea<T> where T: NumLike {
3559 type Output = InverseForce<T>;
3560 fn div(self, rhs: &Pressure<T>) -> Self::Output {
3561 InverseForce{per_N: self.per_m2 / rhs.Pa.clone()}
3562 }
3563}
3564impl<T> core::ops::Div<&Pressure<T>> for &InverseArea<T> where T: NumLike {
3566 type Output = InverseForce<T>;
3567 fn div(self, rhs: &Pressure<T>) -> Self::Output {
3568 InverseForce{per_N: self.per_m2.clone() / rhs.Pa.clone()}
3569 }
3570}
3571
3572impl<T> core::ops::Div<InverseArea<T>> for f64 where T: NumLike+From<f64> {
3575 type Output = Area<T>;
3576 fn div(self, rhs: InverseArea<T>) -> Self::Output {
3577 Area{m2: T::from(self) / rhs.per_m2}
3578 }
3579}
3580impl<T> core::ops::Div<InverseArea<T>> for &f64 where T: NumLike+From<f64> {
3582 type Output = Area<T>;
3583 fn div(self, rhs: InverseArea<T>) -> Self::Output {
3584 Area{m2: T::from(self.clone()) / rhs.per_m2}
3585 }
3586}
3587impl<T> core::ops::Div<&InverseArea<T>> for f64 where T: NumLike+From<f64> {
3589 type Output = Area<T>;
3590 fn div(self, rhs: &InverseArea<T>) -> Self::Output {
3591 Area{m2: T::from(self) / rhs.per_m2.clone()}
3592 }
3593}
3594impl<T> core::ops::Div<&InverseArea<T>> for &f64 where T: NumLike+From<f64> {
3596 type Output = Area<T>;
3597 fn div(self, rhs: &InverseArea<T>) -> Self::Output {
3598 Area{m2: T::from(self.clone()) / rhs.per_m2.clone()}
3599 }
3600}
3601
3602impl<T> core::ops::Div<InverseArea<T>> for f32 where T: NumLike+From<f32> {
3605 type Output = Area<T>;
3606 fn div(self, rhs: InverseArea<T>) -> Self::Output {
3607 Area{m2: T::from(self) / rhs.per_m2}
3608 }
3609}
3610impl<T> core::ops::Div<InverseArea<T>> for &f32 where T: NumLike+From<f32> {
3612 type Output = Area<T>;
3613 fn div(self, rhs: InverseArea<T>) -> Self::Output {
3614 Area{m2: T::from(self.clone()) / rhs.per_m2}
3615 }
3616}
3617impl<T> core::ops::Div<&InverseArea<T>> for f32 where T: NumLike+From<f32> {
3619 type Output = Area<T>;
3620 fn div(self, rhs: &InverseArea<T>) -> Self::Output {
3621 Area{m2: T::from(self) / rhs.per_m2.clone()}
3622 }
3623}
3624impl<T> core::ops::Div<&InverseArea<T>> for &f32 where T: NumLike+From<f32> {
3626 type Output = Area<T>;
3627 fn div(self, rhs: &InverseArea<T>) -> Self::Output {
3628 Area{m2: T::from(self.clone()) / rhs.per_m2.clone()}
3629 }
3630}
3631
3632impl<T> core::ops::Div<InverseArea<T>> for i64 where T: NumLike+From<i64> {
3635 type Output = Area<T>;
3636 fn div(self, rhs: InverseArea<T>) -> Self::Output {
3637 Area{m2: T::from(self) / rhs.per_m2}
3638 }
3639}
3640impl<T> core::ops::Div<InverseArea<T>> for &i64 where T: NumLike+From<i64> {
3642 type Output = Area<T>;
3643 fn div(self, rhs: InverseArea<T>) -> Self::Output {
3644 Area{m2: T::from(self.clone()) / rhs.per_m2}
3645 }
3646}
3647impl<T> core::ops::Div<&InverseArea<T>> for i64 where T: NumLike+From<i64> {
3649 type Output = Area<T>;
3650 fn div(self, rhs: &InverseArea<T>) -> Self::Output {
3651 Area{m2: T::from(self) / rhs.per_m2.clone()}
3652 }
3653}
3654impl<T> core::ops::Div<&InverseArea<T>> for &i64 where T: NumLike+From<i64> {
3656 type Output = Area<T>;
3657 fn div(self, rhs: &InverseArea<T>) -> Self::Output {
3658 Area{m2: T::from(self.clone()) / rhs.per_m2.clone()}
3659 }
3660}
3661
3662impl<T> core::ops::Div<InverseArea<T>> for i32 where T: NumLike+From<i32> {
3665 type Output = Area<T>;
3666 fn div(self, rhs: InverseArea<T>) -> Self::Output {
3667 Area{m2: T::from(self) / rhs.per_m2}
3668 }
3669}
3670impl<T> core::ops::Div<InverseArea<T>> for &i32 where T: NumLike+From<i32> {
3672 type Output = Area<T>;
3673 fn div(self, rhs: InverseArea<T>) -> Self::Output {
3674 Area{m2: T::from(self.clone()) / rhs.per_m2}
3675 }
3676}
3677impl<T> core::ops::Div<&InverseArea<T>> for i32 where T: NumLike+From<i32> {
3679 type Output = Area<T>;
3680 fn div(self, rhs: &InverseArea<T>) -> Self::Output {
3681 Area{m2: T::from(self) / rhs.per_m2.clone()}
3682 }
3683}
3684impl<T> core::ops::Div<&InverseArea<T>> for &i32 where T: NumLike+From<i32> {
3686 type Output = Area<T>;
3687 fn div(self, rhs: &InverseArea<T>) -> Self::Output {
3688 Area{m2: T::from(self.clone()) / rhs.per_m2.clone()}
3689 }
3690}
3691
3692#[cfg(feature="num-bigfloat")]
3695impl<T> core::ops::Div<InverseArea<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
3696 type Output = Area<T>;
3697 fn div(self, rhs: InverseArea<T>) -> Self::Output {
3698 Area{m2: T::from(self) / rhs.per_m2}
3699 }
3700}
3701#[cfg(feature="num-bigfloat")]
3703impl<T> core::ops::Div<InverseArea<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
3704 type Output = Area<T>;
3705 fn div(self, rhs: InverseArea<T>) -> Self::Output {
3706 Area{m2: T::from(self.clone()) / rhs.per_m2}
3707 }
3708}
3709#[cfg(feature="num-bigfloat")]
3711impl<T> core::ops::Div<&InverseArea<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
3712 type Output = Area<T>;
3713 fn div(self, rhs: &InverseArea<T>) -> Self::Output {
3714 Area{m2: T::from(self) / rhs.per_m2.clone()}
3715 }
3716}
3717#[cfg(feature="num-bigfloat")]
3719impl<T> core::ops::Div<&InverseArea<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
3720 type Output = Area<T>;
3721 fn div(self, rhs: &InverseArea<T>) -> Self::Output {
3722 Area{m2: T::from(self.clone()) / rhs.per_m2.clone()}
3723 }
3724}
3725
3726#[cfg(feature="num-complex")]
3729impl<T> core::ops::Div<InverseArea<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
3730 type Output = Area<T>;
3731 fn div(self, rhs: InverseArea<T>) -> Self::Output {
3732 Area{m2: T::from(self) / rhs.per_m2}
3733 }
3734}
3735#[cfg(feature="num-complex")]
3737impl<T> core::ops::Div<InverseArea<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
3738 type Output = Area<T>;
3739 fn div(self, rhs: InverseArea<T>) -> Self::Output {
3740 Area{m2: T::from(self.clone()) / rhs.per_m2}
3741 }
3742}
3743#[cfg(feature="num-complex")]
3745impl<T> core::ops::Div<&InverseArea<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
3746 type Output = Area<T>;
3747 fn div(self, rhs: &InverseArea<T>) -> Self::Output {
3748 Area{m2: T::from(self) / rhs.per_m2.clone()}
3749 }
3750}
3751#[cfg(feature="num-complex")]
3753impl<T> core::ops::Div<&InverseArea<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
3754 type Output = Area<T>;
3755 fn div(self, rhs: &InverseArea<T>) -> Self::Output {
3756 Area{m2: T::from(self.clone()) / rhs.per_m2.clone()}
3757 }
3758}
3759
3760#[cfg(feature="num-complex")]
3763impl<T> core::ops::Div<InverseArea<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
3764 type Output = Area<T>;
3765 fn div(self, rhs: InverseArea<T>) -> Self::Output {
3766 Area{m2: T::from(self) / rhs.per_m2}
3767 }
3768}
3769#[cfg(feature="num-complex")]
3771impl<T> core::ops::Div<InverseArea<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
3772 type Output = Area<T>;
3773 fn div(self, rhs: InverseArea<T>) -> Self::Output {
3774 Area{m2: T::from(self.clone()) / rhs.per_m2}
3775 }
3776}
3777#[cfg(feature="num-complex")]
3779impl<T> core::ops::Div<&InverseArea<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
3780 type Output = Area<T>;
3781 fn div(self, rhs: &InverseArea<T>) -> Self::Output {
3782 Area{m2: T::from(self) / rhs.per_m2.clone()}
3783 }
3784}
3785#[cfg(feature="num-complex")]
3787impl<T> core::ops::Div<&InverseArea<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
3788 type Output = Area<T>;
3789 fn div(self, rhs: &InverseArea<T>) -> Self::Output {
3790 Area{m2: T::from(self.clone()) / rhs.per_m2.clone()}
3791 }
3792}
3793
3794#[derive(UnitStruct, Debug, Clone)]
3796#[cfg_attr(feature="serde", derive(Serialize, Deserialize))]
3797pub struct InverseSolidAngle<T: NumLike>{
3798 pub per_sr: T
3800}
3801
3802impl<T> InverseSolidAngle<T> where T: NumLike {
3803
3804 pub fn unit_name() -> &'static str { "inverse steradian" }
3806
3807 pub fn unit_symbol() -> &'static str { "1/sr" }
3809
3810 pub fn from_per_sr(per_sr: T) -> Self { InverseSolidAngle{per_sr: per_sr} }
3815
3816 pub fn to_per_sr(&self) -> T { self.per_sr.clone() }
3818
3819 pub fn from_per_steradians(per_steradians: T) -> Self { InverseSolidAngle{per_sr: per_steradians} }
3824
3825 pub fn to_per_steradians(&self) -> T { self.per_sr.clone() }
3827
3828}
3829
3830impl<T> fmt::Display for InverseSolidAngle<T> where T: NumLike {
3831 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3832 write!(f, "{} {}", &self.per_sr, Self::unit_symbol())
3833 }
3834}
3835
3836impl<T> InverseSolidAngle<T> where T: NumLike+From<f64> {
3837
3838}
3839
3840
3841#[cfg(feature="num-bigfloat")]
3843impl core::ops::Mul<InverseSolidAngle<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
3844 type Output = InverseSolidAngle<num_bigfloat::BigFloat>;
3845 fn mul(self, rhs: InverseSolidAngle<num_bigfloat::BigFloat>) -> Self::Output {
3846 InverseSolidAngle{per_sr: self * rhs.per_sr}
3847 }
3848}
3849#[cfg(feature="num-bigfloat")]
3851impl core::ops::Mul<InverseSolidAngle<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
3852 type Output = InverseSolidAngle<num_bigfloat::BigFloat>;
3853 fn mul(self, rhs: InverseSolidAngle<num_bigfloat::BigFloat>) -> Self::Output {
3854 InverseSolidAngle{per_sr: self.clone() * rhs.per_sr}
3855 }
3856}
3857#[cfg(feature="num-bigfloat")]
3859impl core::ops::Mul<&InverseSolidAngle<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
3860 type Output = InverseSolidAngle<num_bigfloat::BigFloat>;
3861 fn mul(self, rhs: &InverseSolidAngle<num_bigfloat::BigFloat>) -> Self::Output {
3862 InverseSolidAngle{per_sr: self * rhs.per_sr.clone()}
3863 }
3864}
3865#[cfg(feature="num-bigfloat")]
3867impl core::ops::Mul<&InverseSolidAngle<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
3868 type Output = InverseSolidAngle<num_bigfloat::BigFloat>;
3869 fn mul(self, rhs: &InverseSolidAngle<num_bigfloat::BigFloat>) -> Self::Output {
3870 InverseSolidAngle{per_sr: self.clone() * rhs.per_sr.clone()}
3871 }
3872}
3873
3874#[cfg(feature="num-complex")]
3876impl core::ops::Mul<InverseSolidAngle<num_complex::Complex32>> for num_complex::Complex32 {
3877 type Output = InverseSolidAngle<num_complex::Complex32>;
3878 fn mul(self, rhs: InverseSolidAngle<num_complex::Complex32>) -> Self::Output {
3879 InverseSolidAngle{per_sr: self * rhs.per_sr}
3880 }
3881}
3882#[cfg(feature="num-complex")]
3884impl core::ops::Mul<InverseSolidAngle<num_complex::Complex32>> for &num_complex::Complex32 {
3885 type Output = InverseSolidAngle<num_complex::Complex32>;
3886 fn mul(self, rhs: InverseSolidAngle<num_complex::Complex32>) -> Self::Output {
3887 InverseSolidAngle{per_sr: self.clone() * rhs.per_sr}
3888 }
3889}
3890#[cfg(feature="num-complex")]
3892impl core::ops::Mul<&InverseSolidAngle<num_complex::Complex32>> for num_complex::Complex32 {
3893 type Output = InverseSolidAngle<num_complex::Complex32>;
3894 fn mul(self, rhs: &InverseSolidAngle<num_complex::Complex32>) -> Self::Output {
3895 InverseSolidAngle{per_sr: self * rhs.per_sr.clone()}
3896 }
3897}
3898#[cfg(feature="num-complex")]
3900impl core::ops::Mul<&InverseSolidAngle<num_complex::Complex32>> for &num_complex::Complex32 {
3901 type Output = InverseSolidAngle<num_complex::Complex32>;
3902 fn mul(self, rhs: &InverseSolidAngle<num_complex::Complex32>) -> Self::Output {
3903 InverseSolidAngle{per_sr: self.clone() * rhs.per_sr.clone()}
3904 }
3905}
3906
3907#[cfg(feature="num-complex")]
3909impl core::ops::Mul<InverseSolidAngle<num_complex::Complex64>> for num_complex::Complex64 {
3910 type Output = InverseSolidAngle<num_complex::Complex64>;
3911 fn mul(self, rhs: InverseSolidAngle<num_complex::Complex64>) -> Self::Output {
3912 InverseSolidAngle{per_sr: self * rhs.per_sr}
3913 }
3914}
3915#[cfg(feature="num-complex")]
3917impl core::ops::Mul<InverseSolidAngle<num_complex::Complex64>> for &num_complex::Complex64 {
3918 type Output = InverseSolidAngle<num_complex::Complex64>;
3919 fn mul(self, rhs: InverseSolidAngle<num_complex::Complex64>) -> Self::Output {
3920 InverseSolidAngle{per_sr: self.clone() * rhs.per_sr}
3921 }
3922}
3923#[cfg(feature="num-complex")]
3925impl core::ops::Mul<&InverseSolidAngle<num_complex::Complex64>> for num_complex::Complex64 {
3926 type Output = InverseSolidAngle<num_complex::Complex64>;
3927 fn mul(self, rhs: &InverseSolidAngle<num_complex::Complex64>) -> Self::Output {
3928 InverseSolidAngle{per_sr: self * rhs.per_sr.clone()}
3929 }
3930}
3931#[cfg(feature="num-complex")]
3933impl core::ops::Mul<&InverseSolidAngle<num_complex::Complex64>> for &num_complex::Complex64 {
3934 type Output = InverseSolidAngle<num_complex::Complex64>;
3935 fn mul(self, rhs: &InverseSolidAngle<num_complex::Complex64>) -> Self::Output {
3936 InverseSolidAngle{per_sr: self.clone() * rhs.per_sr.clone()}
3937 }
3938}
3939
3940
3941
3942
3943impl<T> core::ops::Mul<InverseLuminosity<T>> for InverseSolidAngle<T> where T: NumLike {
3946 type Output = InverseLuminousFlux<T>;
3947 fn mul(self, rhs: InverseLuminosity<T>) -> Self::Output {
3948 InverseLuminousFlux{per_lm: self.per_sr * rhs.per_cd}
3949 }
3950}
3951impl<T> core::ops::Mul<InverseLuminosity<T>> for &InverseSolidAngle<T> where T: NumLike {
3953 type Output = InverseLuminousFlux<T>;
3954 fn mul(self, rhs: InverseLuminosity<T>) -> Self::Output {
3955 InverseLuminousFlux{per_lm: self.per_sr.clone() * rhs.per_cd}
3956 }
3957}
3958impl<T> core::ops::Mul<&InverseLuminosity<T>> for InverseSolidAngle<T> where T: NumLike {
3960 type Output = InverseLuminousFlux<T>;
3961 fn mul(self, rhs: &InverseLuminosity<T>) -> Self::Output {
3962 InverseLuminousFlux{per_lm: self.per_sr * rhs.per_cd.clone()}
3963 }
3964}
3965impl<T> core::ops::Mul<&InverseLuminosity<T>> for &InverseSolidAngle<T> where T: NumLike {
3967 type Output = InverseLuminousFlux<T>;
3968 fn mul(self, rhs: &InverseLuminosity<T>) -> Self::Output {
3969 InverseLuminousFlux{per_lm: self.per_sr.clone() * rhs.per_cd.clone()}
3970 }
3971}
3972
3973impl<T> core::ops::Div<Luminosity<T>> for InverseSolidAngle<T> where T: NumLike {
3976 type Output = InverseLuminousFlux<T>;
3977 fn div(self, rhs: Luminosity<T>) -> Self::Output {
3978 InverseLuminousFlux{per_lm: self.per_sr / rhs.cd}
3979 }
3980}
3981impl<T> core::ops::Div<Luminosity<T>> for &InverseSolidAngle<T> where T: NumLike {
3983 type Output = InverseLuminousFlux<T>;
3984 fn div(self, rhs: Luminosity<T>) -> Self::Output {
3985 InverseLuminousFlux{per_lm: self.per_sr.clone() / rhs.cd}
3986 }
3987}
3988impl<T> core::ops::Div<&Luminosity<T>> for InverseSolidAngle<T> where T: NumLike {
3990 type Output = InverseLuminousFlux<T>;
3991 fn div(self, rhs: &Luminosity<T>) -> Self::Output {
3992 InverseLuminousFlux{per_lm: self.per_sr / rhs.cd.clone()}
3993 }
3994}
3995impl<T> core::ops::Div<&Luminosity<T>> for &InverseSolidAngle<T> where T: NumLike {
3997 type Output = InverseLuminousFlux<T>;
3998 fn div(self, rhs: &Luminosity<T>) -> Self::Output {
3999 InverseLuminousFlux{per_lm: self.per_sr.clone() / rhs.cd.clone()}
4000 }
4001}
4002
4003impl<T> core::ops::Div<InverseLuminousFlux<T>> for InverseSolidAngle<T> where T: NumLike {
4006 type Output = Luminosity<T>;
4007 fn div(self, rhs: InverseLuminousFlux<T>) -> Self::Output {
4008 Luminosity{cd: self.per_sr / rhs.per_lm}
4009 }
4010}
4011impl<T> core::ops::Div<InverseLuminousFlux<T>> for &InverseSolidAngle<T> where T: NumLike {
4013 type Output = Luminosity<T>;
4014 fn div(self, rhs: InverseLuminousFlux<T>) -> Self::Output {
4015 Luminosity{cd: self.per_sr.clone() / rhs.per_lm}
4016 }
4017}
4018impl<T> core::ops::Div<&InverseLuminousFlux<T>> for InverseSolidAngle<T> where T: NumLike {
4020 type Output = Luminosity<T>;
4021 fn div(self, rhs: &InverseLuminousFlux<T>) -> Self::Output {
4022 Luminosity{cd: self.per_sr / rhs.per_lm.clone()}
4023 }
4024}
4025impl<T> core::ops::Div<&InverseLuminousFlux<T>> for &InverseSolidAngle<T> where T: NumLike {
4027 type Output = Luminosity<T>;
4028 fn div(self, rhs: &InverseLuminousFlux<T>) -> Self::Output {
4029 Luminosity{cd: self.per_sr.clone() / rhs.per_lm.clone()}
4030 }
4031}
4032
4033impl<T> core::ops::Mul<LuminousFlux<T>> for InverseSolidAngle<T> where T: NumLike {
4036 type Output = Luminosity<T>;
4037 fn mul(self, rhs: LuminousFlux<T>) -> Self::Output {
4038 Luminosity{cd: self.per_sr * rhs.lm}
4039 }
4040}
4041impl<T> core::ops::Mul<LuminousFlux<T>> for &InverseSolidAngle<T> where T: NumLike {
4043 type Output = Luminosity<T>;
4044 fn mul(self, rhs: LuminousFlux<T>) -> Self::Output {
4045 Luminosity{cd: self.per_sr.clone() * rhs.lm}
4046 }
4047}
4048impl<T> core::ops::Mul<&LuminousFlux<T>> for InverseSolidAngle<T> where T: NumLike {
4050 type Output = Luminosity<T>;
4051 fn mul(self, rhs: &LuminousFlux<T>) -> Self::Output {
4052 Luminosity{cd: self.per_sr * rhs.lm.clone()}
4053 }
4054}
4055impl<T> core::ops::Mul<&LuminousFlux<T>> for &InverseSolidAngle<T> where T: NumLike {
4057 type Output = Luminosity<T>;
4058 fn mul(self, rhs: &LuminousFlux<T>) -> Self::Output {
4059 Luminosity{cd: self.per_sr.clone() * rhs.lm.clone()}
4060 }
4061}
4062
4063impl<T> core::ops::Mul<Angle<T>> for InverseSolidAngle<T> where T: NumLike {
4066 type Output = InverseAngle<T>;
4067 fn mul(self, rhs: Angle<T>) -> Self::Output {
4068 InverseAngle{per_rad: self.per_sr * rhs.rad}
4069 }
4070}
4071impl<T> core::ops::Mul<Angle<T>> for &InverseSolidAngle<T> where T: NumLike {
4073 type Output = InverseAngle<T>;
4074 fn mul(self, rhs: Angle<T>) -> Self::Output {
4075 InverseAngle{per_rad: self.per_sr.clone() * rhs.rad}
4076 }
4077}
4078impl<T> core::ops::Mul<&Angle<T>> for InverseSolidAngle<T> where T: NumLike {
4080 type Output = InverseAngle<T>;
4081 fn mul(self, rhs: &Angle<T>) -> Self::Output {
4082 InverseAngle{per_rad: self.per_sr * rhs.rad.clone()}
4083 }
4084}
4085impl<T> core::ops::Mul<&Angle<T>> for &InverseSolidAngle<T> where T: NumLike {
4087 type Output = InverseAngle<T>;
4088 fn mul(self, rhs: &Angle<T>) -> Self::Output {
4089 InverseAngle{per_rad: self.per_sr.clone() * rhs.rad.clone()}
4090 }
4091}
4092
4093impl<T> core::ops::Div<InverseAngle<T>> for InverseSolidAngle<T> where T: NumLike {
4096 type Output = InverseAngle<T>;
4097 fn div(self, rhs: InverseAngle<T>) -> Self::Output {
4098 InverseAngle{per_rad: self.per_sr / rhs.per_rad}
4099 }
4100}
4101impl<T> core::ops::Div<InverseAngle<T>> for &InverseSolidAngle<T> where T: NumLike {
4103 type Output = InverseAngle<T>;
4104 fn div(self, rhs: InverseAngle<T>) -> Self::Output {
4105 InverseAngle{per_rad: self.per_sr.clone() / rhs.per_rad}
4106 }
4107}
4108impl<T> core::ops::Div<&InverseAngle<T>> for InverseSolidAngle<T> where T: NumLike {
4110 type Output = InverseAngle<T>;
4111 fn div(self, rhs: &InverseAngle<T>) -> Self::Output {
4112 InverseAngle{per_rad: self.per_sr / rhs.per_rad.clone()}
4113 }
4114}
4115impl<T> core::ops::Div<&InverseAngle<T>> for &InverseSolidAngle<T> where T: NumLike {
4117 type Output = InverseAngle<T>;
4118 fn div(self, rhs: &InverseAngle<T>) -> Self::Output {
4119 InverseAngle{per_rad: self.per_sr.clone() / rhs.per_rad.clone()}
4120 }
4121}
4122
4123impl<T> core::ops::Div<InverseSolidAngle<T>> for f64 where T: NumLike+From<f64> {
4126 type Output = SolidAngle<T>;
4127 fn div(self, rhs: InverseSolidAngle<T>) -> Self::Output {
4128 SolidAngle{sr: T::from(self) / rhs.per_sr}
4129 }
4130}
4131impl<T> core::ops::Div<InverseSolidAngle<T>> for &f64 where T: NumLike+From<f64> {
4133 type Output = SolidAngle<T>;
4134 fn div(self, rhs: InverseSolidAngle<T>) -> Self::Output {
4135 SolidAngle{sr: T::from(self.clone()) / rhs.per_sr}
4136 }
4137}
4138impl<T> core::ops::Div<&InverseSolidAngle<T>> for f64 where T: NumLike+From<f64> {
4140 type Output = SolidAngle<T>;
4141 fn div(self, rhs: &InverseSolidAngle<T>) -> Self::Output {
4142 SolidAngle{sr: T::from(self) / rhs.per_sr.clone()}
4143 }
4144}
4145impl<T> core::ops::Div<&InverseSolidAngle<T>> for &f64 where T: NumLike+From<f64> {
4147 type Output = SolidAngle<T>;
4148 fn div(self, rhs: &InverseSolidAngle<T>) -> Self::Output {
4149 SolidAngle{sr: T::from(self.clone()) / rhs.per_sr.clone()}
4150 }
4151}
4152
4153impl<T> core::ops::Div<InverseSolidAngle<T>> for f32 where T: NumLike+From<f32> {
4156 type Output = SolidAngle<T>;
4157 fn div(self, rhs: InverseSolidAngle<T>) -> Self::Output {
4158 SolidAngle{sr: T::from(self) / rhs.per_sr}
4159 }
4160}
4161impl<T> core::ops::Div<InverseSolidAngle<T>> for &f32 where T: NumLike+From<f32> {
4163 type Output = SolidAngle<T>;
4164 fn div(self, rhs: InverseSolidAngle<T>) -> Self::Output {
4165 SolidAngle{sr: T::from(self.clone()) / rhs.per_sr}
4166 }
4167}
4168impl<T> core::ops::Div<&InverseSolidAngle<T>> for f32 where T: NumLike+From<f32> {
4170 type Output = SolidAngle<T>;
4171 fn div(self, rhs: &InverseSolidAngle<T>) -> Self::Output {
4172 SolidAngle{sr: T::from(self) / rhs.per_sr.clone()}
4173 }
4174}
4175impl<T> core::ops::Div<&InverseSolidAngle<T>> for &f32 where T: NumLike+From<f32> {
4177 type Output = SolidAngle<T>;
4178 fn div(self, rhs: &InverseSolidAngle<T>) -> Self::Output {
4179 SolidAngle{sr: T::from(self.clone()) / rhs.per_sr.clone()}
4180 }
4181}
4182
4183impl<T> core::ops::Div<InverseSolidAngle<T>> for i64 where T: NumLike+From<i64> {
4186 type Output = SolidAngle<T>;
4187 fn div(self, rhs: InverseSolidAngle<T>) -> Self::Output {
4188 SolidAngle{sr: T::from(self) / rhs.per_sr}
4189 }
4190}
4191impl<T> core::ops::Div<InverseSolidAngle<T>> for &i64 where T: NumLike+From<i64> {
4193 type Output = SolidAngle<T>;
4194 fn div(self, rhs: InverseSolidAngle<T>) -> Self::Output {
4195 SolidAngle{sr: T::from(self.clone()) / rhs.per_sr}
4196 }
4197}
4198impl<T> core::ops::Div<&InverseSolidAngle<T>> for i64 where T: NumLike+From<i64> {
4200 type Output = SolidAngle<T>;
4201 fn div(self, rhs: &InverseSolidAngle<T>) -> Self::Output {
4202 SolidAngle{sr: T::from(self) / rhs.per_sr.clone()}
4203 }
4204}
4205impl<T> core::ops::Div<&InverseSolidAngle<T>> for &i64 where T: NumLike+From<i64> {
4207 type Output = SolidAngle<T>;
4208 fn div(self, rhs: &InverseSolidAngle<T>) -> Self::Output {
4209 SolidAngle{sr: T::from(self.clone()) / rhs.per_sr.clone()}
4210 }
4211}
4212
4213impl<T> core::ops::Div<InverseSolidAngle<T>> for i32 where T: NumLike+From<i32> {
4216 type Output = SolidAngle<T>;
4217 fn div(self, rhs: InverseSolidAngle<T>) -> Self::Output {
4218 SolidAngle{sr: T::from(self) / rhs.per_sr}
4219 }
4220}
4221impl<T> core::ops::Div<InverseSolidAngle<T>> for &i32 where T: NumLike+From<i32> {
4223 type Output = SolidAngle<T>;
4224 fn div(self, rhs: InverseSolidAngle<T>) -> Self::Output {
4225 SolidAngle{sr: T::from(self.clone()) / rhs.per_sr}
4226 }
4227}
4228impl<T> core::ops::Div<&InverseSolidAngle<T>> for i32 where T: NumLike+From<i32> {
4230 type Output = SolidAngle<T>;
4231 fn div(self, rhs: &InverseSolidAngle<T>) -> Self::Output {
4232 SolidAngle{sr: T::from(self) / rhs.per_sr.clone()}
4233 }
4234}
4235impl<T> core::ops::Div<&InverseSolidAngle<T>> for &i32 where T: NumLike+From<i32> {
4237 type Output = SolidAngle<T>;
4238 fn div(self, rhs: &InverseSolidAngle<T>) -> Self::Output {
4239 SolidAngle{sr: T::from(self.clone()) / rhs.per_sr.clone()}
4240 }
4241}
4242
4243#[cfg(feature="num-bigfloat")]
4246impl<T> core::ops::Div<InverseSolidAngle<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
4247 type Output = SolidAngle<T>;
4248 fn div(self, rhs: InverseSolidAngle<T>) -> Self::Output {
4249 SolidAngle{sr: T::from(self) / rhs.per_sr}
4250 }
4251}
4252#[cfg(feature="num-bigfloat")]
4254impl<T> core::ops::Div<InverseSolidAngle<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
4255 type Output = SolidAngle<T>;
4256 fn div(self, rhs: InverseSolidAngle<T>) -> Self::Output {
4257 SolidAngle{sr: T::from(self.clone()) / rhs.per_sr}
4258 }
4259}
4260#[cfg(feature="num-bigfloat")]
4262impl<T> core::ops::Div<&InverseSolidAngle<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
4263 type Output = SolidAngle<T>;
4264 fn div(self, rhs: &InverseSolidAngle<T>) -> Self::Output {
4265 SolidAngle{sr: T::from(self) / rhs.per_sr.clone()}
4266 }
4267}
4268#[cfg(feature="num-bigfloat")]
4270impl<T> core::ops::Div<&InverseSolidAngle<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
4271 type Output = SolidAngle<T>;
4272 fn div(self, rhs: &InverseSolidAngle<T>) -> Self::Output {
4273 SolidAngle{sr: T::from(self.clone()) / rhs.per_sr.clone()}
4274 }
4275}
4276
4277#[cfg(feature="num-complex")]
4280impl<T> core::ops::Div<InverseSolidAngle<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
4281 type Output = SolidAngle<T>;
4282 fn div(self, rhs: InverseSolidAngle<T>) -> Self::Output {
4283 SolidAngle{sr: T::from(self) / rhs.per_sr}
4284 }
4285}
4286#[cfg(feature="num-complex")]
4288impl<T> core::ops::Div<InverseSolidAngle<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
4289 type Output = SolidAngle<T>;
4290 fn div(self, rhs: InverseSolidAngle<T>) -> Self::Output {
4291 SolidAngle{sr: T::from(self.clone()) / rhs.per_sr}
4292 }
4293}
4294#[cfg(feature="num-complex")]
4296impl<T> core::ops::Div<&InverseSolidAngle<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
4297 type Output = SolidAngle<T>;
4298 fn div(self, rhs: &InverseSolidAngle<T>) -> Self::Output {
4299 SolidAngle{sr: T::from(self) / rhs.per_sr.clone()}
4300 }
4301}
4302#[cfg(feature="num-complex")]
4304impl<T> core::ops::Div<&InverseSolidAngle<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
4305 type Output = SolidAngle<T>;
4306 fn div(self, rhs: &InverseSolidAngle<T>) -> Self::Output {
4307 SolidAngle{sr: T::from(self.clone()) / rhs.per_sr.clone()}
4308 }
4309}
4310
4311#[cfg(feature="num-complex")]
4314impl<T> core::ops::Div<InverseSolidAngle<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
4315 type Output = SolidAngle<T>;
4316 fn div(self, rhs: InverseSolidAngle<T>) -> Self::Output {
4317 SolidAngle{sr: T::from(self) / rhs.per_sr}
4318 }
4319}
4320#[cfg(feature="num-complex")]
4322impl<T> core::ops::Div<InverseSolidAngle<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
4323 type Output = SolidAngle<T>;
4324 fn div(self, rhs: InverseSolidAngle<T>) -> Self::Output {
4325 SolidAngle{sr: T::from(self.clone()) / rhs.per_sr}
4326 }
4327}
4328#[cfg(feature="num-complex")]
4330impl<T> core::ops::Div<&InverseSolidAngle<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
4331 type Output = SolidAngle<T>;
4332 fn div(self, rhs: &InverseSolidAngle<T>) -> Self::Output {
4333 SolidAngle{sr: T::from(self) / rhs.per_sr.clone()}
4334 }
4335}
4336#[cfg(feature="num-complex")]
4338impl<T> core::ops::Div<&InverseSolidAngle<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
4339 type Output = SolidAngle<T>;
4340 fn div(self, rhs: &InverseSolidAngle<T>) -> Self::Output {
4341 SolidAngle{sr: T::from(self.clone()) / rhs.per_sr.clone()}
4342 }
4343}
4344
4345#[derive(UnitStruct, Debug, Clone)]
4347#[cfg_attr(feature="serde", derive(Serialize, Deserialize))]
4348pub struct InverseVolume<T: NumLike>{
4349 pub per_m3: T
4351}
4352
4353impl<T> InverseVolume<T> where T: NumLike {
4354
4355 pub fn unit_name() -> &'static str { "inverse cubic meters" }
4357
4358 pub fn unit_symbol() -> &'static str { "1/m³" }
4360
4361 pub fn from_per_m3(per_m3: T) -> Self { InverseVolume{per_m3: per_m3} }
4366
4367 pub fn to_per_m3(&self) -> T { self.per_m3.clone() }
4369
4370 pub fn from_per_cubic_meter(per_cubic_meter: T) -> Self { InverseVolume{per_m3: per_cubic_meter} }
4375
4376 pub fn to_per_cubic_meter(&self) -> T { self.per_m3.clone() }
4378
4379 pub fn from_per_kL(per_kL: T) -> Self { InverseVolume{per_m3: per_kL} }
4384
4385 pub fn to_per_kL(&self) -> T { self.per_m3.clone() }
4387
4388}
4389
4390impl<T> fmt::Display for InverseVolume<T> where T: NumLike {
4391 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4392 write!(f, "{} {}", &self.per_m3, Self::unit_symbol())
4393 }
4394}
4395
4396impl<T> InverseVolume<T> where T: NumLike+From<f64> {
4397
4398 pub fn to_per_cc(&self) -> T {
4402 return self.per_m3.clone() * T::from(1e-06_f64);
4403 }
4404
4405 pub fn from_per_cc(per_cc: T) -> Self {
4412 InverseVolume{per_m3: per_cc * T::from(1000000.0_f64)}
4413 }
4414
4415 pub fn to_per_L(&self) -> T {
4419 return self.per_m3.clone() * T::from(0.001_f64);
4420 }
4421
4422 pub fn from_per_L(per_L: T) -> Self {
4429 InverseVolume{per_m3: per_L * T::from(1000.0_f64)}
4430 }
4431
4432 pub fn to_per_liters(&self) -> T {
4436 return self.per_m3.clone() * T::from(0.001_f64);
4437 }
4438
4439 pub fn from_per_liters(per_liters: T) -> Self {
4446 InverseVolume{per_m3: per_liters * T::from(1000.0_f64)}
4447 }
4448
4449 pub fn to_per_mL(&self) -> T {
4453 return self.per_m3.clone() * T::from(1e-06_f64);
4454 }
4455
4456 pub fn from_per_mL(per_mL: T) -> Self {
4463 InverseVolume{per_m3: per_mL * T::from(1000000.0_f64)}
4464 }
4465
4466 pub fn to_per_uL(&self) -> T {
4470 return self.per_m3.clone() * T::from(1e-09_f64);
4471 }
4472
4473 pub fn from_per_uL(per_uL: T) -> Self {
4480 InverseVolume{per_m3: per_uL * T::from(1000000000.0_f64)}
4481 }
4482
4483 pub fn to_per_nL(&self) -> T {
4487 return self.per_m3.clone() * T::from(1e-12_f64);
4488 }
4489
4490 pub fn from_per_nL(per_nL: T) -> Self {
4497 InverseVolume{per_m3: per_nL * T::from(1000000000000.0_f64)}
4498 }
4499
4500 pub fn to_per_pL(&self) -> T {
4504 return self.per_m3.clone() * T::from(1e-15_f64);
4505 }
4506
4507 pub fn from_per_pL(per_pL: T) -> Self {
4514 InverseVolume{per_m3: per_pL * T::from(1000000000000000.0_f64)}
4515 }
4516
4517 pub fn to_per_ML(&self) -> T {
4521 return self.per_m3.clone() * T::from(1000.0_f64);
4522 }
4523
4524 pub fn from_per_ML(per_ML: T) -> Self {
4531 InverseVolume{per_m3: per_ML * T::from(0.001_f64)}
4532 }
4533
4534 pub fn to_per_GL(&self) -> T {
4538 return self.per_m3.clone() * T::from(1000000.0_f64);
4539 }
4540
4541 pub fn from_per_GL(per_GL: T) -> Self {
4548 InverseVolume{per_m3: per_GL * T::from(1e-06_f64)}
4549 }
4550
4551}
4552
4553
4554#[cfg(feature="num-bigfloat")]
4556impl core::ops::Mul<InverseVolume<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
4557 type Output = InverseVolume<num_bigfloat::BigFloat>;
4558 fn mul(self, rhs: InverseVolume<num_bigfloat::BigFloat>) -> Self::Output {
4559 InverseVolume{per_m3: self * rhs.per_m3}
4560 }
4561}
4562#[cfg(feature="num-bigfloat")]
4564impl core::ops::Mul<InverseVolume<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
4565 type Output = InverseVolume<num_bigfloat::BigFloat>;
4566 fn mul(self, rhs: InverseVolume<num_bigfloat::BigFloat>) -> Self::Output {
4567 InverseVolume{per_m3: self.clone() * rhs.per_m3}
4568 }
4569}
4570#[cfg(feature="num-bigfloat")]
4572impl core::ops::Mul<&InverseVolume<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
4573 type Output = InverseVolume<num_bigfloat::BigFloat>;
4574 fn mul(self, rhs: &InverseVolume<num_bigfloat::BigFloat>) -> Self::Output {
4575 InverseVolume{per_m3: self * rhs.per_m3.clone()}
4576 }
4577}
4578#[cfg(feature="num-bigfloat")]
4580impl core::ops::Mul<&InverseVolume<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
4581 type Output = InverseVolume<num_bigfloat::BigFloat>;
4582 fn mul(self, rhs: &InverseVolume<num_bigfloat::BigFloat>) -> Self::Output {
4583 InverseVolume{per_m3: self.clone() * rhs.per_m3.clone()}
4584 }
4585}
4586
4587#[cfg(feature="num-complex")]
4589impl core::ops::Mul<InverseVolume<num_complex::Complex32>> for num_complex::Complex32 {
4590 type Output = InverseVolume<num_complex::Complex32>;
4591 fn mul(self, rhs: InverseVolume<num_complex::Complex32>) -> Self::Output {
4592 InverseVolume{per_m3: self * rhs.per_m3}
4593 }
4594}
4595#[cfg(feature="num-complex")]
4597impl core::ops::Mul<InverseVolume<num_complex::Complex32>> for &num_complex::Complex32 {
4598 type Output = InverseVolume<num_complex::Complex32>;
4599 fn mul(self, rhs: InverseVolume<num_complex::Complex32>) -> Self::Output {
4600 InverseVolume{per_m3: self.clone() * rhs.per_m3}
4601 }
4602}
4603#[cfg(feature="num-complex")]
4605impl core::ops::Mul<&InverseVolume<num_complex::Complex32>> for num_complex::Complex32 {
4606 type Output = InverseVolume<num_complex::Complex32>;
4607 fn mul(self, rhs: &InverseVolume<num_complex::Complex32>) -> Self::Output {
4608 InverseVolume{per_m3: self * rhs.per_m3.clone()}
4609 }
4610}
4611#[cfg(feature="num-complex")]
4613impl core::ops::Mul<&InverseVolume<num_complex::Complex32>> for &num_complex::Complex32 {
4614 type Output = InverseVolume<num_complex::Complex32>;
4615 fn mul(self, rhs: &InverseVolume<num_complex::Complex32>) -> Self::Output {
4616 InverseVolume{per_m3: self.clone() * rhs.per_m3.clone()}
4617 }
4618}
4619
4620#[cfg(feature="num-complex")]
4622impl core::ops::Mul<InverseVolume<num_complex::Complex64>> for num_complex::Complex64 {
4623 type Output = InverseVolume<num_complex::Complex64>;
4624 fn mul(self, rhs: InverseVolume<num_complex::Complex64>) -> Self::Output {
4625 InverseVolume{per_m3: self * rhs.per_m3}
4626 }
4627}
4628#[cfg(feature="num-complex")]
4630impl core::ops::Mul<InverseVolume<num_complex::Complex64>> for &num_complex::Complex64 {
4631 type Output = InverseVolume<num_complex::Complex64>;
4632 fn mul(self, rhs: InverseVolume<num_complex::Complex64>) -> Self::Output {
4633 InverseVolume{per_m3: self.clone() * rhs.per_m3}
4634 }
4635}
4636#[cfg(feature="num-complex")]
4638impl core::ops::Mul<&InverseVolume<num_complex::Complex64>> for num_complex::Complex64 {
4639 type Output = InverseVolume<num_complex::Complex64>;
4640 fn mul(self, rhs: &InverseVolume<num_complex::Complex64>) -> Self::Output {
4641 InverseVolume{per_m3: self * rhs.per_m3.clone()}
4642 }
4643}
4644#[cfg(feature="num-complex")]
4646impl core::ops::Mul<&InverseVolume<num_complex::Complex64>> for &num_complex::Complex64 {
4647 type Output = InverseVolume<num_complex::Complex64>;
4648 fn mul(self, rhs: &InverseVolume<num_complex::Complex64>) -> Self::Output {
4649 InverseVolume{per_m3: self.clone() * rhs.per_m3.clone()}
4650 }
4651}
4652
4653
4654
4655#[cfg(feature = "uom")]
4657impl<T> Into<uom::si::f32::VolumetricNumberDensity> for InverseVolume<T> where T: NumLike+Into<f32> {
4658 fn into(self) -> uom::si::f32::VolumetricNumberDensity {
4659 uom::si::f32::VolumetricNumberDensity::new::<uom::si::volumetric_number_density::per_cubic_meter>(self.per_m3.into())
4660 }
4661}
4662
4663#[cfg(feature = "uom")]
4665impl<T> From<uom::si::f32::VolumetricNumberDensity> for InverseVolume<T> where T: NumLike+From<f32> {
4666 fn from(src: uom::si::f32::VolumetricNumberDensity) -> Self {
4667 InverseVolume{per_m3: T::from(src.value)}
4668 }
4669}
4670
4671#[cfg(feature = "uom")]
4673impl<T> Into<uom::si::f64::VolumetricNumberDensity> for InverseVolume<T> where T: NumLike+Into<f64> {
4674 fn into(self) -> uom::si::f64::VolumetricNumberDensity {
4675 uom::si::f64::VolumetricNumberDensity::new::<uom::si::volumetric_number_density::per_cubic_meter>(self.per_m3.into())
4676 }
4677}
4678
4679#[cfg(feature = "uom")]
4681impl<T> From<uom::si::f64::VolumetricNumberDensity> for InverseVolume<T> where T: NumLike+From<f64> {
4682 fn from(src: uom::si::f64::VolumetricNumberDensity) -> Self {
4683 InverseVolume{per_m3: T::from(src.value)}
4684 }
4685}
4686
4687
4688impl<T> core::ops::Mul<Amount<T>> for InverseVolume<T> where T: NumLike {
4691 type Output = Concentration<T>;
4692 fn mul(self, rhs: Amount<T>) -> Self::Output {
4693 Concentration{molpm3: self.per_m3 * rhs.mol}
4694 }
4695}
4696impl<T> core::ops::Mul<Amount<T>> for &InverseVolume<T> where T: NumLike {
4698 type Output = Concentration<T>;
4699 fn mul(self, rhs: Amount<T>) -> Self::Output {
4700 Concentration{molpm3: self.per_m3.clone() * rhs.mol}
4701 }
4702}
4703impl<T> core::ops::Mul<&Amount<T>> for InverseVolume<T> where T: NumLike {
4705 type Output = Concentration<T>;
4706 fn mul(self, rhs: &Amount<T>) -> Self::Output {
4707 Concentration{molpm3: self.per_m3 * rhs.mol.clone()}
4708 }
4709}
4710impl<T> core::ops::Mul<&Amount<T>> for &InverseVolume<T> where T: NumLike {
4712 type Output = Concentration<T>;
4713 fn mul(self, rhs: &Amount<T>) -> Self::Output {
4714 Concentration{molpm3: self.per_m3.clone() * rhs.mol.clone()}
4715 }
4716}
4717
4718impl<T> core::ops::Mul<Distance<T>> for InverseVolume<T> where T: NumLike {
4721 type Output = InverseArea<T>;
4722 fn mul(self, rhs: Distance<T>) -> Self::Output {
4723 InverseArea{per_m2: self.per_m3 * rhs.m}
4724 }
4725}
4726impl<T> core::ops::Mul<Distance<T>> for &InverseVolume<T> where T: NumLike {
4728 type Output = InverseArea<T>;
4729 fn mul(self, rhs: Distance<T>) -> Self::Output {
4730 InverseArea{per_m2: self.per_m3.clone() * rhs.m}
4731 }
4732}
4733impl<T> core::ops::Mul<&Distance<T>> for InverseVolume<T> where T: NumLike {
4735 type Output = InverseArea<T>;
4736 fn mul(self, rhs: &Distance<T>) -> Self::Output {
4737 InverseArea{per_m2: self.per_m3 * rhs.m.clone()}
4738 }
4739}
4740impl<T> core::ops::Mul<&Distance<T>> for &InverseVolume<T> where T: NumLike {
4742 type Output = InverseArea<T>;
4743 fn mul(self, rhs: &Distance<T>) -> Self::Output {
4744 InverseArea{per_m2: self.per_m3.clone() * rhs.m.clone()}
4745 }
4746}
4747
4748impl<T> core::ops::Div<InverseAmount<T>> for InverseVolume<T> where T: NumLike {
4751 type Output = Concentration<T>;
4752 fn div(self, rhs: InverseAmount<T>) -> Self::Output {
4753 Concentration{molpm3: self.per_m3 / rhs.per_mol}
4754 }
4755}
4756impl<T> core::ops::Div<InverseAmount<T>> for &InverseVolume<T> where T: NumLike {
4758 type Output = Concentration<T>;
4759 fn div(self, rhs: InverseAmount<T>) -> Self::Output {
4760 Concentration{molpm3: self.per_m3.clone() / rhs.per_mol}
4761 }
4762}
4763impl<T> core::ops::Div<&InverseAmount<T>> for InverseVolume<T> where T: NumLike {
4765 type Output = Concentration<T>;
4766 fn div(self, rhs: &InverseAmount<T>) -> Self::Output {
4767 Concentration{molpm3: self.per_m3 / rhs.per_mol.clone()}
4768 }
4769}
4770impl<T> core::ops::Div<&InverseAmount<T>> for &InverseVolume<T> where T: NumLike {
4772 type Output = Concentration<T>;
4773 fn div(self, rhs: &InverseAmount<T>) -> Self::Output {
4774 Concentration{molpm3: self.per_m3.clone() / rhs.per_mol.clone()}
4775 }
4776}
4777
4778impl<T> core::ops::Div<InverseDistance<T>> for InverseVolume<T> where T: NumLike {
4781 type Output = InverseArea<T>;
4782 fn div(self, rhs: InverseDistance<T>) -> Self::Output {
4783 InverseArea{per_m2: self.per_m3 / rhs.per_m}
4784 }
4785}
4786impl<T> core::ops::Div<InverseDistance<T>> for &InverseVolume<T> where T: NumLike {
4788 type Output = InverseArea<T>;
4789 fn div(self, rhs: InverseDistance<T>) -> Self::Output {
4790 InverseArea{per_m2: self.per_m3.clone() / rhs.per_m}
4791 }
4792}
4793impl<T> core::ops::Div<&InverseDistance<T>> for InverseVolume<T> where T: NumLike {
4795 type Output = InverseArea<T>;
4796 fn div(self, rhs: &InverseDistance<T>) -> Self::Output {
4797 InverseArea{per_m2: self.per_m3 / rhs.per_m.clone()}
4798 }
4799}
4800impl<T> core::ops::Div<&InverseDistance<T>> for &InverseVolume<T> where T: NumLike {
4802 type Output = InverseArea<T>;
4803 fn div(self, rhs: &InverseDistance<T>) -> Self::Output {
4804 InverseArea{per_m2: self.per_m3.clone() / rhs.per_m.clone()}
4805 }
4806}
4807
4808impl<T> core::ops::Div<InverseMass<T>> for InverseVolume<T> where T: NumLike {
4811 type Output = Density<T>;
4812 fn div(self, rhs: InverseMass<T>) -> Self::Output {
4813 Density{kgpm3: self.per_m3 / rhs.per_kg}
4814 }
4815}
4816impl<T> core::ops::Div<InverseMass<T>> for &InverseVolume<T> where T: NumLike {
4818 type Output = Density<T>;
4819 fn div(self, rhs: InverseMass<T>) -> Self::Output {
4820 Density{kgpm3: self.per_m3.clone() / rhs.per_kg}
4821 }
4822}
4823impl<T> core::ops::Div<&InverseMass<T>> for InverseVolume<T> where T: NumLike {
4825 type Output = Density<T>;
4826 fn div(self, rhs: &InverseMass<T>) -> Self::Output {
4827 Density{kgpm3: self.per_m3 / rhs.per_kg.clone()}
4828 }
4829}
4830impl<T> core::ops::Div<&InverseMass<T>> for &InverseVolume<T> where T: NumLike {
4832 type Output = Density<T>;
4833 fn div(self, rhs: &InverseMass<T>) -> Self::Output {
4834 Density{kgpm3: self.per_m3.clone() / rhs.per_kg.clone()}
4835 }
4836}
4837
4838impl<T> core::ops::Mul<Mass<T>> for InverseVolume<T> where T: NumLike {
4841 type Output = Density<T>;
4842 fn mul(self, rhs: Mass<T>) -> Self::Output {
4843 Density{kgpm3: self.per_m3 * rhs.kg}
4844 }
4845}
4846impl<T> core::ops::Mul<Mass<T>> for &InverseVolume<T> where T: NumLike {
4848 type Output = Density<T>;
4849 fn mul(self, rhs: Mass<T>) -> Self::Output {
4850 Density{kgpm3: self.per_m3.clone() * rhs.kg}
4851 }
4852}
4853impl<T> core::ops::Mul<&Mass<T>> for InverseVolume<T> where T: NumLike {
4855 type Output = Density<T>;
4856 fn mul(self, rhs: &Mass<T>) -> Self::Output {
4857 Density{kgpm3: self.per_m3 * rhs.kg.clone()}
4858 }
4859}
4860impl<T> core::ops::Mul<&Mass<T>> for &InverseVolume<T> where T: NumLike {
4862 type Output = Density<T>;
4863 fn mul(self, rhs: &Mass<T>) -> Self::Output {
4864 Density{kgpm3: self.per_m3.clone() * rhs.kg.clone()}
4865 }
4866}
4867
4868impl<T> core::ops::Div<Concentration<T>> for InverseVolume<T> where T: NumLike {
4871 type Output = InverseAmount<T>;
4872 fn div(self, rhs: Concentration<T>) -> Self::Output {
4873 InverseAmount{per_mol: self.per_m3 / rhs.molpm3}
4874 }
4875}
4876impl<T> core::ops::Div<Concentration<T>> for &InverseVolume<T> where T: NumLike {
4878 type Output = InverseAmount<T>;
4879 fn div(self, rhs: Concentration<T>) -> Self::Output {
4880 InverseAmount{per_mol: self.per_m3.clone() / rhs.molpm3}
4881 }
4882}
4883impl<T> core::ops::Div<&Concentration<T>> for InverseVolume<T> where T: NumLike {
4885 type Output = InverseAmount<T>;
4886 fn div(self, rhs: &Concentration<T>) -> Self::Output {
4887 InverseAmount{per_mol: self.per_m3 / rhs.molpm3.clone()}
4888 }
4889}
4890impl<T> core::ops::Div<&Concentration<T>> for &InverseVolume<T> where T: NumLike {
4892 type Output = InverseAmount<T>;
4893 fn div(self, rhs: &Concentration<T>) -> Self::Output {
4894 InverseAmount{per_mol: self.per_m3.clone() / rhs.molpm3.clone()}
4895 }
4896}
4897
4898impl<T> core::ops::Mul<MolarVolume<T>> for InverseVolume<T> where T: NumLike {
4901 type Output = InverseAmount<T>;
4902 fn mul(self, rhs: MolarVolume<T>) -> Self::Output {
4903 InverseAmount{per_mol: self.per_m3 * rhs.m3_per_mol}
4904 }
4905}
4906impl<T> core::ops::Mul<MolarVolume<T>> for &InverseVolume<T> where T: NumLike {
4908 type Output = InverseAmount<T>;
4909 fn mul(self, rhs: MolarVolume<T>) -> Self::Output {
4910 InverseAmount{per_mol: self.per_m3.clone() * rhs.m3_per_mol}
4911 }
4912}
4913impl<T> core::ops::Mul<&MolarVolume<T>> for InverseVolume<T> where T: NumLike {
4915 type Output = InverseAmount<T>;
4916 fn mul(self, rhs: &MolarVolume<T>) -> Self::Output {
4917 InverseAmount{per_mol: self.per_m3 * rhs.m3_per_mol.clone()}
4918 }
4919}
4920impl<T> core::ops::Mul<&MolarVolume<T>> for &InverseVolume<T> where T: NumLike {
4922 type Output = InverseAmount<T>;
4923 fn mul(self, rhs: &MolarVolume<T>) -> Self::Output {
4924 InverseAmount{per_mol: self.per_m3.clone() * rhs.m3_per_mol.clone()}
4925 }
4926}
4927
4928impl<T> core::ops::Mul<Area<T>> for InverseVolume<T> where T: NumLike {
4931 type Output = InverseDistance<T>;
4932 fn mul(self, rhs: Area<T>) -> Self::Output {
4933 InverseDistance{per_m: self.per_m3 * rhs.m2}
4934 }
4935}
4936impl<T> core::ops::Mul<Area<T>> for &InverseVolume<T> where T: NumLike {
4938 type Output = InverseDistance<T>;
4939 fn mul(self, rhs: Area<T>) -> Self::Output {
4940 InverseDistance{per_m: self.per_m3.clone() * rhs.m2}
4941 }
4942}
4943impl<T> core::ops::Mul<&Area<T>> for InverseVolume<T> where T: NumLike {
4945 type Output = InverseDistance<T>;
4946 fn mul(self, rhs: &Area<T>) -> Self::Output {
4947 InverseDistance{per_m: self.per_m3 * rhs.m2.clone()}
4948 }
4949}
4950impl<T> core::ops::Mul<&Area<T>> for &InverseVolume<T> where T: NumLike {
4952 type Output = InverseDistance<T>;
4953 fn mul(self, rhs: &Area<T>) -> Self::Output {
4954 InverseDistance{per_m: self.per_m3.clone() * rhs.m2.clone()}
4955 }
4956}
4957
4958impl<T> core::ops::Div<InverseArea<T>> for InverseVolume<T> where T: NumLike {
4961 type Output = InverseDistance<T>;
4962 fn div(self, rhs: InverseArea<T>) -> Self::Output {
4963 InverseDistance{per_m: self.per_m3 / rhs.per_m2}
4964 }
4965}
4966impl<T> core::ops::Div<InverseArea<T>> for &InverseVolume<T> where T: NumLike {
4968 type Output = InverseDistance<T>;
4969 fn div(self, rhs: InverseArea<T>) -> Self::Output {
4970 InverseDistance{per_m: self.per_m3.clone() / rhs.per_m2}
4971 }
4972}
4973impl<T> core::ops::Div<&InverseArea<T>> for InverseVolume<T> where T: NumLike {
4975 type Output = InverseDistance<T>;
4976 fn div(self, rhs: &InverseArea<T>) -> Self::Output {
4977 InverseDistance{per_m: self.per_m3 / rhs.per_m2.clone()}
4978 }
4979}
4980impl<T> core::ops::Div<&InverseArea<T>> for &InverseVolume<T> where T: NumLike {
4982 type Output = InverseDistance<T>;
4983 fn div(self, rhs: &InverseArea<T>) -> Self::Output {
4984 InverseDistance{per_m: self.per_m3.clone() / rhs.per_m2.clone()}
4985 }
4986}
4987
4988impl<T> core::ops::Div<Density<T>> for InverseVolume<T> where T: NumLike {
4991 type Output = InverseMass<T>;
4992 fn div(self, rhs: Density<T>) -> Self::Output {
4993 InverseMass{per_kg: self.per_m3 / rhs.kgpm3}
4994 }
4995}
4996impl<T> core::ops::Div<Density<T>> for &InverseVolume<T> where T: NumLike {
4998 type Output = InverseMass<T>;
4999 fn div(self, rhs: Density<T>) -> Self::Output {
5000 InverseMass{per_kg: self.per_m3.clone() / rhs.kgpm3}
5001 }
5002}
5003impl<T> core::ops::Div<&Density<T>> for InverseVolume<T> where T: NumLike {
5005 type Output = InverseMass<T>;
5006 fn div(self, rhs: &Density<T>) -> Self::Output {
5007 InverseMass{per_kg: self.per_m3 / rhs.kgpm3.clone()}
5008 }
5009}
5010impl<T> core::ops::Div<&Density<T>> for &InverseVolume<T> where T: NumLike {
5012 type Output = InverseMass<T>;
5013 fn div(self, rhs: &Density<T>) -> Self::Output {
5014 InverseMass{per_kg: self.per_m3.clone() / rhs.kgpm3.clone()}
5015 }
5016}
5017
5018impl<T> core::ops::Mul<Energy<T>> for InverseVolume<T> where T: NumLike {
5021 type Output = Pressure<T>;
5022 fn mul(self, rhs: Energy<T>) -> Self::Output {
5023 Pressure{Pa: self.per_m3 * rhs.J}
5024 }
5025}
5026impl<T> core::ops::Mul<Energy<T>> for &InverseVolume<T> where T: NumLike {
5028 type Output = Pressure<T>;
5029 fn mul(self, rhs: Energy<T>) -> Self::Output {
5030 Pressure{Pa: self.per_m3.clone() * rhs.J}
5031 }
5032}
5033impl<T> core::ops::Mul<&Energy<T>> for InverseVolume<T> where T: NumLike {
5035 type Output = Pressure<T>;
5036 fn mul(self, rhs: &Energy<T>) -> Self::Output {
5037 Pressure{Pa: self.per_m3 * rhs.J.clone()}
5038 }
5039}
5040impl<T> core::ops::Mul<&Energy<T>> for &InverseVolume<T> where T: NumLike {
5042 type Output = Pressure<T>;
5043 fn mul(self, rhs: &Energy<T>) -> Self::Output {
5044 Pressure{Pa: self.per_m3.clone() * rhs.J.clone()}
5045 }
5046}
5047
5048impl<T> core::ops::Mul<Torque<T>> for InverseVolume<T> where T: NumLike {
5051 type Output = Pressure<T>;
5052 fn mul(self, rhs: Torque<T>) -> Self::Output {
5053 Pressure{Pa: self.per_m3 * rhs.Nm}
5054 }
5055}
5056impl<T> core::ops::Mul<Torque<T>> for &InverseVolume<T> where T: NumLike {
5058 type Output = Pressure<T>;
5059 fn mul(self, rhs: Torque<T>) -> Self::Output {
5060 Pressure{Pa: self.per_m3.clone() * rhs.Nm}
5061 }
5062}
5063impl<T> core::ops::Mul<&Torque<T>> for InverseVolume<T> where T: NumLike {
5065 type Output = Pressure<T>;
5066 fn mul(self, rhs: &Torque<T>) -> Self::Output {
5067 Pressure{Pa: self.per_m3 * rhs.Nm.clone()}
5068 }
5069}
5070impl<T> core::ops::Mul<&Torque<T>> for &InverseVolume<T> where T: NumLike {
5072 type Output = Pressure<T>;
5073 fn mul(self, rhs: &Torque<T>) -> Self::Output {
5074 Pressure{Pa: self.per_m3.clone() * rhs.Nm.clone()}
5075 }
5076}
5077
5078impl<T> core::ops::Div<InverseEnergy<T>> for InverseVolume<T> where T: NumLike {
5081 type Output = Pressure<T>;
5082 fn div(self, rhs: InverseEnergy<T>) -> Self::Output {
5083 Pressure{Pa: self.per_m3 / rhs.per_J}
5084 }
5085}
5086impl<T> core::ops::Div<InverseEnergy<T>> for &InverseVolume<T> where T: NumLike {
5088 type Output = Pressure<T>;
5089 fn div(self, rhs: InverseEnergy<T>) -> Self::Output {
5090 Pressure{Pa: self.per_m3.clone() / rhs.per_J}
5091 }
5092}
5093impl<T> core::ops::Div<&InverseEnergy<T>> for InverseVolume<T> where T: NumLike {
5095 type Output = Pressure<T>;
5096 fn div(self, rhs: &InverseEnergy<T>) -> Self::Output {
5097 Pressure{Pa: self.per_m3 / rhs.per_J.clone()}
5098 }
5099}
5100impl<T> core::ops::Div<&InverseEnergy<T>> for &InverseVolume<T> where T: NumLike {
5102 type Output = Pressure<T>;
5103 fn div(self, rhs: &InverseEnergy<T>) -> Self::Output {
5104 Pressure{Pa: self.per_m3.clone() / rhs.per_J.clone()}
5105 }
5106}
5107
5108impl<T> core::ops::Div<InverseTorque<T>> for InverseVolume<T> where T: NumLike {
5111 type Output = Pressure<T>;
5112 fn div(self, rhs: InverseTorque<T>) -> Self::Output {
5113 Pressure{Pa: self.per_m3 / rhs.per_Nm}
5114 }
5115}
5116impl<T> core::ops::Div<InverseTorque<T>> for &InverseVolume<T> where T: NumLike {
5118 type Output = Pressure<T>;
5119 fn div(self, rhs: InverseTorque<T>) -> Self::Output {
5120 Pressure{Pa: self.per_m3.clone() / rhs.per_Nm}
5121 }
5122}
5123impl<T> core::ops::Div<&InverseTorque<T>> for InverseVolume<T> where T: NumLike {
5125 type Output = Pressure<T>;
5126 fn div(self, rhs: &InverseTorque<T>) -> Self::Output {
5127 Pressure{Pa: self.per_m3 / rhs.per_Nm.clone()}
5128 }
5129}
5130impl<T> core::ops::Div<&InverseTorque<T>> for &InverseVolume<T> where T: NumLike {
5132 type Output = Pressure<T>;
5133 fn div(self, rhs: &InverseTorque<T>) -> Self::Output {
5134 Pressure{Pa: self.per_m3.clone() / rhs.per_Nm.clone()}
5135 }
5136}
5137
5138impl<T> core::ops::Mul<InversePressure<T>> for InverseVolume<T> where T: NumLike {
5141 type Output = InverseEnergy<T>;
5142 fn mul(self, rhs: InversePressure<T>) -> Self::Output {
5143 InverseEnergy{per_J: self.per_m3 * rhs.per_Pa}
5144 }
5145}
5146impl<T> core::ops::Mul<InversePressure<T>> for &InverseVolume<T> where T: NumLike {
5148 type Output = InverseEnergy<T>;
5149 fn mul(self, rhs: InversePressure<T>) -> Self::Output {
5150 InverseEnergy{per_J: self.per_m3.clone() * rhs.per_Pa}
5151 }
5152}
5153impl<T> core::ops::Mul<&InversePressure<T>> for InverseVolume<T> where T: NumLike {
5155 type Output = InverseEnergy<T>;
5156 fn mul(self, rhs: &InversePressure<T>) -> Self::Output {
5157 InverseEnergy{per_J: self.per_m3 * rhs.per_Pa.clone()}
5158 }
5159}
5160impl<T> core::ops::Mul<&InversePressure<T>> for &InverseVolume<T> where T: NumLike {
5162 type Output = InverseEnergy<T>;
5163 fn mul(self, rhs: &InversePressure<T>) -> Self::Output {
5164 InverseEnergy{per_J: self.per_m3.clone() * rhs.per_Pa.clone()}
5165 }
5166}
5167
5168impl<T> core::ops::Div<Pressure<T>> for InverseVolume<T> where T: NumLike {
5171 type Output = InverseEnergy<T>;
5172 fn div(self, rhs: Pressure<T>) -> Self::Output {
5173 InverseEnergy{per_J: self.per_m3 / rhs.Pa}
5174 }
5175}
5176impl<T> core::ops::Div<Pressure<T>> for &InverseVolume<T> where T: NumLike {
5178 type Output = InverseEnergy<T>;
5179 fn div(self, rhs: Pressure<T>) -> Self::Output {
5180 InverseEnergy{per_J: self.per_m3.clone() / rhs.Pa}
5181 }
5182}
5183impl<T> core::ops::Div<&Pressure<T>> for InverseVolume<T> where T: NumLike {
5185 type Output = InverseEnergy<T>;
5186 fn div(self, rhs: &Pressure<T>) -> Self::Output {
5187 InverseEnergy{per_J: self.per_m3 / rhs.Pa.clone()}
5188 }
5189}
5190impl<T> core::ops::Div<&Pressure<T>> for &InverseVolume<T> where T: NumLike {
5192 type Output = InverseEnergy<T>;
5193 fn div(self, rhs: &Pressure<T>) -> Self::Output {
5194 InverseEnergy{per_J: self.per_m3.clone() / rhs.Pa.clone()}
5195 }
5196}
5197
5198impl<T> core::ops::Mul<VolumePerMass<T>> for InverseVolume<T> where T: NumLike {
5201 type Output = InverseMass<T>;
5202 fn mul(self, rhs: VolumePerMass<T>) -> Self::Output {
5203 InverseMass{per_kg: self.per_m3 * rhs.m3_per_kg}
5204 }
5205}
5206impl<T> core::ops::Mul<VolumePerMass<T>> for &InverseVolume<T> where T: NumLike {
5208 type Output = InverseMass<T>;
5209 fn mul(self, rhs: VolumePerMass<T>) -> Self::Output {
5210 InverseMass{per_kg: self.per_m3.clone() * rhs.m3_per_kg}
5211 }
5212}
5213impl<T> core::ops::Mul<&VolumePerMass<T>> for InverseVolume<T> where T: NumLike {
5215 type Output = InverseMass<T>;
5216 fn mul(self, rhs: &VolumePerMass<T>) -> Self::Output {
5217 InverseMass{per_kg: self.per_m3 * rhs.m3_per_kg.clone()}
5218 }
5219}
5220impl<T> core::ops::Mul<&VolumePerMass<T>> for &InverseVolume<T> where T: NumLike {
5222 type Output = InverseMass<T>;
5223 fn mul(self, rhs: &VolumePerMass<T>) -> Self::Output {
5224 InverseMass{per_kg: self.per_m3.clone() * rhs.m3_per_kg.clone()}
5225 }
5226}
5227
5228impl<T> core::ops::Div<InverseVolume<T>> for f64 where T: NumLike+From<f64> {
5231 type Output = Volume<T>;
5232 fn div(self, rhs: InverseVolume<T>) -> Self::Output {
5233 Volume{m3: T::from(self) / rhs.per_m3}
5234 }
5235}
5236impl<T> core::ops::Div<InverseVolume<T>> for &f64 where T: NumLike+From<f64> {
5238 type Output = Volume<T>;
5239 fn div(self, rhs: InverseVolume<T>) -> Self::Output {
5240 Volume{m3: T::from(self.clone()) / rhs.per_m3}
5241 }
5242}
5243impl<T> core::ops::Div<&InverseVolume<T>> for f64 where T: NumLike+From<f64> {
5245 type Output = Volume<T>;
5246 fn div(self, rhs: &InverseVolume<T>) -> Self::Output {
5247 Volume{m3: T::from(self) / rhs.per_m3.clone()}
5248 }
5249}
5250impl<T> core::ops::Div<&InverseVolume<T>> for &f64 where T: NumLike+From<f64> {
5252 type Output = Volume<T>;
5253 fn div(self, rhs: &InverseVolume<T>) -> Self::Output {
5254 Volume{m3: T::from(self.clone()) / rhs.per_m3.clone()}
5255 }
5256}
5257
5258impl<T> core::ops::Div<InverseVolume<T>> for f32 where T: NumLike+From<f32> {
5261 type Output = Volume<T>;
5262 fn div(self, rhs: InverseVolume<T>) -> Self::Output {
5263 Volume{m3: T::from(self) / rhs.per_m3}
5264 }
5265}
5266impl<T> core::ops::Div<InverseVolume<T>> for &f32 where T: NumLike+From<f32> {
5268 type Output = Volume<T>;
5269 fn div(self, rhs: InverseVolume<T>) -> Self::Output {
5270 Volume{m3: T::from(self.clone()) / rhs.per_m3}
5271 }
5272}
5273impl<T> core::ops::Div<&InverseVolume<T>> for f32 where T: NumLike+From<f32> {
5275 type Output = Volume<T>;
5276 fn div(self, rhs: &InverseVolume<T>) -> Self::Output {
5277 Volume{m3: T::from(self) / rhs.per_m3.clone()}
5278 }
5279}
5280impl<T> core::ops::Div<&InverseVolume<T>> for &f32 where T: NumLike+From<f32> {
5282 type Output = Volume<T>;
5283 fn div(self, rhs: &InverseVolume<T>) -> Self::Output {
5284 Volume{m3: T::from(self.clone()) / rhs.per_m3.clone()}
5285 }
5286}
5287
5288impl<T> core::ops::Div<InverseVolume<T>> for i64 where T: NumLike+From<i64> {
5291 type Output = Volume<T>;
5292 fn div(self, rhs: InverseVolume<T>) -> Self::Output {
5293 Volume{m3: T::from(self) / rhs.per_m3}
5294 }
5295}
5296impl<T> core::ops::Div<InverseVolume<T>> for &i64 where T: NumLike+From<i64> {
5298 type Output = Volume<T>;
5299 fn div(self, rhs: InverseVolume<T>) -> Self::Output {
5300 Volume{m3: T::from(self.clone()) / rhs.per_m3}
5301 }
5302}
5303impl<T> core::ops::Div<&InverseVolume<T>> for i64 where T: NumLike+From<i64> {
5305 type Output = Volume<T>;
5306 fn div(self, rhs: &InverseVolume<T>) -> Self::Output {
5307 Volume{m3: T::from(self) / rhs.per_m3.clone()}
5308 }
5309}
5310impl<T> core::ops::Div<&InverseVolume<T>> for &i64 where T: NumLike+From<i64> {
5312 type Output = Volume<T>;
5313 fn div(self, rhs: &InverseVolume<T>) -> Self::Output {
5314 Volume{m3: T::from(self.clone()) / rhs.per_m3.clone()}
5315 }
5316}
5317
5318impl<T> core::ops::Div<InverseVolume<T>> for i32 where T: NumLike+From<i32> {
5321 type Output = Volume<T>;
5322 fn div(self, rhs: InverseVolume<T>) -> Self::Output {
5323 Volume{m3: T::from(self) / rhs.per_m3}
5324 }
5325}
5326impl<T> core::ops::Div<InverseVolume<T>> for &i32 where T: NumLike+From<i32> {
5328 type Output = Volume<T>;
5329 fn div(self, rhs: InverseVolume<T>) -> Self::Output {
5330 Volume{m3: T::from(self.clone()) / rhs.per_m3}
5331 }
5332}
5333impl<T> core::ops::Div<&InverseVolume<T>> for i32 where T: NumLike+From<i32> {
5335 type Output = Volume<T>;
5336 fn div(self, rhs: &InverseVolume<T>) -> Self::Output {
5337 Volume{m3: T::from(self) / rhs.per_m3.clone()}
5338 }
5339}
5340impl<T> core::ops::Div<&InverseVolume<T>> for &i32 where T: NumLike+From<i32> {
5342 type Output = Volume<T>;
5343 fn div(self, rhs: &InverseVolume<T>) -> Self::Output {
5344 Volume{m3: T::from(self.clone()) / rhs.per_m3.clone()}
5345 }
5346}
5347
5348#[cfg(feature="num-bigfloat")]
5351impl<T> core::ops::Div<InverseVolume<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
5352 type Output = Volume<T>;
5353 fn div(self, rhs: InverseVolume<T>) -> Self::Output {
5354 Volume{m3: T::from(self) / rhs.per_m3}
5355 }
5356}
5357#[cfg(feature="num-bigfloat")]
5359impl<T> core::ops::Div<InverseVolume<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
5360 type Output = Volume<T>;
5361 fn div(self, rhs: InverseVolume<T>) -> Self::Output {
5362 Volume{m3: T::from(self.clone()) / rhs.per_m3}
5363 }
5364}
5365#[cfg(feature="num-bigfloat")]
5367impl<T> core::ops::Div<&InverseVolume<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
5368 type Output = Volume<T>;
5369 fn div(self, rhs: &InverseVolume<T>) -> Self::Output {
5370 Volume{m3: T::from(self) / rhs.per_m3.clone()}
5371 }
5372}
5373#[cfg(feature="num-bigfloat")]
5375impl<T> core::ops::Div<&InverseVolume<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
5376 type Output = Volume<T>;
5377 fn div(self, rhs: &InverseVolume<T>) -> Self::Output {
5378 Volume{m3: T::from(self.clone()) / rhs.per_m3.clone()}
5379 }
5380}
5381
5382#[cfg(feature="num-complex")]
5385impl<T> core::ops::Div<InverseVolume<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
5386 type Output = Volume<T>;
5387 fn div(self, rhs: InverseVolume<T>) -> Self::Output {
5388 Volume{m3: T::from(self) / rhs.per_m3}
5389 }
5390}
5391#[cfg(feature="num-complex")]
5393impl<T> core::ops::Div<InverseVolume<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
5394 type Output = Volume<T>;
5395 fn div(self, rhs: InverseVolume<T>) -> Self::Output {
5396 Volume{m3: T::from(self.clone()) / rhs.per_m3}
5397 }
5398}
5399#[cfg(feature="num-complex")]
5401impl<T> core::ops::Div<&InverseVolume<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
5402 type Output = Volume<T>;
5403 fn div(self, rhs: &InverseVolume<T>) -> Self::Output {
5404 Volume{m3: T::from(self) / rhs.per_m3.clone()}
5405 }
5406}
5407#[cfg(feature="num-complex")]
5409impl<T> core::ops::Div<&InverseVolume<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
5410 type Output = Volume<T>;
5411 fn div(self, rhs: &InverseVolume<T>) -> Self::Output {
5412 Volume{m3: T::from(self.clone()) / rhs.per_m3.clone()}
5413 }
5414}
5415
5416#[cfg(feature="num-complex")]
5419impl<T> core::ops::Div<InverseVolume<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
5420 type Output = Volume<T>;
5421 fn div(self, rhs: InverseVolume<T>) -> Self::Output {
5422 Volume{m3: T::from(self) / rhs.per_m3}
5423 }
5424}
5425#[cfg(feature="num-complex")]
5427impl<T> core::ops::Div<InverseVolume<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
5428 type Output = Volume<T>;
5429 fn div(self, rhs: InverseVolume<T>) -> Self::Output {
5430 Volume{m3: T::from(self.clone()) / rhs.per_m3}
5431 }
5432}
5433#[cfg(feature="num-complex")]
5435impl<T> core::ops::Div<&InverseVolume<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
5436 type Output = Volume<T>;
5437 fn div(self, rhs: &InverseVolume<T>) -> Self::Output {
5438 Volume{m3: T::from(self) / rhs.per_m3.clone()}
5439 }
5440}
5441#[cfg(feature="num-complex")]
5443impl<T> core::ops::Div<&InverseVolume<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
5444 type Output = Volume<T>;
5445 fn div(self, rhs: &InverseVolume<T>) -> Self::Output {
5446 Volume{m3: T::from(self.clone()) / rhs.per_m3.clone()}
5447 }
5448}
5449
5450#[derive(UnitStruct, Debug, Clone)]
5452#[cfg_attr(feature="serde", derive(Serialize, Deserialize))]
5453pub struct SolidAngle<T: NumLike>{
5454 pub sr: T
5456}
5457
5458impl<T> SolidAngle<T> where T: NumLike {
5459
5460 pub fn unit_name() -> &'static str { "steradian" }
5462
5463 pub fn unit_symbol() -> &'static str { "sr" }
5465
5466 pub fn from_sr(sr: T) -> Self { SolidAngle{sr: sr} }
5471
5472 pub fn to_sr(&self) -> T { self.sr.clone() }
5474
5475 pub fn from_steradians(steradians: T) -> Self { SolidAngle{sr: steradians} }
5480
5481 pub fn to_steradians(&self) -> T { self.sr.clone() }
5483
5484}
5485
5486impl<T> fmt::Display for SolidAngle<T> where T: NumLike {
5487 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5488 write!(f, "{} {}", &self.sr, Self::unit_symbol())
5489 }
5490}
5491
5492impl<T> SolidAngle<T> where T: NumLike+From<f64> {
5493
5494}
5495
5496
5497#[cfg(feature="num-bigfloat")]
5499impl core::ops::Mul<SolidAngle<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
5500 type Output = SolidAngle<num_bigfloat::BigFloat>;
5501 fn mul(self, rhs: SolidAngle<num_bigfloat::BigFloat>) -> Self::Output {
5502 SolidAngle{sr: self * rhs.sr}
5503 }
5504}
5505#[cfg(feature="num-bigfloat")]
5507impl core::ops::Mul<SolidAngle<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
5508 type Output = SolidAngle<num_bigfloat::BigFloat>;
5509 fn mul(self, rhs: SolidAngle<num_bigfloat::BigFloat>) -> Self::Output {
5510 SolidAngle{sr: self.clone() * rhs.sr}
5511 }
5512}
5513#[cfg(feature="num-bigfloat")]
5515impl core::ops::Mul<&SolidAngle<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
5516 type Output = SolidAngle<num_bigfloat::BigFloat>;
5517 fn mul(self, rhs: &SolidAngle<num_bigfloat::BigFloat>) -> Self::Output {
5518 SolidAngle{sr: self * rhs.sr.clone()}
5519 }
5520}
5521#[cfg(feature="num-bigfloat")]
5523impl core::ops::Mul<&SolidAngle<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
5524 type Output = SolidAngle<num_bigfloat::BigFloat>;
5525 fn mul(self, rhs: &SolidAngle<num_bigfloat::BigFloat>) -> Self::Output {
5526 SolidAngle{sr: self.clone() * rhs.sr.clone()}
5527 }
5528}
5529
5530#[cfg(feature="num-complex")]
5532impl core::ops::Mul<SolidAngle<num_complex::Complex32>> for num_complex::Complex32 {
5533 type Output = SolidAngle<num_complex::Complex32>;
5534 fn mul(self, rhs: SolidAngle<num_complex::Complex32>) -> Self::Output {
5535 SolidAngle{sr: self * rhs.sr}
5536 }
5537}
5538#[cfg(feature="num-complex")]
5540impl core::ops::Mul<SolidAngle<num_complex::Complex32>> for &num_complex::Complex32 {
5541 type Output = SolidAngle<num_complex::Complex32>;
5542 fn mul(self, rhs: SolidAngle<num_complex::Complex32>) -> Self::Output {
5543 SolidAngle{sr: self.clone() * rhs.sr}
5544 }
5545}
5546#[cfg(feature="num-complex")]
5548impl core::ops::Mul<&SolidAngle<num_complex::Complex32>> for num_complex::Complex32 {
5549 type Output = SolidAngle<num_complex::Complex32>;
5550 fn mul(self, rhs: &SolidAngle<num_complex::Complex32>) -> Self::Output {
5551 SolidAngle{sr: self * rhs.sr.clone()}
5552 }
5553}
5554#[cfg(feature="num-complex")]
5556impl core::ops::Mul<&SolidAngle<num_complex::Complex32>> for &num_complex::Complex32 {
5557 type Output = SolidAngle<num_complex::Complex32>;
5558 fn mul(self, rhs: &SolidAngle<num_complex::Complex32>) -> Self::Output {
5559 SolidAngle{sr: self.clone() * rhs.sr.clone()}
5560 }
5561}
5562
5563#[cfg(feature="num-complex")]
5565impl core::ops::Mul<SolidAngle<num_complex::Complex64>> for num_complex::Complex64 {
5566 type Output = SolidAngle<num_complex::Complex64>;
5567 fn mul(self, rhs: SolidAngle<num_complex::Complex64>) -> Self::Output {
5568 SolidAngle{sr: self * rhs.sr}
5569 }
5570}
5571#[cfg(feature="num-complex")]
5573impl core::ops::Mul<SolidAngle<num_complex::Complex64>> for &num_complex::Complex64 {
5574 type Output = SolidAngle<num_complex::Complex64>;
5575 fn mul(self, rhs: SolidAngle<num_complex::Complex64>) -> Self::Output {
5576 SolidAngle{sr: self.clone() * rhs.sr}
5577 }
5578}
5579#[cfg(feature="num-complex")]
5581impl core::ops::Mul<&SolidAngle<num_complex::Complex64>> for num_complex::Complex64 {
5582 type Output = SolidAngle<num_complex::Complex64>;
5583 fn mul(self, rhs: &SolidAngle<num_complex::Complex64>) -> Self::Output {
5584 SolidAngle{sr: self * rhs.sr.clone()}
5585 }
5586}
5587#[cfg(feature="num-complex")]
5589impl core::ops::Mul<&SolidAngle<num_complex::Complex64>> for &num_complex::Complex64 {
5590 type Output = SolidAngle<num_complex::Complex64>;
5591 fn mul(self, rhs: &SolidAngle<num_complex::Complex64>) -> Self::Output {
5592 SolidAngle{sr: self.clone() * rhs.sr.clone()}
5593 }
5594}
5595
5596
5597
5598#[cfg(feature = "uom")]
5600impl<T> Into<uom::si::f32::SolidAngle> for SolidAngle<T> where T: NumLike+Into<f32> {
5601 fn into(self) -> uom::si::f32::SolidAngle {
5602 uom::si::f32::SolidAngle::new::<uom::si::solid_angle::steradian>(self.sr.into())
5603 }
5604}
5605
5606#[cfg(feature = "uom")]
5608impl<T> From<uom::si::f32::SolidAngle> for SolidAngle<T> where T: NumLike+From<f32> {
5609 fn from(src: uom::si::f32::SolidAngle) -> Self {
5610 SolidAngle{sr: T::from(src.value)}
5611 }
5612}
5613
5614#[cfg(feature = "uom")]
5616impl<T> Into<uom::si::f64::SolidAngle> for SolidAngle<T> where T: NumLike+Into<f64> {
5617 fn into(self) -> uom::si::f64::SolidAngle {
5618 uom::si::f64::SolidAngle::new::<uom::si::solid_angle::steradian>(self.sr.into())
5619 }
5620}
5621
5622#[cfg(feature = "uom")]
5624impl<T> From<uom::si::f64::SolidAngle> for SolidAngle<T> where T: NumLike+From<f64> {
5625 fn from(src: uom::si::f64::SolidAngle) -> Self {
5626 SolidAngle{sr: T::from(src.value)}
5627 }
5628}
5629
5630
5631impl<T> core::ops::Div<InverseLuminosity<T>> for SolidAngle<T> where T: NumLike {
5634 type Output = LuminousFlux<T>;
5635 fn div(self, rhs: InverseLuminosity<T>) -> Self::Output {
5636 LuminousFlux{lm: self.sr / rhs.per_cd}
5637 }
5638}
5639impl<T> core::ops::Div<InverseLuminosity<T>> for &SolidAngle<T> where T: NumLike {
5641 type Output = LuminousFlux<T>;
5642 fn div(self, rhs: InverseLuminosity<T>) -> Self::Output {
5643 LuminousFlux{lm: self.sr.clone() / rhs.per_cd}
5644 }
5645}
5646impl<T> core::ops::Div<&InverseLuminosity<T>> for SolidAngle<T> where T: NumLike {
5648 type Output = LuminousFlux<T>;
5649 fn div(self, rhs: &InverseLuminosity<T>) -> Self::Output {
5650 LuminousFlux{lm: self.sr / rhs.per_cd.clone()}
5651 }
5652}
5653impl<T> core::ops::Div<&InverseLuminosity<T>> for &SolidAngle<T> where T: NumLike {
5655 type Output = LuminousFlux<T>;
5656 fn div(self, rhs: &InverseLuminosity<T>) -> Self::Output {
5657 LuminousFlux{lm: self.sr.clone() / rhs.per_cd.clone()}
5658 }
5659}
5660
5661impl<T> core::ops::Mul<Luminosity<T>> for SolidAngle<T> where T: NumLike {
5664 type Output = LuminousFlux<T>;
5665 fn mul(self, rhs: Luminosity<T>) -> Self::Output {
5666 LuminousFlux{lm: self.sr * rhs.cd}
5667 }
5668}
5669impl<T> core::ops::Mul<Luminosity<T>> for &SolidAngle<T> where T: NumLike {
5671 type Output = LuminousFlux<T>;
5672 fn mul(self, rhs: Luminosity<T>) -> Self::Output {
5673 LuminousFlux{lm: self.sr.clone() * rhs.cd}
5674 }
5675}
5676impl<T> core::ops::Mul<&Luminosity<T>> for SolidAngle<T> where T: NumLike {
5678 type Output = LuminousFlux<T>;
5679 fn mul(self, rhs: &Luminosity<T>) -> Self::Output {
5680 LuminousFlux{lm: self.sr * rhs.cd.clone()}
5681 }
5682}
5683impl<T> core::ops::Mul<&Luminosity<T>> for &SolidAngle<T> where T: NumLike {
5685 type Output = LuminousFlux<T>;
5686 fn mul(self, rhs: &Luminosity<T>) -> Self::Output {
5687 LuminousFlux{lm: self.sr.clone() * rhs.cd.clone()}
5688 }
5689}
5690
5691impl<T> core::ops::Mul<InverseLuminousFlux<T>> for SolidAngle<T> where T: NumLike {
5694 type Output = InverseLuminosity<T>;
5695 fn mul(self, rhs: InverseLuminousFlux<T>) -> Self::Output {
5696 InverseLuminosity{per_cd: self.sr * rhs.per_lm}
5697 }
5698}
5699impl<T> core::ops::Mul<InverseLuminousFlux<T>> for &SolidAngle<T> where T: NumLike {
5701 type Output = InverseLuminosity<T>;
5702 fn mul(self, rhs: InverseLuminousFlux<T>) -> Self::Output {
5703 InverseLuminosity{per_cd: self.sr.clone() * rhs.per_lm}
5704 }
5705}
5706impl<T> core::ops::Mul<&InverseLuminousFlux<T>> for SolidAngle<T> where T: NumLike {
5708 type Output = InverseLuminosity<T>;
5709 fn mul(self, rhs: &InverseLuminousFlux<T>) -> Self::Output {
5710 InverseLuminosity{per_cd: self.sr * rhs.per_lm.clone()}
5711 }
5712}
5713impl<T> core::ops::Mul<&InverseLuminousFlux<T>> for &SolidAngle<T> where T: NumLike {
5715 type Output = InverseLuminosity<T>;
5716 fn mul(self, rhs: &InverseLuminousFlux<T>) -> Self::Output {
5717 InverseLuminosity{per_cd: self.sr.clone() * rhs.per_lm.clone()}
5718 }
5719}
5720
5721impl<T> core::ops::Div<LuminousFlux<T>> for SolidAngle<T> where T: NumLike {
5724 type Output = InverseLuminosity<T>;
5725 fn div(self, rhs: LuminousFlux<T>) -> Self::Output {
5726 InverseLuminosity{per_cd: self.sr / rhs.lm}
5727 }
5728}
5729impl<T> core::ops::Div<LuminousFlux<T>> for &SolidAngle<T> where T: NumLike {
5731 type Output = InverseLuminosity<T>;
5732 fn div(self, rhs: LuminousFlux<T>) -> Self::Output {
5733 InverseLuminosity{per_cd: self.sr.clone() / rhs.lm}
5734 }
5735}
5736impl<T> core::ops::Div<&LuminousFlux<T>> for SolidAngle<T> where T: NumLike {
5738 type Output = InverseLuminosity<T>;
5739 fn div(self, rhs: &LuminousFlux<T>) -> Self::Output {
5740 InverseLuminosity{per_cd: self.sr / rhs.lm.clone()}
5741 }
5742}
5743impl<T> core::ops::Div<&LuminousFlux<T>> for &SolidAngle<T> where T: NumLike {
5745 type Output = InverseLuminosity<T>;
5746 fn div(self, rhs: &LuminousFlux<T>) -> Self::Output {
5747 InverseLuminosity{per_cd: self.sr.clone() / rhs.lm.clone()}
5748 }
5749}
5750
5751impl<T> core::ops::Div<Angle<T>> for SolidAngle<T> where T: NumLike {
5754 type Output = Angle<T>;
5755 fn div(self, rhs: Angle<T>) -> Self::Output {
5756 Angle{rad: self.sr / rhs.rad}
5757 }
5758}
5759impl<T> core::ops::Div<Angle<T>> for &SolidAngle<T> where T: NumLike {
5761 type Output = Angle<T>;
5762 fn div(self, rhs: Angle<T>) -> Self::Output {
5763 Angle{rad: self.sr.clone() / rhs.rad}
5764 }
5765}
5766impl<T> core::ops::Div<&Angle<T>> for SolidAngle<T> where T: NumLike {
5768 type Output = Angle<T>;
5769 fn div(self, rhs: &Angle<T>) -> Self::Output {
5770 Angle{rad: self.sr / rhs.rad.clone()}
5771 }
5772}
5773impl<T> core::ops::Div<&Angle<T>> for &SolidAngle<T> where T: NumLike {
5775 type Output = Angle<T>;
5776 fn div(self, rhs: &Angle<T>) -> Self::Output {
5777 Angle{rad: self.sr.clone() / rhs.rad.clone()}
5778 }
5779}
5780
5781impl<T> core::ops::Mul<InverseAngle<T>> for SolidAngle<T> where T: NumLike {
5784 type Output = Angle<T>;
5785 fn mul(self, rhs: InverseAngle<T>) -> Self::Output {
5786 Angle{rad: self.sr * rhs.per_rad}
5787 }
5788}
5789impl<T> core::ops::Mul<InverseAngle<T>> for &SolidAngle<T> where T: NumLike {
5791 type Output = Angle<T>;
5792 fn mul(self, rhs: InverseAngle<T>) -> Self::Output {
5793 Angle{rad: self.sr.clone() * rhs.per_rad}
5794 }
5795}
5796impl<T> core::ops::Mul<&InverseAngle<T>> for SolidAngle<T> where T: NumLike {
5798 type Output = Angle<T>;
5799 fn mul(self, rhs: &InverseAngle<T>) -> Self::Output {
5800 Angle{rad: self.sr * rhs.per_rad.clone()}
5801 }
5802}
5803impl<T> core::ops::Mul<&InverseAngle<T>> for &SolidAngle<T> where T: NumLike {
5805 type Output = Angle<T>;
5806 fn mul(self, rhs: &InverseAngle<T>) -> Self::Output {
5807 Angle{rad: self.sr.clone() * rhs.per_rad.clone()}
5808 }
5809}
5810
5811impl<T> core::ops::Div<SolidAngle<T>> for f64 where T: NumLike+From<f64> {
5814 type Output = InverseSolidAngle<T>;
5815 fn div(self, rhs: SolidAngle<T>) -> Self::Output {
5816 InverseSolidAngle{per_sr: T::from(self) / rhs.sr}
5817 }
5818}
5819impl<T> core::ops::Div<SolidAngle<T>> for &f64 where T: NumLike+From<f64> {
5821 type Output = InverseSolidAngle<T>;
5822 fn div(self, rhs: SolidAngle<T>) -> Self::Output {
5823 InverseSolidAngle{per_sr: T::from(self.clone()) / rhs.sr}
5824 }
5825}
5826impl<T> core::ops::Div<&SolidAngle<T>> for f64 where T: NumLike+From<f64> {
5828 type Output = InverseSolidAngle<T>;
5829 fn div(self, rhs: &SolidAngle<T>) -> Self::Output {
5830 InverseSolidAngle{per_sr: T::from(self) / rhs.sr.clone()}
5831 }
5832}
5833impl<T> core::ops::Div<&SolidAngle<T>> for &f64 where T: NumLike+From<f64> {
5835 type Output = InverseSolidAngle<T>;
5836 fn div(self, rhs: &SolidAngle<T>) -> Self::Output {
5837 InverseSolidAngle{per_sr: T::from(self.clone()) / rhs.sr.clone()}
5838 }
5839}
5840
5841impl<T> core::ops::Div<SolidAngle<T>> for f32 where T: NumLike+From<f32> {
5844 type Output = InverseSolidAngle<T>;
5845 fn div(self, rhs: SolidAngle<T>) -> Self::Output {
5846 InverseSolidAngle{per_sr: T::from(self) / rhs.sr}
5847 }
5848}
5849impl<T> core::ops::Div<SolidAngle<T>> for &f32 where T: NumLike+From<f32> {
5851 type Output = InverseSolidAngle<T>;
5852 fn div(self, rhs: SolidAngle<T>) -> Self::Output {
5853 InverseSolidAngle{per_sr: T::from(self.clone()) / rhs.sr}
5854 }
5855}
5856impl<T> core::ops::Div<&SolidAngle<T>> for f32 where T: NumLike+From<f32> {
5858 type Output = InverseSolidAngle<T>;
5859 fn div(self, rhs: &SolidAngle<T>) -> Self::Output {
5860 InverseSolidAngle{per_sr: T::from(self) / rhs.sr.clone()}
5861 }
5862}
5863impl<T> core::ops::Div<&SolidAngle<T>> for &f32 where T: NumLike+From<f32> {
5865 type Output = InverseSolidAngle<T>;
5866 fn div(self, rhs: &SolidAngle<T>) -> Self::Output {
5867 InverseSolidAngle{per_sr: T::from(self.clone()) / rhs.sr.clone()}
5868 }
5869}
5870
5871impl<T> core::ops::Div<SolidAngle<T>> for i64 where T: NumLike+From<i64> {
5874 type Output = InverseSolidAngle<T>;
5875 fn div(self, rhs: SolidAngle<T>) -> Self::Output {
5876 InverseSolidAngle{per_sr: T::from(self) / rhs.sr}
5877 }
5878}
5879impl<T> core::ops::Div<SolidAngle<T>> for &i64 where T: NumLike+From<i64> {
5881 type Output = InverseSolidAngle<T>;
5882 fn div(self, rhs: SolidAngle<T>) -> Self::Output {
5883 InverseSolidAngle{per_sr: T::from(self.clone()) / rhs.sr}
5884 }
5885}
5886impl<T> core::ops::Div<&SolidAngle<T>> for i64 where T: NumLike+From<i64> {
5888 type Output = InverseSolidAngle<T>;
5889 fn div(self, rhs: &SolidAngle<T>) -> Self::Output {
5890 InverseSolidAngle{per_sr: T::from(self) / rhs.sr.clone()}
5891 }
5892}
5893impl<T> core::ops::Div<&SolidAngle<T>> for &i64 where T: NumLike+From<i64> {
5895 type Output = InverseSolidAngle<T>;
5896 fn div(self, rhs: &SolidAngle<T>) -> Self::Output {
5897 InverseSolidAngle{per_sr: T::from(self.clone()) / rhs.sr.clone()}
5898 }
5899}
5900
5901impl<T> core::ops::Div<SolidAngle<T>> for i32 where T: NumLike+From<i32> {
5904 type Output = InverseSolidAngle<T>;
5905 fn div(self, rhs: SolidAngle<T>) -> Self::Output {
5906 InverseSolidAngle{per_sr: T::from(self) / rhs.sr}
5907 }
5908}
5909impl<T> core::ops::Div<SolidAngle<T>> for &i32 where T: NumLike+From<i32> {
5911 type Output = InverseSolidAngle<T>;
5912 fn div(self, rhs: SolidAngle<T>) -> Self::Output {
5913 InverseSolidAngle{per_sr: T::from(self.clone()) / rhs.sr}
5914 }
5915}
5916impl<T> core::ops::Div<&SolidAngle<T>> for i32 where T: NumLike+From<i32> {
5918 type Output = InverseSolidAngle<T>;
5919 fn div(self, rhs: &SolidAngle<T>) -> Self::Output {
5920 InverseSolidAngle{per_sr: T::from(self) / rhs.sr.clone()}
5921 }
5922}
5923impl<T> core::ops::Div<&SolidAngle<T>> for &i32 where T: NumLike+From<i32> {
5925 type Output = InverseSolidAngle<T>;
5926 fn div(self, rhs: &SolidAngle<T>) -> Self::Output {
5927 InverseSolidAngle{per_sr: T::from(self.clone()) / rhs.sr.clone()}
5928 }
5929}
5930
5931#[cfg(feature="num-bigfloat")]
5934impl<T> core::ops::Div<SolidAngle<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
5935 type Output = InverseSolidAngle<T>;
5936 fn div(self, rhs: SolidAngle<T>) -> Self::Output {
5937 InverseSolidAngle{per_sr: T::from(self) / rhs.sr}
5938 }
5939}
5940#[cfg(feature="num-bigfloat")]
5942impl<T> core::ops::Div<SolidAngle<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
5943 type Output = InverseSolidAngle<T>;
5944 fn div(self, rhs: SolidAngle<T>) -> Self::Output {
5945 InverseSolidAngle{per_sr: T::from(self.clone()) / rhs.sr}
5946 }
5947}
5948#[cfg(feature="num-bigfloat")]
5950impl<T> core::ops::Div<&SolidAngle<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
5951 type Output = InverseSolidAngle<T>;
5952 fn div(self, rhs: &SolidAngle<T>) -> Self::Output {
5953 InverseSolidAngle{per_sr: T::from(self) / rhs.sr.clone()}
5954 }
5955}
5956#[cfg(feature="num-bigfloat")]
5958impl<T> core::ops::Div<&SolidAngle<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
5959 type Output = InverseSolidAngle<T>;
5960 fn div(self, rhs: &SolidAngle<T>) -> Self::Output {
5961 InverseSolidAngle{per_sr: T::from(self.clone()) / rhs.sr.clone()}
5962 }
5963}
5964
5965#[cfg(feature="num-complex")]
5968impl<T> core::ops::Div<SolidAngle<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
5969 type Output = InverseSolidAngle<T>;
5970 fn div(self, rhs: SolidAngle<T>) -> Self::Output {
5971 InverseSolidAngle{per_sr: T::from(self) / rhs.sr}
5972 }
5973}
5974#[cfg(feature="num-complex")]
5976impl<T> core::ops::Div<SolidAngle<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
5977 type Output = InverseSolidAngle<T>;
5978 fn div(self, rhs: SolidAngle<T>) -> Self::Output {
5979 InverseSolidAngle{per_sr: T::from(self.clone()) / rhs.sr}
5980 }
5981}
5982#[cfg(feature="num-complex")]
5984impl<T> core::ops::Div<&SolidAngle<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
5985 type Output = InverseSolidAngle<T>;
5986 fn div(self, rhs: &SolidAngle<T>) -> Self::Output {
5987 InverseSolidAngle{per_sr: T::from(self) / rhs.sr.clone()}
5988 }
5989}
5990#[cfg(feature="num-complex")]
5992impl<T> core::ops::Div<&SolidAngle<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
5993 type Output = InverseSolidAngle<T>;
5994 fn div(self, rhs: &SolidAngle<T>) -> Self::Output {
5995 InverseSolidAngle{per_sr: T::from(self.clone()) / rhs.sr.clone()}
5996 }
5997}
5998
5999#[cfg(feature="num-complex")]
6002impl<T> core::ops::Div<SolidAngle<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
6003 type Output = InverseSolidAngle<T>;
6004 fn div(self, rhs: SolidAngle<T>) -> Self::Output {
6005 InverseSolidAngle{per_sr: T::from(self) / rhs.sr}
6006 }
6007}
6008#[cfg(feature="num-complex")]
6010impl<T> core::ops::Div<SolidAngle<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
6011 type Output = InverseSolidAngle<T>;
6012 fn div(self, rhs: SolidAngle<T>) -> Self::Output {
6013 InverseSolidAngle{per_sr: T::from(self.clone()) / rhs.sr}
6014 }
6015}
6016#[cfg(feature="num-complex")]
6018impl<T> core::ops::Div<&SolidAngle<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
6019 type Output = InverseSolidAngle<T>;
6020 fn div(self, rhs: &SolidAngle<T>) -> Self::Output {
6021 InverseSolidAngle{per_sr: T::from(self) / rhs.sr.clone()}
6022 }
6023}
6024#[cfg(feature="num-complex")]
6026impl<T> core::ops::Div<&SolidAngle<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
6027 type Output = InverseSolidAngle<T>;
6028 fn div(self, rhs: &SolidAngle<T>) -> Self::Output {
6029 InverseSolidAngle{per_sr: T::from(self.clone()) / rhs.sr.clone()}
6030 }
6031}
6032
6033#[derive(UnitStruct, Debug, Clone)]
6035#[cfg_attr(feature="serde", derive(Serialize, Deserialize))]
6036pub struct Volume<T: NumLike>{
6037 pub m3: T
6039}
6040
6041impl<T> Volume<T> where T: NumLike {
6042
6043 pub fn unit_name() -> &'static str { "cubic meters" }
6045
6046 pub fn unit_symbol() -> &'static str { "m³" }
6048
6049 pub fn from_m3(m3: T) -> Self { Volume{m3: m3} }
6054
6055 pub fn to_m3(&self) -> T { self.m3.clone() }
6057
6058 pub fn from_cubic_meters(cubic_meters: T) -> Self { Volume{m3: cubic_meters} }
6063
6064 pub fn to_cubic_meters(&self) -> T { self.m3.clone() }
6066
6067 pub fn from_kL(kL: T) -> Self { Volume{m3: kL} }
6072
6073 pub fn to_kL(&self) -> T { self.m3.clone() }
6075
6076}
6077
6078impl<T> fmt::Display for Volume<T> where T: NumLike {
6079 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6080 write!(f, "{} {}", &self.m3, Self::unit_symbol())
6081 }
6082}
6083
6084impl<T> Volume<T> where T: NumLike+From<f64> {
6085
6086 pub fn to_cc(&self) -> T {
6090 return self.m3.clone() * T::from(1000000.0_f64);
6091 }
6092
6093 pub fn from_cc(cc: T) -> Self {
6100 Volume{m3: cc * T::from(1e-06_f64)}
6101 }
6102
6103 pub fn to_L(&self) -> T {
6107 return self.m3.clone() * T::from(1000.0_f64);
6108 }
6109
6110 pub fn from_L(L: T) -> Self {
6117 Volume{m3: L * T::from(0.001_f64)}
6118 }
6119
6120 pub fn to_liters(&self) -> T {
6124 return self.m3.clone() * T::from(1000.0_f64);
6125 }
6126
6127 pub fn from_liters(liters: T) -> Self {
6134 Volume{m3: liters * T::from(0.001_f64)}
6135 }
6136
6137 pub fn to_mL(&self) -> T {
6141 return self.m3.clone() * T::from(1000000.0_f64);
6142 }
6143
6144 pub fn from_mL(mL: T) -> Self {
6151 Volume{m3: mL * T::from(1e-06_f64)}
6152 }
6153
6154 pub fn to_uL(&self) -> T {
6158 return self.m3.clone() * T::from(1000000000.0_f64);
6159 }
6160
6161 pub fn from_uL(uL: T) -> Self {
6168 Volume{m3: uL * T::from(1e-09_f64)}
6169 }
6170
6171 pub fn to_nL(&self) -> T {
6175 return self.m3.clone() * T::from(1000000000000.0_f64);
6176 }
6177
6178 pub fn from_nL(nL: T) -> Self {
6185 Volume{m3: nL * T::from(1e-12_f64)}
6186 }
6187
6188 pub fn to_pL(&self) -> T {
6192 return self.m3.clone() * T::from(1000000000000000.0_f64);
6193 }
6194
6195 pub fn from_pL(pL: T) -> Self {
6202 Volume{m3: pL * T::from(1e-15_f64)}
6203 }
6204
6205 pub fn to_ML(&self) -> T {
6209 return self.m3.clone() * T::from(0.001_f64);
6210 }
6211
6212 pub fn from_ML(ML: T) -> Self {
6219 Volume{m3: ML * T::from(1000.0_f64)}
6220 }
6221
6222 pub fn to_GL(&self) -> T {
6226 return self.m3.clone() * T::from(1e-06_f64);
6227 }
6228
6229 pub fn from_GL(GL: T) -> Self {
6236 Volume{m3: GL * T::from(1000000.0_f64)}
6237 }
6238
6239}
6240
6241
6242#[cfg(feature="num-bigfloat")]
6244impl core::ops::Mul<Volume<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
6245 type Output = Volume<num_bigfloat::BigFloat>;
6246 fn mul(self, rhs: Volume<num_bigfloat::BigFloat>) -> Self::Output {
6247 Volume{m3: self * rhs.m3}
6248 }
6249}
6250#[cfg(feature="num-bigfloat")]
6252impl core::ops::Mul<Volume<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
6253 type Output = Volume<num_bigfloat::BigFloat>;
6254 fn mul(self, rhs: Volume<num_bigfloat::BigFloat>) -> Self::Output {
6255 Volume{m3: self.clone() * rhs.m3}
6256 }
6257}
6258#[cfg(feature="num-bigfloat")]
6260impl core::ops::Mul<&Volume<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
6261 type Output = Volume<num_bigfloat::BigFloat>;
6262 fn mul(self, rhs: &Volume<num_bigfloat::BigFloat>) -> Self::Output {
6263 Volume{m3: self * rhs.m3.clone()}
6264 }
6265}
6266#[cfg(feature="num-bigfloat")]
6268impl core::ops::Mul<&Volume<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
6269 type Output = Volume<num_bigfloat::BigFloat>;
6270 fn mul(self, rhs: &Volume<num_bigfloat::BigFloat>) -> Self::Output {
6271 Volume{m3: self.clone() * rhs.m3.clone()}
6272 }
6273}
6274
6275#[cfg(feature="num-complex")]
6277impl core::ops::Mul<Volume<num_complex::Complex32>> for num_complex::Complex32 {
6278 type Output = Volume<num_complex::Complex32>;
6279 fn mul(self, rhs: Volume<num_complex::Complex32>) -> Self::Output {
6280 Volume{m3: self * rhs.m3}
6281 }
6282}
6283#[cfg(feature="num-complex")]
6285impl core::ops::Mul<Volume<num_complex::Complex32>> for &num_complex::Complex32 {
6286 type Output = Volume<num_complex::Complex32>;
6287 fn mul(self, rhs: Volume<num_complex::Complex32>) -> Self::Output {
6288 Volume{m3: self.clone() * rhs.m3}
6289 }
6290}
6291#[cfg(feature="num-complex")]
6293impl core::ops::Mul<&Volume<num_complex::Complex32>> for num_complex::Complex32 {
6294 type Output = Volume<num_complex::Complex32>;
6295 fn mul(self, rhs: &Volume<num_complex::Complex32>) -> Self::Output {
6296 Volume{m3: self * rhs.m3.clone()}
6297 }
6298}
6299#[cfg(feature="num-complex")]
6301impl core::ops::Mul<&Volume<num_complex::Complex32>> for &num_complex::Complex32 {
6302 type Output = Volume<num_complex::Complex32>;
6303 fn mul(self, rhs: &Volume<num_complex::Complex32>) -> Self::Output {
6304 Volume{m3: self.clone() * rhs.m3.clone()}
6305 }
6306}
6307
6308#[cfg(feature="num-complex")]
6310impl core::ops::Mul<Volume<num_complex::Complex64>> for num_complex::Complex64 {
6311 type Output = Volume<num_complex::Complex64>;
6312 fn mul(self, rhs: Volume<num_complex::Complex64>) -> Self::Output {
6313 Volume{m3: self * rhs.m3}
6314 }
6315}
6316#[cfg(feature="num-complex")]
6318impl core::ops::Mul<Volume<num_complex::Complex64>> for &num_complex::Complex64 {
6319 type Output = Volume<num_complex::Complex64>;
6320 fn mul(self, rhs: Volume<num_complex::Complex64>) -> Self::Output {
6321 Volume{m3: self.clone() * rhs.m3}
6322 }
6323}
6324#[cfg(feature="num-complex")]
6326impl core::ops::Mul<&Volume<num_complex::Complex64>> for num_complex::Complex64 {
6327 type Output = Volume<num_complex::Complex64>;
6328 fn mul(self, rhs: &Volume<num_complex::Complex64>) -> Self::Output {
6329 Volume{m3: self * rhs.m3.clone()}
6330 }
6331}
6332#[cfg(feature="num-complex")]
6334impl core::ops::Mul<&Volume<num_complex::Complex64>> for &num_complex::Complex64 {
6335 type Output = Volume<num_complex::Complex64>;
6336 fn mul(self, rhs: &Volume<num_complex::Complex64>) -> Self::Output {
6337 Volume{m3: self.clone() * rhs.m3.clone()}
6338 }
6339}
6340
6341
6342
6343#[cfg(feature = "uom")]
6345impl<T> Into<uom::si::f32::Volume> for Volume<T> where T: NumLike+Into<f32> {
6346 fn into(self) -> uom::si::f32::Volume {
6347 uom::si::f32::Volume::new::<uom::si::volume::cubic_meter>(self.m3.into())
6348 }
6349}
6350
6351#[cfg(feature = "uom")]
6353impl<T> From<uom::si::f32::Volume> for Volume<T> where T: NumLike+From<f32> {
6354 fn from(src: uom::si::f32::Volume) -> Self {
6355 Volume{m3: T::from(src.value)}
6356 }
6357}
6358
6359#[cfg(feature = "uom")]
6361impl<T> Into<uom::si::f64::Volume> for Volume<T> where T: NumLike+Into<f64> {
6362 fn into(self) -> uom::si::f64::Volume {
6363 uom::si::f64::Volume::new::<uom::si::volume::cubic_meter>(self.m3.into())
6364 }
6365}
6366
6367#[cfg(feature = "uom")]
6369impl<T> From<uom::si::f64::Volume> for Volume<T> where T: NumLike+From<f64> {
6370 fn from(src: uom::si::f64::Volume) -> Self {
6371 Volume{m3: T::from(src.value)}
6372 }
6373}
6374
6375
6376impl<T> core::ops::Div<Amount<T>> for Volume<T> where T: NumLike {
6379 type Output = MolarVolume<T>;
6380 fn div(self, rhs: Amount<T>) -> Self::Output {
6381 MolarVolume{m3_per_mol: self.m3 / rhs.mol}
6382 }
6383}
6384impl<T> core::ops::Div<Amount<T>> for &Volume<T> where T: NumLike {
6386 type Output = MolarVolume<T>;
6387 fn div(self, rhs: Amount<T>) -> Self::Output {
6388 MolarVolume{m3_per_mol: self.m3.clone() / rhs.mol}
6389 }
6390}
6391impl<T> core::ops::Div<&Amount<T>> for Volume<T> where T: NumLike {
6393 type Output = MolarVolume<T>;
6394 fn div(self, rhs: &Amount<T>) -> Self::Output {
6395 MolarVolume{m3_per_mol: self.m3 / rhs.mol.clone()}
6396 }
6397}
6398impl<T> core::ops::Div<&Amount<T>> for &Volume<T> where T: NumLike {
6400 type Output = MolarVolume<T>;
6401 fn div(self, rhs: &Amount<T>) -> Self::Output {
6402 MolarVolume{m3_per_mol: self.m3.clone() / rhs.mol.clone()}
6403 }
6404}
6405
6406impl<T> core::ops::Div<Distance<T>> for Volume<T> where T: NumLike {
6409 type Output = Area<T>;
6410 fn div(self, rhs: Distance<T>) -> Self::Output {
6411 Area{m2: self.m3 / rhs.m}
6412 }
6413}
6414impl<T> core::ops::Div<Distance<T>> for &Volume<T> where T: NumLike {
6416 type Output = Area<T>;
6417 fn div(self, rhs: Distance<T>) -> Self::Output {
6418 Area{m2: self.m3.clone() / rhs.m}
6419 }
6420}
6421impl<T> core::ops::Div<&Distance<T>> for Volume<T> where T: NumLike {
6423 type Output = Area<T>;
6424 fn div(self, rhs: &Distance<T>) -> Self::Output {
6425 Area{m2: self.m3 / rhs.m.clone()}
6426 }
6427}
6428impl<T> core::ops::Div<&Distance<T>> for &Volume<T> where T: NumLike {
6430 type Output = Area<T>;
6431 fn div(self, rhs: &Distance<T>) -> Self::Output {
6432 Area{m2: self.m3.clone() / rhs.m.clone()}
6433 }
6434}
6435
6436impl<T> core::ops::Mul<InverseAmount<T>> for Volume<T> where T: NumLike {
6439 type Output = MolarVolume<T>;
6440 fn mul(self, rhs: InverseAmount<T>) -> Self::Output {
6441 MolarVolume{m3_per_mol: self.m3 * rhs.per_mol}
6442 }
6443}
6444impl<T> core::ops::Mul<InverseAmount<T>> for &Volume<T> where T: NumLike {
6446 type Output = MolarVolume<T>;
6447 fn mul(self, rhs: InverseAmount<T>) -> Self::Output {
6448 MolarVolume{m3_per_mol: self.m3.clone() * rhs.per_mol}
6449 }
6450}
6451impl<T> core::ops::Mul<&InverseAmount<T>> for Volume<T> where T: NumLike {
6453 type Output = MolarVolume<T>;
6454 fn mul(self, rhs: &InverseAmount<T>) -> Self::Output {
6455 MolarVolume{m3_per_mol: self.m3 * rhs.per_mol.clone()}
6456 }
6457}
6458impl<T> core::ops::Mul<&InverseAmount<T>> for &Volume<T> where T: NumLike {
6460 type Output = MolarVolume<T>;
6461 fn mul(self, rhs: &InverseAmount<T>) -> Self::Output {
6462 MolarVolume{m3_per_mol: self.m3.clone() * rhs.per_mol.clone()}
6463 }
6464}
6465
6466impl<T> core::ops::Mul<InverseDistance<T>> for Volume<T> where T: NumLike {
6469 type Output = Area<T>;
6470 fn mul(self, rhs: InverseDistance<T>) -> Self::Output {
6471 Area{m2: self.m3 * rhs.per_m}
6472 }
6473}
6474impl<T> core::ops::Mul<InverseDistance<T>> for &Volume<T> where T: NumLike {
6476 type Output = Area<T>;
6477 fn mul(self, rhs: InverseDistance<T>) -> Self::Output {
6478 Area{m2: self.m3.clone() * rhs.per_m}
6479 }
6480}
6481impl<T> core::ops::Mul<&InverseDistance<T>> for Volume<T> where T: NumLike {
6483 type Output = Area<T>;
6484 fn mul(self, rhs: &InverseDistance<T>) -> Self::Output {
6485 Area{m2: self.m3 * rhs.per_m.clone()}
6486 }
6487}
6488impl<T> core::ops::Mul<&InverseDistance<T>> for &Volume<T> where T: NumLike {
6490 type Output = Area<T>;
6491 fn mul(self, rhs: &InverseDistance<T>) -> Self::Output {
6492 Area{m2: self.m3.clone() * rhs.per_m.clone()}
6493 }
6494}
6495
6496impl<T> core::ops::Mul<InverseMass<T>> for Volume<T> where T: NumLike {
6499 type Output = VolumePerMass<T>;
6500 fn mul(self, rhs: InverseMass<T>) -> Self::Output {
6501 VolumePerMass{m3_per_kg: self.m3 * rhs.per_kg}
6502 }
6503}
6504impl<T> core::ops::Mul<InverseMass<T>> for &Volume<T> where T: NumLike {
6506 type Output = VolumePerMass<T>;
6507 fn mul(self, rhs: InverseMass<T>) -> Self::Output {
6508 VolumePerMass{m3_per_kg: self.m3.clone() * rhs.per_kg}
6509 }
6510}
6511impl<T> core::ops::Mul<&InverseMass<T>> for Volume<T> where T: NumLike {
6513 type Output = VolumePerMass<T>;
6514 fn mul(self, rhs: &InverseMass<T>) -> Self::Output {
6515 VolumePerMass{m3_per_kg: self.m3 * rhs.per_kg.clone()}
6516 }
6517}
6518impl<T> core::ops::Mul<&InverseMass<T>> for &Volume<T> where T: NumLike {
6520 type Output = VolumePerMass<T>;
6521 fn mul(self, rhs: &InverseMass<T>) -> Self::Output {
6522 VolumePerMass{m3_per_kg: self.m3.clone() * rhs.per_kg.clone()}
6523 }
6524}
6525
6526impl<T> core::ops::Div<Mass<T>> for Volume<T> where T: NumLike {
6529 type Output = VolumePerMass<T>;
6530 fn div(self, rhs: Mass<T>) -> Self::Output {
6531 VolumePerMass{m3_per_kg: self.m3 / rhs.kg}
6532 }
6533}
6534impl<T> core::ops::Div<Mass<T>> for &Volume<T> where T: NumLike {
6536 type Output = VolumePerMass<T>;
6537 fn div(self, rhs: Mass<T>) -> Self::Output {
6538 VolumePerMass{m3_per_kg: self.m3.clone() / rhs.kg}
6539 }
6540}
6541impl<T> core::ops::Div<&Mass<T>> for Volume<T> where T: NumLike {
6543 type Output = VolumePerMass<T>;
6544 fn div(self, rhs: &Mass<T>) -> Self::Output {
6545 VolumePerMass{m3_per_kg: self.m3 / rhs.kg.clone()}
6546 }
6547}
6548impl<T> core::ops::Div<&Mass<T>> for &Volume<T> where T: NumLike {
6550 type Output = VolumePerMass<T>;
6551 fn div(self, rhs: &Mass<T>) -> Self::Output {
6552 VolumePerMass{m3_per_kg: self.m3.clone() / rhs.kg.clone()}
6553 }
6554}
6555
6556impl<T> core::ops::Mul<Concentration<T>> for Volume<T> where T: NumLike {
6559 type Output = Amount<T>;
6560 fn mul(self, rhs: Concentration<T>) -> Self::Output {
6561 Amount{mol: self.m3 * rhs.molpm3}
6562 }
6563}
6564impl<T> core::ops::Mul<Concentration<T>> for &Volume<T> where T: NumLike {
6566 type Output = Amount<T>;
6567 fn mul(self, rhs: Concentration<T>) -> Self::Output {
6568 Amount{mol: self.m3.clone() * rhs.molpm3}
6569 }
6570}
6571impl<T> core::ops::Mul<&Concentration<T>> for Volume<T> where T: NumLike {
6573 type Output = Amount<T>;
6574 fn mul(self, rhs: &Concentration<T>) -> Self::Output {
6575 Amount{mol: self.m3 * rhs.molpm3.clone()}
6576 }
6577}
6578impl<T> core::ops::Mul<&Concentration<T>> for &Volume<T> where T: NumLike {
6580 type Output = Amount<T>;
6581 fn mul(self, rhs: &Concentration<T>) -> Self::Output {
6582 Amount{mol: self.m3.clone() * rhs.molpm3.clone()}
6583 }
6584}
6585
6586impl<T> core::ops::Div<MolarVolume<T>> for Volume<T> where T: NumLike {
6589 type Output = Amount<T>;
6590 fn div(self, rhs: MolarVolume<T>) -> Self::Output {
6591 Amount{mol: self.m3 / rhs.m3_per_mol}
6592 }
6593}
6594impl<T> core::ops::Div<MolarVolume<T>> for &Volume<T> where T: NumLike {
6596 type Output = Amount<T>;
6597 fn div(self, rhs: MolarVolume<T>) -> Self::Output {
6598 Amount{mol: self.m3.clone() / rhs.m3_per_mol}
6599 }
6600}
6601impl<T> core::ops::Div<&MolarVolume<T>> for Volume<T> where T: NumLike {
6603 type Output = Amount<T>;
6604 fn div(self, rhs: &MolarVolume<T>) -> Self::Output {
6605 Amount{mol: self.m3 / rhs.m3_per_mol.clone()}
6606 }
6607}
6608impl<T> core::ops::Div<&MolarVolume<T>> for &Volume<T> where T: NumLike {
6610 type Output = Amount<T>;
6611 fn div(self, rhs: &MolarVolume<T>) -> Self::Output {
6612 Amount{mol: self.m3.clone() / rhs.m3_per_mol.clone()}
6613 }
6614}
6615
6616impl<T> core::ops::Div<Area<T>> for Volume<T> where T: NumLike {
6619 type Output = Distance<T>;
6620 fn div(self, rhs: Area<T>) -> Self::Output {
6621 Distance{m: self.m3 / rhs.m2}
6622 }
6623}
6624impl<T> core::ops::Div<Area<T>> for &Volume<T> where T: NumLike {
6626 type Output = Distance<T>;
6627 fn div(self, rhs: Area<T>) -> Self::Output {
6628 Distance{m: self.m3.clone() / rhs.m2}
6629 }
6630}
6631impl<T> core::ops::Div<&Area<T>> for Volume<T> where T: NumLike {
6633 type Output = Distance<T>;
6634 fn div(self, rhs: &Area<T>) -> Self::Output {
6635 Distance{m: self.m3 / rhs.m2.clone()}
6636 }
6637}
6638impl<T> core::ops::Div<&Area<T>> for &Volume<T> where T: NumLike {
6640 type Output = Distance<T>;
6641 fn div(self, rhs: &Area<T>) -> Self::Output {
6642 Distance{m: self.m3.clone() / rhs.m2.clone()}
6643 }
6644}
6645
6646impl<T> core::ops::Mul<InverseArea<T>> for Volume<T> where T: NumLike {
6649 type Output = Distance<T>;
6650 fn mul(self, rhs: InverseArea<T>) -> Self::Output {
6651 Distance{m: self.m3 * rhs.per_m2}
6652 }
6653}
6654impl<T> core::ops::Mul<InverseArea<T>> for &Volume<T> where T: NumLike {
6656 type Output = Distance<T>;
6657 fn mul(self, rhs: InverseArea<T>) -> Self::Output {
6658 Distance{m: self.m3.clone() * rhs.per_m2}
6659 }
6660}
6661impl<T> core::ops::Mul<&InverseArea<T>> for Volume<T> where T: NumLike {
6663 type Output = Distance<T>;
6664 fn mul(self, rhs: &InverseArea<T>) -> Self::Output {
6665 Distance{m: self.m3 * rhs.per_m2.clone()}
6666 }
6667}
6668impl<T> core::ops::Mul<&InverseArea<T>> for &Volume<T> where T: NumLike {
6670 type Output = Distance<T>;
6671 fn mul(self, rhs: &InverseArea<T>) -> Self::Output {
6672 Distance{m: self.m3.clone() * rhs.per_m2.clone()}
6673 }
6674}
6675
6676impl<T> core::ops::Mul<Density<T>> for Volume<T> where T: NumLike {
6679 type Output = Mass<T>;
6680 fn mul(self, rhs: Density<T>) -> Self::Output {
6681 Mass{kg: self.m3 * rhs.kgpm3}
6682 }
6683}
6684impl<T> core::ops::Mul<Density<T>> for &Volume<T> where T: NumLike {
6686 type Output = Mass<T>;
6687 fn mul(self, rhs: Density<T>) -> Self::Output {
6688 Mass{kg: self.m3.clone() * rhs.kgpm3}
6689 }
6690}
6691impl<T> core::ops::Mul<&Density<T>> for Volume<T> where T: NumLike {
6693 type Output = Mass<T>;
6694 fn mul(self, rhs: &Density<T>) -> Self::Output {
6695 Mass{kg: self.m3 * rhs.kgpm3.clone()}
6696 }
6697}
6698impl<T> core::ops::Mul<&Density<T>> for &Volume<T> where T: NumLike {
6700 type Output = Mass<T>;
6701 fn mul(self, rhs: &Density<T>) -> Self::Output {
6702 Mass{kg: self.m3.clone() * rhs.kgpm3.clone()}
6703 }
6704}
6705
6706impl<T> core::ops::Div<Energy<T>> for Volume<T> where T: NumLike {
6709 type Output = InversePressure<T>;
6710 fn div(self, rhs: Energy<T>) -> Self::Output {
6711 InversePressure{per_Pa: self.m3 / rhs.J}
6712 }
6713}
6714impl<T> core::ops::Div<Energy<T>> for &Volume<T> where T: NumLike {
6716 type Output = InversePressure<T>;
6717 fn div(self, rhs: Energy<T>) -> Self::Output {
6718 InversePressure{per_Pa: self.m3.clone() / rhs.J}
6719 }
6720}
6721impl<T> core::ops::Div<&Energy<T>> for Volume<T> where T: NumLike {
6723 type Output = InversePressure<T>;
6724 fn div(self, rhs: &Energy<T>) -> Self::Output {
6725 InversePressure{per_Pa: self.m3 / rhs.J.clone()}
6726 }
6727}
6728impl<T> core::ops::Div<&Energy<T>> for &Volume<T> where T: NumLike {
6730 type Output = InversePressure<T>;
6731 fn div(self, rhs: &Energy<T>) -> Self::Output {
6732 InversePressure{per_Pa: self.m3.clone() / rhs.J.clone()}
6733 }
6734}
6735
6736impl<T> core::ops::Div<Torque<T>> for Volume<T> where T: NumLike {
6739 type Output = InversePressure<T>;
6740 fn div(self, rhs: Torque<T>) -> Self::Output {
6741 InversePressure{per_Pa: self.m3 / rhs.Nm}
6742 }
6743}
6744impl<T> core::ops::Div<Torque<T>> for &Volume<T> where T: NumLike {
6746 type Output = InversePressure<T>;
6747 fn div(self, rhs: Torque<T>) -> Self::Output {
6748 InversePressure{per_Pa: self.m3.clone() / rhs.Nm}
6749 }
6750}
6751impl<T> core::ops::Div<&Torque<T>> for Volume<T> where T: NumLike {
6753 type Output = InversePressure<T>;
6754 fn div(self, rhs: &Torque<T>) -> Self::Output {
6755 InversePressure{per_Pa: self.m3 / rhs.Nm.clone()}
6756 }
6757}
6758impl<T> core::ops::Div<&Torque<T>> for &Volume<T> where T: NumLike {
6760 type Output = InversePressure<T>;
6761 fn div(self, rhs: &Torque<T>) -> Self::Output {
6762 InversePressure{per_Pa: self.m3.clone() / rhs.Nm.clone()}
6763 }
6764}
6765
6766impl<T> core::ops::Mul<InverseEnergy<T>> for Volume<T> where T: NumLike {
6769 type Output = InversePressure<T>;
6770 fn mul(self, rhs: InverseEnergy<T>) -> Self::Output {
6771 InversePressure{per_Pa: self.m3 * rhs.per_J}
6772 }
6773}
6774impl<T> core::ops::Mul<InverseEnergy<T>> for &Volume<T> where T: NumLike {
6776 type Output = InversePressure<T>;
6777 fn mul(self, rhs: InverseEnergy<T>) -> Self::Output {
6778 InversePressure{per_Pa: self.m3.clone() * rhs.per_J}
6779 }
6780}
6781impl<T> core::ops::Mul<&InverseEnergy<T>> for Volume<T> where T: NumLike {
6783 type Output = InversePressure<T>;
6784 fn mul(self, rhs: &InverseEnergy<T>) -> Self::Output {
6785 InversePressure{per_Pa: self.m3 * rhs.per_J.clone()}
6786 }
6787}
6788impl<T> core::ops::Mul<&InverseEnergy<T>> for &Volume<T> where T: NumLike {
6790 type Output = InversePressure<T>;
6791 fn mul(self, rhs: &InverseEnergy<T>) -> Self::Output {
6792 InversePressure{per_Pa: self.m3.clone() * rhs.per_J.clone()}
6793 }
6794}
6795
6796impl<T> core::ops::Mul<InverseTorque<T>> for Volume<T> where T: NumLike {
6799 type Output = InversePressure<T>;
6800 fn mul(self, rhs: InverseTorque<T>) -> Self::Output {
6801 InversePressure{per_Pa: self.m3 * rhs.per_Nm}
6802 }
6803}
6804impl<T> core::ops::Mul<InverseTorque<T>> for &Volume<T> where T: NumLike {
6806 type Output = InversePressure<T>;
6807 fn mul(self, rhs: InverseTorque<T>) -> Self::Output {
6808 InversePressure{per_Pa: self.m3.clone() * rhs.per_Nm}
6809 }
6810}
6811impl<T> core::ops::Mul<&InverseTorque<T>> for Volume<T> where T: NumLike {
6813 type Output = InversePressure<T>;
6814 fn mul(self, rhs: &InverseTorque<T>) -> Self::Output {
6815 InversePressure{per_Pa: self.m3 * rhs.per_Nm.clone()}
6816 }
6817}
6818impl<T> core::ops::Mul<&InverseTorque<T>> for &Volume<T> where T: NumLike {
6820 type Output = InversePressure<T>;
6821 fn mul(self, rhs: &InverseTorque<T>) -> Self::Output {
6822 InversePressure{per_Pa: self.m3.clone() * rhs.per_Nm.clone()}
6823 }
6824}
6825
6826impl<T> core::ops::Div<InversePressure<T>> for Volume<T> where T: NumLike {
6829 type Output = Energy<T>;
6830 fn div(self, rhs: InversePressure<T>) -> Self::Output {
6831 Energy{J: self.m3 / rhs.per_Pa}
6832 }
6833}
6834impl<T> core::ops::Div<InversePressure<T>> for &Volume<T> where T: NumLike {
6836 type Output = Energy<T>;
6837 fn div(self, rhs: InversePressure<T>) -> Self::Output {
6838 Energy{J: self.m3.clone() / rhs.per_Pa}
6839 }
6840}
6841impl<T> core::ops::Div<&InversePressure<T>> for Volume<T> where T: NumLike {
6843 type Output = Energy<T>;
6844 fn div(self, rhs: &InversePressure<T>) -> Self::Output {
6845 Energy{J: self.m3 / rhs.per_Pa.clone()}
6846 }
6847}
6848impl<T> core::ops::Div<&InversePressure<T>> for &Volume<T> where T: NumLike {
6850 type Output = Energy<T>;
6851 fn div(self, rhs: &InversePressure<T>) -> Self::Output {
6852 Energy{J: self.m3.clone() / rhs.per_Pa.clone()}
6853 }
6854}
6855
6856impl<T> core::ops::Mul<Pressure<T>> for Volume<T> where T: NumLike {
6859 type Output = Energy<T>;
6860 fn mul(self, rhs: Pressure<T>) -> Self::Output {
6861 Energy{J: self.m3 * rhs.Pa}
6862 }
6863}
6864impl<T> core::ops::Mul<Pressure<T>> for &Volume<T> where T: NumLike {
6866 type Output = Energy<T>;
6867 fn mul(self, rhs: Pressure<T>) -> Self::Output {
6868 Energy{J: self.m3.clone() * rhs.Pa}
6869 }
6870}
6871impl<T> core::ops::Mul<&Pressure<T>> for Volume<T> where T: NumLike {
6873 type Output = Energy<T>;
6874 fn mul(self, rhs: &Pressure<T>) -> Self::Output {
6875 Energy{J: self.m3 * rhs.Pa.clone()}
6876 }
6877}
6878impl<T> core::ops::Mul<&Pressure<T>> for &Volume<T> where T: NumLike {
6880 type Output = Energy<T>;
6881 fn mul(self, rhs: &Pressure<T>) -> Self::Output {
6882 Energy{J: self.m3.clone() * rhs.Pa.clone()}
6883 }
6884}
6885
6886impl<T> core::ops::Div<VolumePerMass<T>> for Volume<T> where T: NumLike {
6889 type Output = Mass<T>;
6890 fn div(self, rhs: VolumePerMass<T>) -> Self::Output {
6891 Mass{kg: self.m3 / rhs.m3_per_kg}
6892 }
6893}
6894impl<T> core::ops::Div<VolumePerMass<T>> for &Volume<T> where T: NumLike {
6896 type Output = Mass<T>;
6897 fn div(self, rhs: VolumePerMass<T>) -> Self::Output {
6898 Mass{kg: self.m3.clone() / rhs.m3_per_kg}
6899 }
6900}
6901impl<T> core::ops::Div<&VolumePerMass<T>> for Volume<T> where T: NumLike {
6903 type Output = Mass<T>;
6904 fn div(self, rhs: &VolumePerMass<T>) -> Self::Output {
6905 Mass{kg: self.m3 / rhs.m3_per_kg.clone()}
6906 }
6907}
6908impl<T> core::ops::Div<&VolumePerMass<T>> for &Volume<T> where T: NumLike {
6910 type Output = Mass<T>;
6911 fn div(self, rhs: &VolumePerMass<T>) -> Self::Output {
6912 Mass{kg: self.m3.clone() / rhs.m3_per_kg.clone()}
6913 }
6914}
6915
6916impl<T> core::ops::Div<Volume<T>> for f64 where T: NumLike+From<f64> {
6919 type Output = InverseVolume<T>;
6920 fn div(self, rhs: Volume<T>) -> Self::Output {
6921 InverseVolume{per_m3: T::from(self) / rhs.m3}
6922 }
6923}
6924impl<T> core::ops::Div<Volume<T>> for &f64 where T: NumLike+From<f64> {
6926 type Output = InverseVolume<T>;
6927 fn div(self, rhs: Volume<T>) -> Self::Output {
6928 InverseVolume{per_m3: T::from(self.clone()) / rhs.m3}
6929 }
6930}
6931impl<T> core::ops::Div<&Volume<T>> for f64 where T: NumLike+From<f64> {
6933 type Output = InverseVolume<T>;
6934 fn div(self, rhs: &Volume<T>) -> Self::Output {
6935 InverseVolume{per_m3: T::from(self) / rhs.m3.clone()}
6936 }
6937}
6938impl<T> core::ops::Div<&Volume<T>> for &f64 where T: NumLike+From<f64> {
6940 type Output = InverseVolume<T>;
6941 fn div(self, rhs: &Volume<T>) -> Self::Output {
6942 InverseVolume{per_m3: T::from(self.clone()) / rhs.m3.clone()}
6943 }
6944}
6945
6946impl<T> core::ops::Div<Volume<T>> for f32 where T: NumLike+From<f32> {
6949 type Output = InverseVolume<T>;
6950 fn div(self, rhs: Volume<T>) -> Self::Output {
6951 InverseVolume{per_m3: T::from(self) / rhs.m3}
6952 }
6953}
6954impl<T> core::ops::Div<Volume<T>> for &f32 where T: NumLike+From<f32> {
6956 type Output = InverseVolume<T>;
6957 fn div(self, rhs: Volume<T>) -> Self::Output {
6958 InverseVolume{per_m3: T::from(self.clone()) / rhs.m3}
6959 }
6960}
6961impl<T> core::ops::Div<&Volume<T>> for f32 where T: NumLike+From<f32> {
6963 type Output = InverseVolume<T>;
6964 fn div(self, rhs: &Volume<T>) -> Self::Output {
6965 InverseVolume{per_m3: T::from(self) / rhs.m3.clone()}
6966 }
6967}
6968impl<T> core::ops::Div<&Volume<T>> for &f32 where T: NumLike+From<f32> {
6970 type Output = InverseVolume<T>;
6971 fn div(self, rhs: &Volume<T>) -> Self::Output {
6972 InverseVolume{per_m3: T::from(self.clone()) / rhs.m3.clone()}
6973 }
6974}
6975
6976impl<T> core::ops::Div<Volume<T>> for i64 where T: NumLike+From<i64> {
6979 type Output = InverseVolume<T>;
6980 fn div(self, rhs: Volume<T>) -> Self::Output {
6981 InverseVolume{per_m3: T::from(self) / rhs.m3}
6982 }
6983}
6984impl<T> core::ops::Div<Volume<T>> for &i64 where T: NumLike+From<i64> {
6986 type Output = InverseVolume<T>;
6987 fn div(self, rhs: Volume<T>) -> Self::Output {
6988 InverseVolume{per_m3: T::from(self.clone()) / rhs.m3}
6989 }
6990}
6991impl<T> core::ops::Div<&Volume<T>> for i64 where T: NumLike+From<i64> {
6993 type Output = InverseVolume<T>;
6994 fn div(self, rhs: &Volume<T>) -> Self::Output {
6995 InverseVolume{per_m3: T::from(self) / rhs.m3.clone()}
6996 }
6997}
6998impl<T> core::ops::Div<&Volume<T>> for &i64 where T: NumLike+From<i64> {
7000 type Output = InverseVolume<T>;
7001 fn div(self, rhs: &Volume<T>) -> Self::Output {
7002 InverseVolume{per_m3: T::from(self.clone()) / rhs.m3.clone()}
7003 }
7004}
7005
7006impl<T> core::ops::Div<Volume<T>> for i32 where T: NumLike+From<i32> {
7009 type Output = InverseVolume<T>;
7010 fn div(self, rhs: Volume<T>) -> Self::Output {
7011 InverseVolume{per_m3: T::from(self) / rhs.m3}
7012 }
7013}
7014impl<T> core::ops::Div<Volume<T>> for &i32 where T: NumLike+From<i32> {
7016 type Output = InverseVolume<T>;
7017 fn div(self, rhs: Volume<T>) -> Self::Output {
7018 InverseVolume{per_m3: T::from(self.clone()) / rhs.m3}
7019 }
7020}
7021impl<T> core::ops::Div<&Volume<T>> for i32 where T: NumLike+From<i32> {
7023 type Output = InverseVolume<T>;
7024 fn div(self, rhs: &Volume<T>) -> Self::Output {
7025 InverseVolume{per_m3: T::from(self) / rhs.m3.clone()}
7026 }
7027}
7028impl<T> core::ops::Div<&Volume<T>> for &i32 where T: NumLike+From<i32> {
7030 type Output = InverseVolume<T>;
7031 fn div(self, rhs: &Volume<T>) -> Self::Output {
7032 InverseVolume{per_m3: T::from(self.clone()) / rhs.m3.clone()}
7033 }
7034}
7035
7036#[cfg(feature="num-bigfloat")]
7039impl<T> core::ops::Div<Volume<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
7040 type Output = InverseVolume<T>;
7041 fn div(self, rhs: Volume<T>) -> Self::Output {
7042 InverseVolume{per_m3: T::from(self) / rhs.m3}
7043 }
7044}
7045#[cfg(feature="num-bigfloat")]
7047impl<T> core::ops::Div<Volume<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
7048 type Output = InverseVolume<T>;
7049 fn div(self, rhs: Volume<T>) -> Self::Output {
7050 InverseVolume{per_m3: T::from(self.clone()) / rhs.m3}
7051 }
7052}
7053#[cfg(feature="num-bigfloat")]
7055impl<T> core::ops::Div<&Volume<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
7056 type Output = InverseVolume<T>;
7057 fn div(self, rhs: &Volume<T>) -> Self::Output {
7058 InverseVolume{per_m3: T::from(self) / rhs.m3.clone()}
7059 }
7060}
7061#[cfg(feature="num-bigfloat")]
7063impl<T> core::ops::Div<&Volume<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
7064 type Output = InverseVolume<T>;
7065 fn div(self, rhs: &Volume<T>) -> Self::Output {
7066 InverseVolume{per_m3: T::from(self.clone()) / rhs.m3.clone()}
7067 }
7068}
7069
7070#[cfg(feature="num-complex")]
7073impl<T> core::ops::Div<Volume<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
7074 type Output = InverseVolume<T>;
7075 fn div(self, rhs: Volume<T>) -> Self::Output {
7076 InverseVolume{per_m3: T::from(self) / rhs.m3}
7077 }
7078}
7079#[cfg(feature="num-complex")]
7081impl<T> core::ops::Div<Volume<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
7082 type Output = InverseVolume<T>;
7083 fn div(self, rhs: Volume<T>) -> Self::Output {
7084 InverseVolume{per_m3: T::from(self.clone()) / rhs.m3}
7085 }
7086}
7087#[cfg(feature="num-complex")]
7089impl<T> core::ops::Div<&Volume<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
7090 type Output = InverseVolume<T>;
7091 fn div(self, rhs: &Volume<T>) -> Self::Output {
7092 InverseVolume{per_m3: T::from(self) / rhs.m3.clone()}
7093 }
7094}
7095#[cfg(feature="num-complex")]
7097impl<T> core::ops::Div<&Volume<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
7098 type Output = InverseVolume<T>;
7099 fn div(self, rhs: &Volume<T>) -> Self::Output {
7100 InverseVolume{per_m3: T::from(self.clone()) / rhs.m3.clone()}
7101 }
7102}
7103
7104#[cfg(feature="num-complex")]
7107impl<T> core::ops::Div<Volume<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
7108 type Output = InverseVolume<T>;
7109 fn div(self, rhs: Volume<T>) -> Self::Output {
7110 InverseVolume{per_m3: T::from(self) / rhs.m3}
7111 }
7112}
7113#[cfg(feature="num-complex")]
7115impl<T> core::ops::Div<Volume<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
7116 type Output = InverseVolume<T>;
7117 fn div(self, rhs: Volume<T>) -> Self::Output {
7118 InverseVolume{per_m3: T::from(self.clone()) / rhs.m3}
7119 }
7120}
7121#[cfg(feature="num-complex")]
7123impl<T> core::ops::Div<&Volume<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
7124 type Output = InverseVolume<T>;
7125 fn div(self, rhs: &Volume<T>) -> Self::Output {
7126 InverseVolume{per_m3: T::from(self) / rhs.m3.clone()}
7127 }
7128}
7129#[cfg(feature="num-complex")]
7131impl<T> core::ops::Div<&Volume<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
7132 type Output = InverseVolume<T>;
7133 fn div(self, rhs: &Volume<T>) -> Self::Output {
7134 InverseVolume{per_m3: T::from(self.clone()) / rhs.m3.clone()}
7135 }
7136}
7137
7138
7139