Skip to content

Commit

Permalink
replace manual 0.5 * PI with FRAC_PI_2
Browse files Browse the repository at this point in the history
  • Loading branch information
ntBre committed Jul 19, 2024
1 parent d3c6d08 commit 9013db1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions spectro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#![allow(clippy::too_many_arguments, clippy::needless_range_loop)]

use std::{
collections::HashMap, f64::consts::PI, fmt::Debug, fs::File, io::Result,
path::Path,
collections::HashMap, f64::consts::FRAC_PI_2, f64::consts::PI, fmt::Debug,
fs::File, io::Result, path::Path,
};

use consts::ALPHA_CONST;
Expand Down Expand Up @@ -566,14 +566,14 @@ impl Spectro {
lxm[(ncomp1, imode2)] / lxm[(ncomp1, imode1)],
)
} else if iz2x == 0 {
0.5 * PI
FRAC_PI_2
} else if iz2y == 0 {
f64::atan(
-1.0 * lxm[(ncomp2, imode1)]
/ lxm[(ncomp1, imode2)],
)
} else {
0.5 * PI
FRAC_PI_2
}
} else {
if self.rotor.is_linear() {
Expand All @@ -586,7 +586,7 @@ impl Spectro {
/ lxm[(ncomp3, imode2)],
)
} else if lxm[(ncomp3, imode1)].abs() > TOLER {
0.5 * PI
FRAC_PI_2
} else {
eprintln!(
"lxm[(ncomp3, imode2)] = {}",
Expand Down

0 comments on commit 9013db1

Please sign in to comment.