1 |
//
|
2 |
// cEci.h
|
3 |
//
|
4 |
// Copyright (c) 2003 Michael F. Henry
|
5 |
//
|
6 |
#pragma once
|
7 |
|
8 |
#include "cVector.h"
|
9 |
#include "cJulian.h"
|
10 |
#include "coord.h"
|
11 |
|
12 |
//////////////////////////////////////////////////////////////////////
|
13 |
// class cEci
|
14 |
// Encapsulates an Earth-Centered Inertial position, velocity, and time.
|
15 |
class cEci
|
16 |
{
|
17 |
public:
|
18 |
cEci() { m_VecUnits = UNITS_NONE; }
|
19 |
cEci(const cCoordGeo &geo, const cJulian &cJulian);
|
20 |
cEci(const cVector &pos, const cVector &vel,
|
21 |
const cJulian &date, bool IsAeUnits = true);
|
22 |
virtual ~cEci() {};
|
23 |
|
24 |
cCoordGeo toGeo();
|
25 |
|
26 |
cVector getPos() const { return m_pos; }
|
27 |
cVector getVel() const { return m_vel; }
|
28 |
cJulian getDate() const { return m_date; }
|
29 |
|
30 |
void setUnitsAe() { m_VecUnits = UNITS_AE; }
|
31 |
void setUnitsKm() { m_VecUnits = UNITS_KM; }
|
32 |
bool UnitsAreAe() const { return m_VecUnits == UNITS_AE; }
|
33 |
bool UnitsAreKm() const { return m_VecUnits == UNITS_KM; }
|
34 |
void ae2km(); // Convert position, velocity vector units from AE to km
|
35 |
|
36 |
protected:
|
37 |
void MulPos(double factor) { m_pos.Mul(factor); }
|
38 |
void MulVel(double factor) { m_vel.Mul(factor); }
|
39 |
|
40 |
enum VecUnits
|
41 |
{
|
42 |
UNITS_NONE, // not initialized
|
43 |
UNITS_AE,
|
44 |
UNITS_KM,
|
45 |
};
|
46 |
|
47 |
cVector m_pos;
|
48 |
cVector m_vel;
|
49 |
cJulian m_date;
|
50 |
VecUnits m_VecUnits;
|
51 |
};
|