pub struct Shield {
pub linear_attenuation_coefficient: f64,
pub thickness: f64,
}Expand description
A simple slab shield with a linear attenuation coefficient and thickness.
Fields§
§linear_attenuation_coefficient: f64Linear attenuation coefficient in inverse meters.
thickness: f64Shield thickness in meters.
Implementations§
Source§impl Shield
impl Shield
Sourcepub fn new(
linear_attenuation_coefficient: f64,
thickness: f64,
) -> Option<Shield>
pub fn new( linear_attenuation_coefficient: f64, thickness: f64, ) -> Option<Shield>
Creates a shield from non-negative finite attenuation and thickness values.
Sourcepub fn transmitted_fraction(&self) -> Option<f64>
pub fn transmitted_fraction(&self) -> Option<f64>
Computes transmitted fraction for this shield.
Sourcepub fn attenuated_intensity(&self, initial_intensity: f64) -> Option<f64>
pub fn attenuated_intensity(&self, initial_intensity: f64) -> Option<f64>
Computes attenuated intensity through this shield.
§Examples
use use_radiation::Shield;
let shield = Shield::new(core::f64::consts::LN_2, 1.0).ok_or("expected shield")?;
let attenuated = shield
.attenuated_intensity(100.0)
.ok_or("expected attenuated intensity")?;
assert!((attenuated - 50.0).abs() < 1.0e-12);Trait Implementations§
impl Copy for Shield
impl StructuralPartialEq for Shield
Auto Trait Implementations§
impl Freeze for Shield
impl RefUnwindSafe for Shield
impl Send for Shield
impl Sync for Shield
impl Unpin for Shield
impl UnsafeUnpin for Shield
impl UnwindSafe for Shield
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more