atm_refraction/paths/mod.rs
1pub(crate) mod flat;
2pub(crate) mod spherical;
3
4use crate::RayState;
5
6/// The trait representing a light path.
7pub trait Path<'a> {
8 /// Returns the altitude (in meters) at which the path is passing at the given distance (in
9 /// meters) from the initial point.
10 fn h_at_dist(&self, dist: f64) -> f64;
11 /// Returns the angle (in radians) between the path and the horizontal plane at the given
12 /// distance (in meters) from the initial point.
13 fn angle_at_dist(&self, dist: f64) -> f64;
14 /// Returns a "stepper" - an iterator that performs one integration step along the path on
15 /// every call to `next()`
16 fn into_path_stepper(self) -> Box<dyn PathStepper<Item = RayState> + 'a>;
17}
18
19/// The trait representing a "stepper" - an iterator performing one integration step along the
20/// path on every call to `next()`
21pub trait PathStepper: Iterator {
22 /// Sets the step size for the iterations
23 fn set_step_size(&mut self, step: f64);
24}