pub struct DayNightCurve {
pub sunrise_temp_c: f32,
pub max_temp_c: f32,
pub sunset_temp_c: f32,
pub min_temp_c: f32,
pub sunrise_h: f32,
pub max_temp_h: f32,
pub sunset_h: f32,
pub min_temp_h: f32,
}Expand description
Models the diurnal temperature variation throughout a 24-hour cycle.
Fields§
§sunrise_temp_c: f32Temperature at sunrise (°C).
max_temp_c: f32Temperature at daily maximum (°C).
sunset_temp_c: f32Temperature at sunset (°C).
min_temp_c: f32Temperature at daily minimum (°C), typically before sunrise.
sunrise_h: f32Hour of sunrise (0–24).
max_temp_h: f32Hour of maximum temperature (0–24), typically 2–3 h after solar noon.
sunset_h: f32Hour of sunset (0–24).
min_temp_h: f32Hour of minimum temperature (0–24), typically just before sunrise.
Implementations§
Source§impl DayNightCurve
impl DayNightCurve
pub fn new( mean_c: f32, amplitude_c: f32, day_length_h: f32, solar_noon: f32, ) -> Self
Sourcepub fn temperature_at(&self, h: f32) -> f32
pub fn temperature_at(&self, h: f32) -> f32
Sample temperature (°C) at time of day h (0–24).
Sourcepub fn day_length_from_lat(lat_deg: f32, day: f32) -> f32
pub fn day_length_from_lat(lat_deg: f32, day: f32) -> f32
Compute day-length hours from latitude and day-of-year.
Trait Implementations§
Source§impl Clone for DayNightCurve
impl Clone for DayNightCurve
Source§fn clone(&self) -> DayNightCurve
fn clone(&self) -> DayNightCurve
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 moreAuto Trait Implementations§
impl Freeze for DayNightCurve
impl RefUnwindSafe for DayNightCurve
impl Send for DayNightCurve
impl Sync for DayNightCurve
impl Unpin for DayNightCurve
impl UnsafeUnpin for DayNightCurve
impl UnwindSafe for DayNightCurve
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.