From 1a8d6c1ac9cc7262a60936fb9cceb3225e170a46 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 25 Oct 2021 20:55:46 +0200 Subject: [PATCH] frontend: avoid division by zero Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/127ef01a429af2e7ba5d7c2da70bfd93b50d437c Author: Jacek Jendrzej Date: 2021-10-25 (Mon, 25 Oct 2021) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/zapit/src/frontend.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/zapit/src/frontend.cpp b/src/zapit/src/frontend.cpp index ff75370cc..7b3ee7abe 100644 --- a/src/zapit/src/frontend.cpp +++ b/src/zapit/src/frontend.cpp @@ -2483,8 +2483,11 @@ double calcAzimuth(double SatLon, double SiteLat, double SiteLon, int Height_ove if (alfa_r_north < 0) Azimuth = 180 + Deg(ATAN(alfa_ry / alfa_r_north)); else + { + if(alfa_r_north == 0) + alfa_r_north = 0.0001;; Azimuth = Rev(360 + Deg(ATAN(alfa_ry / alfa_r_north))); - + } return Azimuth; }