summaryrefslogtreecommitdiff
path: root/positioner.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2013-10-10 14:21:44 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2013-10-10 14:21:44 +0200
commit7c72f7932992b4dffa84857567f8ccadc49ad571 (patch)
treeae3e5707914908046d78689e71ba0c8a8178404f /positioner.c
parentbf52b1a2e39d080cdad50973c99810c46f83ff1a (diff)
downloadvdr-7c72f7932992b4dffa84857567f8ccadc49ad571.tar.gz
vdr-7c72f7932992b4dffa84857567f8ccadc49ad571.tar.bz2
Changed some variable names in positioner.c to match the names used in the page with the explanation on vdr-portal.de
Diffstat (limited to 'positioner.c')
-rw-r--r--positioner.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/positioner.c b/positioner.c
index 7adcc735..8b9d2703 100644
--- a/positioner.c
+++ b/positioner.c
@@ -7,7 +7,7 @@
* For an explanation (in German) of the theory behind the calculations see
* http://www.vdr-portal.de/board17-developer/board97-vdr-core/p1154305-grundlagen-und-winkelberechnungen-f%C3%BCr-h-h-diseqc-motor-antennenanlagen
*
- * $Id: positioner.c 3.1 2013/08/21 11:02:52 kls Exp $
+ * $Id: positioner.c 3.2 2013/10/10 14:14:10 kls Exp $
*/
#include "positioner.h"
@@ -49,20 +49,20 @@ int cPositioner::NormalizeAngle(int Angle)
int cPositioner::CalcHourAngle(int Longitude)
{
- double Delta = RAD(Longitude - Setup.SiteLon);
+ double Alpha = RAD(Longitude - Setup.SiteLon);
double Lat = RAD(Setup.SiteLat);
int Sign = Setup.SiteLat >= 0 ? -1 : 1; // angles to the right are positive, angles to the left are negative
- return Sign * round(DEG(atan2(sin(Delta), cos(Delta) - cos(Lat) * SAT_EARTH_RATIO)));
+ return Sign * round(DEG(atan2(sin(Alpha), cos(Alpha) - cos(Lat) * SAT_EARTH_RATIO)));
}
int cPositioner::CalcLongitude(int HourAngle)
{
double Lat = RAD(Setup.SiteLat);
double Lon = RAD(Setup.SiteLon);
- double Alpha = RAD(HourAngle);
- double Delta = Alpha - asin(sin(M_PI - Alpha) * cos(Lat) * SAT_EARTH_RATIO);
+ double Delta = RAD(HourAngle);
+ double Alpha = Delta - asin(sin(M_PI - Delta) * cos(Lat) * SAT_EARTH_RATIO);
int Sign = Setup.SiteLat >= 0 ? 1 : -1;
- return NormalizeAngle(round(DEG(Lon - Sign * Delta)));
+ return NormalizeAngle(round(DEG(Lon - Sign * Alpha)));
}
int cPositioner::HorizonLongitude(ePositionerDirection Direction)