Struct RadiationBeam
pub struct RadiationBeam {
pub power: f64,
pub area: f64,
}Expand description
A simple beam characterized by total power and illuminated area.
Fields§
§power: f64Beam power in watts.
area: f64Beam cross-sectional area in square meters.
Implementations§
§impl RadiationBeam
impl RadiationBeam
pub fn new(power: f64, area: f64) -> Option<RadiationBeam>
pub fn new(power: f64, area: f64) -> Option<RadiationBeam>
Creates a beam from non-negative finite power and positive finite area.
pub fn intensity(&self) -> Option<f64>
pub fn intensity(&self) -> Option<f64>
Computes beam intensity.
§Examples
use use_radiation::RadiationBeam;
let beam = RadiationBeam::new(10.0, 2.0).ok_or("expected beam")?;
assert_eq!(beam.intensity(), Some(5.0));pub fn photon_flux(&self, photon_energy: f64) -> Option<f64>
pub fn photon_flux(&self, photon_energy: f64) -> Option<f64>
Computes photon flux for this beam.
pub fn photon_flux_density(&self, photon_energy: f64) -> Option<f64>
pub fn photon_flux_density(&self, photon_energy: f64) -> Option<f64>
Computes photon flux density for this beam.
Trait Implementations§
§impl Clone for RadiationBeam
impl Clone for RadiationBeam
§fn clone(&self) -> RadiationBeam
fn clone(&self) -> RadiationBeam
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for RadiationBeam
impl Debug for RadiationBeam
§impl PartialEq for RadiationBeam
impl PartialEq for RadiationBeam
impl Copy for RadiationBeam
impl StructuralPartialEq for RadiationBeam
Auto Trait Implementations§
impl Freeze for RadiationBeam
impl RefUnwindSafe for RadiationBeam
impl Send for RadiationBeam
impl Sync for RadiationBeam
impl Unpin for RadiationBeam
impl UnsafeUnpin for RadiationBeam
impl UnwindSafe for RadiationBeam
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