Add Photon type

This commit is contained in:
Matthew Gordon 2020-09-02 23:21:53 -04:00
parent 8b30ad581e
commit c6acac0567
2 changed files with 13 additions and 0 deletions

View File

@ -1,2 +1,5 @@
pub mod colour_rgb; pub mod colour_rgb;
pub use colour_rgb::{ColourRgbF, ColourRgbU8, NamedColour}; pub use colour_rgb::{ColourRgbF, ColourRgbU8, NamedColour};
pub mod photon;
pub use photon::Photon;

10
src/colour/photon.rs Normal file
View File

@ -0,0 +1,10 @@
/// A quantum of light with a given wavelength and intensity
pub struct Photon {
/// The wavelength in nanometres
pub wavelength: f64,
/// The intensity of the light
///
/// Depending on context, this might represent actual intensity in W/sr,
/// radiant flux in W, irradiance in W/m^2, or radiance in W/(m^2sr).
pub intensity: f64,
}