sgp4/Coord.h

139 lines
2.7 KiB
C
Raw Normal View History

2011-03-24 15:55:10 +00:00
#ifndef COORD_H_
#define COORD_H_
class CoordGeodetic {
2011-03-24 15:55:10 +00:00
public:
CoordGeodetic()
2011-03-24 15:55:10 +00:00
: lat_(0.0), lon_(0.0), alt_(0.0) {
}
/*
* radians
*/
CoordGeodetic(double latitude, double longitude, double altitude)
2011-03-24 15:55:10 +00:00
: lat_(latitude), lon_(longitude), alt_(altitude) {
}
CoordGeodetic(const CoordGeodetic& g);
virtual ~CoordGeodetic() {
2011-03-24 15:55:10 +00:00
};
CoordGeodetic & operator =(const CoordGeodetic& b);
bool operator ==(const CoordGeodetic& b) const;
bool operator !=(const CoordGeodetic& b) const;
void SetLatitude(const double latitude) {
2011-03-24 15:55:10 +00:00
lat_ = latitude;
}
void SetLongitude(const double longitude) {
2011-03-24 15:55:10 +00:00
lon_ = longitude;
}
void SetAltitude(const double altitude) {
2011-03-24 15:55:10 +00:00
alt_ = altitude;
}
double GetLatitude() const {
return lat_;
}
double GetLongitude() const {
return lon_;
}
double GetAltitude() const {
return alt_;
}
private:
/*
* radians (north positive, south negative)
*/
double lat_;
/*
* radians (east positive, west negative)
*/
double lon_;
/*
* kilometers
*/
double alt_;
};
class CoordTopographic {
public:
CoordTopographic()
: azimuth_(0.0), elevation_(0.0), range_(0.0), range_rate_(0.0) {
}
CoordTopographic(double azimuth, double elevation, double range, double range_rate)
: azimuth_(azimuth), elevation_(elevation), range_(range), range_rate_(range_rate) {
}
CoordTopographic(const CoordTopographic& b);
2011-03-24 15:55:10 +00:00
virtual ~CoordTopographic() {
};
CoordTopographic & operator =(const CoordTopographic& b);
bool operator ==(const CoordTopographic& b) const;
bool operator !=(const CoordTopographic& b) const;
void SetAzimuth(const double azimuth) {
2011-03-24 15:55:10 +00:00
azimuth_ = azimuth;
}
void SetElevation(const double elevation) {
2011-03-24 15:55:10 +00:00
elevation_ = elevation;
}
void SetRange(const double range) {
2011-03-24 15:55:10 +00:00
range_ = range;
}
void SetRangeRate(const double range_rate) {
2011-03-24 15:55:10 +00:00
range_rate_ = range_rate;
}
double GetAzimuth() const {
return azimuth_;
}
double GetElevation() const {
return elevation_;
}
double GetRange() const {
return range_;
}
double GetRangeRate() const {
return range_rate_;
}
private:
/*
* radians
*/
double azimuth_;
/*
* radians
*/
double elevation_;
/*
* kilometers
*/
double range_;
/*
* kilometers / second
*/
double range_rate_;
};
#endif