Updated Observer
parent
4aab9bf601
commit
6e2de1facd
27
Observer.cpp
27
Observer.cpp
|
@ -2,33 +2,6 @@
|
||||||
|
|
||||||
#include "Globals.h"
|
#include "Globals.h"
|
||||||
|
|
||||||
/*
|
|
||||||
* in degrees!
|
|
||||||
*/
|
|
||||||
Observer::Observer(const double latitude, const double longitude, const double altitude)
|
|
||||||
: geo_(DegreesToRadians(latitude), DegreesToRadians(longitude), altitude),
|
|
||||||
observers_eci_(Julian(), geo_)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Observer::Observer(const CoordGeodetic &geo)
|
|
||||||
: geo_(geo), observers_eci_(Julian(), geo_)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Observer::~Observer(void) {
|
|
||||||
}
|
|
||||||
|
|
||||||
void Observer::UpdateObserversEci(const Julian &date) {
|
|
||||||
|
|
||||||
/*
|
|
||||||
* if date has changed, update for new date
|
|
||||||
*/
|
|
||||||
if (observers_eci_.GetDate() != date) {
|
|
||||||
observers_eci_ = Eci(date, geo_);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* calculate lookangle between the observer and the passed in Eci object
|
* calculate lookangle between the observer and the passed in Eci object
|
||||||
*/
|
*/
|
||||||
|
|
42
Observer.h
42
Observer.h
|
@ -6,29 +6,53 @@
|
||||||
#include "Julian.h"
|
#include "Julian.h"
|
||||||
#include "Eci.h"
|
#include "Eci.h"
|
||||||
|
|
||||||
class Observer {
|
class Observer
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
Observer(const double latitude, const double longitude, const double altitude);
|
Observer(double latitude, double longitude, double altitude)
|
||||||
Observer(const CoordGeodetic &geo);
|
: geo_(latitude, longitude, altitude),
|
||||||
virtual ~Observer(void);
|
observers_eci_(Julian(), geo_)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void SetLocation(const CoordGeodetic& geo) {
|
Observer(const CoordGeodetic &g)
|
||||||
geo_ = geo;
|
: geo_(g), observers_eci_(Julian(), geo_)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual ~Observer()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetLocation(const CoordGeodetic& g)
|
||||||
|
{
|
||||||
|
geo_ = g;
|
||||||
observers_eci_ = Eci(observers_eci_.GetDate(), geo_);
|
observers_eci_ = Eci(observers_eci_.GetDate(), geo_);
|
||||||
}
|
}
|
||||||
|
|
||||||
CoordGeodetic GetLocation() const {
|
CoordGeodetic GetLocation() const
|
||||||
|
{
|
||||||
return geo_;
|
return geo_;
|
||||||
}
|
}
|
||||||
|
|
||||||
Eci GetEciPosition(const Julian &date) const {
|
Eci GetEciPosition(const Julian &date) const
|
||||||
|
{
|
||||||
return Eci(date, geo_);
|
return Eci(date, geo_);
|
||||||
}
|
}
|
||||||
|
|
||||||
CoordTopographic GetLookAngle(const Eci &eci);
|
CoordTopographic GetLookAngle(const Eci &eci);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void UpdateObserversEci(const Julian &date);
|
void UpdateObserversEci(const Julian &date)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* if date has changed, update for new date
|
||||||
|
*/
|
||||||
|
if (observers_eci_.GetDate() != date)
|
||||||
|
{
|
||||||
|
observers_eci_ = Eci(date, geo_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* the observers position
|
* the observers position
|
||||||
|
|
Loading…
Reference in New Issue