Skip to content

Commit

Permalink
fixes bug in aspect in the NW quadrant due to mistake in cmath constant
Browse files Browse the repository at this point in the history
  • Loading branch information
ecoon committed Oct 2, 2023
1 parent 797362e commit 59847e7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ slope_aspect(const AmanziGeometry::Point& normal, double& slope, double& aspect)
// left half
if (normal[1] > 0.0) {
// upper left quadrant
aspect = M_2_PI - std::atan(-normal[0] / normal[1]);
aspect = 2 * M_PI - std::atan(-normal[0] / normal[1]);
} else if (normal[1] < 0.0) {
// lower left quadrant
aspect = M_PI + std::atan(normal[0] / -normal[1]);
} else {
// due west
aspect = M_2_PI - M_PI_2;
aspect = 3 * M_PI_2;
}
} else {
// north or south
Expand Down

0 comments on commit 59847e7

Please sign in to comment.