Skip to content

Commit

Permalink
Math.abs for safety
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrupczak3 committed Apr 21, 2023
1 parent ecf3133 commit 15b1e16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/src/main/java/com/openathena/TargetGetter.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public static double minArcAngle(double lat0, double lon0, double lat1, double l
lon0 = Math.toRadians(lon0);
lat1 = Math.toRadians(lat1);
lon1 = Math.toRadians(lon1);
return Math.toDegrees(Math.acos(cos(lat0)*cos(lat1)*cos(lon0-lon1) + sin(lat0)*sin(lat1)));
return Math.abs(Math.toDegrees(Math.acos(cos(lat0)*cos(lat1)*cos(lon0-lon1) + sin(lat0)*sin(lat1))));
}

/**
Expand Down

0 comments on commit 15b1e16

Please sign in to comment.