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§
Source§impl RadiationBeam
impl RadiationBeam
Sourcepub 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.
Sourcepub 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));Sourcepub 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.
Sourcepub 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§
Source§impl Clone for RadiationBeam
impl Clone for RadiationBeam
Source§fn clone(&self) -> RadiationBeam
fn clone(&self) -> RadiationBeam
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RadiationBeam
impl Debug for RadiationBeam
Source§impl PartialEq for RadiationBeam
impl PartialEq for RadiationBeam
Source§fn eq(&self, other: &RadiationBeam) -> bool
fn eq(&self, other: &RadiationBeam) -> bool
Tests for
self and other values to be equal, and is used by ==.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