From 59847e7a80ef9efe2b17c57263a9ed32ef810440 Mon Sep 17 00:00:00 2001 From: Ethan Coon Date: Mon, 2 Oct 2023 11:12:00 -0400 Subject: [PATCH] fixes bug in aspect in the NW quadrant due to mistake in cmath constant --- .../elevation/meshed_elevation_evaluator.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pks/flow/constitutive_relations/elevation/meshed_elevation_evaluator.cc b/src/pks/flow/constitutive_relations/elevation/meshed_elevation_evaluator.cc index 770f5e152..641c41b51 100644 --- a/src/pks/flow/constitutive_relations/elevation/meshed_elevation_evaluator.cc +++ b/src/pks/flow/constitutive_relations/elevation/meshed_elevation_evaluator.cc @@ -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