Main Page   Namespace List   Compound List   File List   Compound Members   File Members  

astro::JulianDate Class Reference

store a Julian Date. More...

#include <JulianDate.h>

List of all members.

Public Methods

 JulianDate (int An, int Me, int Gio, double utc)
 Initialize from:. More...

 JulianDate (double jd)
 conversion constructor. More...

 operator double () const
 allow to be treated as a double, for arithmetic for example. More...

double seconds () const

Public Attributes

enum secondsPerDay = 60*60*24 }

Private Attributes

double m_JD


Detailed Description

store a Julian Date.

Julian dates (abbreviated JD) are a continuous count of days and fractions since noon Universal Time on January 1, 4713 BCE (on the Julian calendar).

Author:
Gino Tosti (primary) , Toby Burnett (convert to a class)
Id:
JulianDate.h,v 1.2 2002/08/14 14:37:30 burnett Exp

Definition at line 18 of file JulianDate.h.


Constructor & Destructor Documentation

astro::JulianDate::JulianDate int    An,
int    Me,
int    Gio,
double    utc
[inline]
 

Initialize from:.

Parameters:
An  year
Me  month
Gio  day
utc  hours

Definition at line 43 of file JulianDate.h.

00044 {
00045     if (Me > 2);
00046     else {
00047         An = An - 1;
00048         Me = Me + 12;
00049     }
00050     int A = (An / 100); 
00051     int B = 2 - A + (A / 4);
00052     long int C = (long int)(365.25 * An); 
00053     if (An < 0) C = C - 1;
00054     int D = (int)(30.6001 * (Me + 1));
00055     m_JD = B + C + D + Gio + 1720994.5+ utc / 24.;
00056 }

astro::JulianDate::JulianDate double    jd [inline]
 

conversion constructor.

Definition at line 30 of file JulianDate.h.

00030 :m_JD(jd){}


Member Function Documentation

astro::JulianDate::operator double   const [inline]
 

allow to be treated as a double, for arithmetic for example.

Definition at line 33 of file JulianDate.h.

00033 {return m_JD;}

double astro::JulianDate::seconds   const [inline]
 

Definition at line 35 of file JulianDate.h.

00035 { return m_JD* secondsPerDay;}


Member Data Documentation

double astro::JulianDate::m_JD [private]
 

Definition at line 40 of file JulianDate.h.

enum astro::JulianDate::secondsPerDay = 60*60*24 }
 

Definition at line 37 of file JulianDate.h.


The documentation for this class was generated from the following file:
Generated on Wed Aug 14 10:09:36 2002 for astro by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001