Skip to content

Commit

Permalink
use euclidean remainder for wind direction average to get value betwe…
Browse files Browse the repository at this point in the history
…en 0 and 360
  • Loading branch information
shieldo committed Feb 27, 2025
1 parent 00eb910 commit c894373
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/external_conditions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ impl ExternalConditions {
// but this could potentially change in the future - the precision is marked as "unspecified".
let wind_direction_average = y_average.atan2(x_average).to_degrees();

wind_direction_average % 360.
wind_direction_average.rem_euclid(360.) // cannot use % operator here as we need lowest non-negative remainder, which % does not give us
}

pub fn diffuse_horizontal_radiation(&self, timestep_idx: usize) -> f64 {
Expand Down

0 comments on commit c894373

Please sign in to comment.