Skip to content

Commit

Permalink
Update simulate.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
johnb432 committed Sep 19, 2024
1 parent d02283d commit 7d17bc4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion extension/src/artillery/simulate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ pub fn find_solution(
let mut angle_root =
(muzzle_velocity.mul_add(*muzzle_velocity, radicand) / (GRAVITY * range_to_hit)).atan();
if angle_root > max_elev || angle_root < min_elev {
angle_root = (muzzle_velocity.mul_add(*muzzle_velocity, -radicand) / (GRAVITY * range_to_hit)).atan();
angle_root = (muzzle_velocity.mul_add(*muzzle_velocity, -radicand)
/ (GRAVITY * range_to_hit))
.atan();
}
if angle_root > max_elev || angle_root < min_elev {
return (-1.0, -1.0, -1.0);
Expand Down

0 comments on commit 7d17bc4

Please sign in to comment.