/[PAMELA software]/yodaUtility/sgp4/globals.cpp
ViewVC logotype

Contents of /yodaUtility/sgp4/globals.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (show annotations) (download) (vendor branch)
Sun Apr 30 11:08:15 2006 UTC (18 years, 7 months ago) by kusanagi
Branch: MAIN
CVS Tags: yodaUtility2_0/00, yodaUtility1_0/00, yodaUtility2_2/00, yodaUtility2_1/00, HEAD
Changes since 1.1: +0 -0 lines
Error occurred while calculating annotation data.
Various utilities for the yoda environment and its related softwares.
YFile 	   	- Inheriths from TFile     - Add custom features to a TFile object.
YException 	- Inheriths from exception - YODA specific Exceptions.
YMcmd	   	- Decoder for the Mcmd packets.
YSQLConnection 	- Singletn class for DB connections.
yodaUtility     - Various functions.
sgp4		- C++ NORAD SGP4/SDP4 Implementation - Developed by Michael F. Henry.

1 //
2 // globals.cpp
3 //
4 #include "stdafx.h"
5 #include "globals.h"
6
7 //////////////////////////////////////////////////////////////////////////////
8 double sqr(const double x)
9 {
10 return (x * x);
11 }
12
13 //////////////////////////////////////////////////////////////////////////////
14 double Fmod2p(const double arg)
15 {
16 double modu = fmod(arg, TWOPI);
17
18 if (modu < 0.0)
19 modu += TWOPI;
20
21 return modu;
22 }
23
24 //////////////////////////////////////////////////////////////////////////////
25 // AcTan()
26 // ArcTangent of sin(x) / cos(x). The advantage of this function over arctan()
27 // is that it returns the correct quadrant of the angle.
28 double AcTan(const double sinx, const double cosx)
29 {
30 double ret;
31
32 if (cosx == 0.0)
33 {
34 if (sinx > 0.0)
35 ret = PI / 2.0;
36 else
37 ret = 3.0 * PI / 2.0;
38 }
39 else
40 {
41 if (cosx > 0.0)
42 ret = atan(sinx / cosx);
43 else
44 ret = PI + atan(sinx / cosx);
45 }
46
47 return ret;
48 }
49
50 //////////////////////////////////////////////////////////////////////////////
51 double rad2deg(const double r)
52 {
53 const double DEG_PER_RAD = 180.0 / PI;
54 return r * DEG_PER_RAD;
55 }
56
57 //////////////////////////////////////////////////////////////////////////////
58 double deg2rad(const double d)
59 {
60 const double RAD_PER_DEG = PI / 180.0;
61 return d * RAD_PER_DEG;
62 }
63

  ViewVC Help
Powered by ViewVC 1.1.23