Formatting update
parent
5f1583a6fc
commit
0fc2d8f57f
8
Eci.cpp
8
Eci.cpp
|
@ -17,8 +17,8 @@ void Eci::ToEci(const Julian& date, const CoordGeodetic &g)
|
|||
/*
|
||||
* take into account earth flattening
|
||||
*/
|
||||
const double c = 1.0 /
|
||||
sqrt(1.0 + kF * (kF - 2.0) * pow(sin(g.latitude), 2.0));
|
||||
const double c = 1.0
|
||||
/ sqrt(1.0 + kF * (kF - 2.0) * pow(sin(g.latitude), 2.0));
|
||||
const double s = pow(1.0 - kF, 2.0) * c;
|
||||
const double achcp = (kXKMPER * c + g.altitude) * cos(g.latitude);
|
||||
|
||||
|
@ -54,8 +54,8 @@ CoordGeodetic Eci::ToGeodetic() const
|
|||
// 180 >= lon < 180
|
||||
const double lon = fmod(theta - date_.ToGreenwichSiderealTime(), kPI);
|
||||
|
||||
const double r = sqrt((position_.x * position_.x) +
|
||||
(position_.y * position_.y));
|
||||
const double r = sqrt((position_.x * position_.x)
|
||||
+ (position_.y * position_.y));
|
||||
|
||||
static const double e2 = kF * (2.0 - kF);
|
||||
|
||||
|
|
23
Observer.cpp
23
Observer.cpp
|
@ -1,11 +1,10 @@
|
|||
#include "Observer.h"
|
||||
|
||||
#include "Globals.h"
|
||||
|
||||
/*
|
||||
* calculate lookangle between the observer and the passed in Eci object
|
||||
*/
|
||||
CoordTopographic Observer::GetLookAngle(const Eci &eci) {
|
||||
CoordTopographic Observer::GetLookAngle(const Eci &eci)
|
||||
{
|
||||
|
||||
/*
|
||||
* update the observers Eci to match the time of the Eci passed in
|
||||
|
@ -31,21 +30,23 @@ CoordTopographic Observer::GetLookAngle(const Eci &eci) {
|
|||
double sin_theta = sin(theta);
|
||||
double cos_theta = cos(theta);
|
||||
|
||||
double top_s = sin_lat * cos_theta * range.x +
|
||||
sin_lat * sin_theta * range.y -
|
||||
cos_lat * range.z;
|
||||
double top_e = -sin_theta * range.x +
|
||||
cos_theta * range.y;
|
||||
double top_z = cos_lat * cos_theta * range.x +
|
||||
cos_lat * sin_theta * range.y +
|
||||
sin_lat * range.z;
|
||||
double top_s = sin_lat * cos_theta * range.x
|
||||
+ sin_lat * sin_theta * range.y - cos_lat * range.z;
|
||||
double top_e = -sin_theta * range.x
|
||||
+ cos_theta * range.y;
|
||||
double top_z = cos_lat * cos_theta * range.x
|
||||
+ cos_lat * sin_theta * range.y + sin_lat * range.z;
|
||||
double az = atan(-top_e / top_s);
|
||||
|
||||
if (top_s > 0.0)
|
||||
{
|
||||
az += kPI;
|
||||
}
|
||||
|
||||
if (az < 0.0)
|
||||
{
|
||||
az += 2.0 * kPI;
|
||||
}
|
||||
|
||||
double el = asin(top_z / range.w);
|
||||
double rate = range.Dot(range_rate) / range.w;
|
||||
|
|
Loading…
Reference in New Issue