Vector Class Reference

#include <orsa_coord.h>

Inheritance diagram for Vector:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 Vector ()
 Vector (const Vector &v)
 Vector (double _x, double _y, double _z)
double GetX () const
double GetY () const
double GetZ () const
Vectoroperator+= (const Vector &v)
Vectoroperator-= (const Vector &v)
Vectoroperator *= (const double f)
Vectoroperator/= (const double f)
Vector operator+ () const
Vector operator- () const
Vectorrotate (const double, const double, const double)
void Set (Vector v)
void Set (double _x, double _y, double _z)
double Length () const
double LengthSquared () const
double ManhattanLength () const
bool IsZero () const
Vector Normalized () const
VectorNormalize ()

Public Attributes

double x
double y
double z

Constructor & Destructor Documentation

Vector  )  [inline]
 

Definition at line 38 of file orsa_coord.h.

References Vector::x, Vector::y, and Vector::z.

Referenced by Vector::Normalized(), Vector::operator+(), and Vector::operator-().

00038 : x(0), y(0), z(0) { }

Vector const Vector v  )  [inline]
 

Definition at line 40 of file orsa_coord.h.

References Vector::x, Vector::y, and Vector::z.

00040 : x(v.x), y(v.y), z(v.z) { }

Vector double  _x,
double  _y,
double  _z
[inline]
 

Definition at line 42 of file orsa_coord.h.

References Vector::x, Vector::y, and Vector::z.

00042 : x(_x), y(_y), z(_z) { }


Member Function Documentation

double GetX  )  const [inline]
 

Definition at line 45 of file orsa_coord.h.

References Vector::x.

00045 { return x; }

double GetY  )  const [inline]
 

Definition at line 46 of file orsa_coord.h.

References Vector::y.

00046 { return y; }

double GetZ  )  const [inline]
 

Definition at line 47 of file orsa_coord.h.

References Vector::z.

00047 { return z; }

bool IsZero  )  const [inline]
 

Definition at line 121 of file orsa_coord.h.

References Vector::x, Vector::y, and Vector::z.

Referenced by JPLPlanetsNewton::Acceleration(), ArmonicOscillator::Acceleration(), Relativistic::Acceleration(), orsa::ComputeAcceleration(), ArmonicOscillator::PotentialEnergy(), and Newton::PotentialEnergy().

00121                                {
00122       return ((x*x) + (y*y) + (z*z)) < (std::numeric_limits<double>::min() * 1.0e3);
00123     }

double Length  )  const [inline]
 

Definition at line 103 of file orsa_coord.h.

References Vector::x, Vector::y, and Vector::z.

Referenced by JPLPlanetsNewton::Acceleration(), GalacticPotentialAllen::Acceleration(), ArmonicOscillator::Acceleration(), Relativistic::Acceleration(), Orbit::Compute(), orsa::Compute_Gauss(), Sky::Compute_J2000(), Body::distance(), MappedTable::load(), orsa::modified_mu(), Vector::Normalize(), Vector::Normalized(), GalacticPotentialAllen::PotentialEnergy(), ArmonicOscillator::PotentialEnergy(), Newton::PotentialEnergy(), OptimizedOrbitPositions::PropagatedSky_J2000(), orsa::PropagatedSky_J2000(), and orsa::SearchCloseApproaches().

00103                                  {
00104       using std::sqrt;
00105       return sqrt( (x*x) +
00106                    (y*y) +
00107                    (z*z) );
00108     }

double LengthSquared  )  const [inline]
 

Definition at line 110 of file orsa_coord.h.

References Vector::x, Vector::y, and Vector::z.

Referenced by Relativistic::Acceleration(), Newton::Acceleration(), Orbit::Compute(), orsa::Compute_Gauss(), and orsa::ComputeAcceleration().

00110                                         {
00111       return (x*x) +
00112              (y*y) +
00113              (z*z);
00114     }

double ManhattanLength  )  const [inline]
 

Definition at line 116 of file orsa_coord.h.

References Vector::x, Vector::y, and Vector::z.

00116                                           {
00117       using std::fabs;
00118       return (fabs(x)+fabs(y)+fabs(z));
00119     }

Vector& Normalize  )  [inline]
 

Definition at line 134 of file orsa_coord.h.

References Vector::Length(), Vector::x, Vector::y, and Vector::z.

Referenced by orsa::SearchCloseApproaches().

00134                                 {
00135       double l = Length();
00136       if (l > (std::numeric_limits<double>::min() * 1.0e3)) {
00137         x /= l;
00138         y /= l;
00139         z /= l;
00140       } else {
00141         z = 0.0;
00142         y = 0.0;
00143         z = 0.0;
00144       }
00145       return *this;
00146     }

Here is the call graph for this function:

Vector Normalized  )  const [inline]
 

Definition at line 126 of file orsa_coord.h.

References Vector::Length(), Vector::Vector(), Vector::x, Vector::y, and Vector::z.

Referenced by Newton::Acceleration(), orsa::Compute_Gauss(), and orsa::SearchCloseApproaches().

00126                                      {
00127       double l = Length();
00128       if (l > (std::numeric_limits<double>::min() * 1.0e3))
00129         return Vector(x/l, y/l, z/l);
00130       else
00131         return Vector(0.0, 0.0, 0.0);
00132     }

Here is the call graph for this function:

Vector& operator *= const double  f  )  [inline]
 

Definition at line 64 of file orsa_coord.h.

References Vector::x, Vector::y, and Vector::z.

00064                                                  {
00065       x *= f;
00066       y *= f;
00067       z *= f;
00068       return *this;
00069     }

Vector operator+  )  const [inline]
 

Definition at line 79 of file orsa_coord.h.

References Vector::Vector(), Vector::x, Vector::y, and Vector::z.

00079 { return Vector(x,y,z); }   

Here is the call graph for this function:

Vector& operator+= const Vector v  )  [inline]
 

Definition at line 50 of file orsa_coord.h.

References Vector::x, Vector::y, and Vector::z.

00050                                                    {
00051       x += v.x;
00052       y += v.y;
00053       z += v.z;
00054       return *this;
00055     }

Vector operator-  )  const [inline]
 

Definition at line 80 of file orsa_coord.h.

References Vector::Vector(), Vector::x, Vector::y, and Vector::z.

00080 { return Vector(-x,-y,-z); }    

Here is the call graph for this function:

Vector& operator-= const Vector v  )  [inline]
 

Definition at line 57 of file orsa_coord.h.

References Vector::x, Vector::y, and Vector::z.

00057                                                    {
00058       x -= v.x;
00059       y -= v.y;
00060       z -= v.z;
00061       return *this;
00062     }

Vector& operator/= const double  f  )  [inline]
 

Definition at line 71 of file orsa_coord.h.

References Vector::x, Vector::y, and Vector::z.

00071                                                  {
00072       x /= f;
00073       y /= f;
00074       z /= f;
00075       return * this;
00076     }

Vector & rotate const   double,
const   double,
const   double
 

Definition at line 56 of file orsa_coord.cc.

References orsa::c_i, orsa::cos(), orsa::sin(), orsa::sincos(), Vector::x, Vector::y, and Vector::z.

Referenced by Newton::Acceleration(), orsa::Compute_Gauss(), orsa::Compute_TestMethod(), LocationFile::ObsPos(), and TLEFile::Read().

00056                                                                                          {      
00057     
00058 #ifdef HAVE_SINCOS
00059     double s,c;
00060     //
00061     sincos(i,&s,&c);
00062     const double s_i = s;
00063     const double c_i = c;
00064     //
00065     sincos(omega_nod,&s,&c);
00066     const double s_on = s;
00067     const double c_on = c;
00068     //
00069     sincos(omega_per,&s,&c);
00070     const double s_op = s;
00071     const double c_op = c;
00072 #else // HAVE_SINCOS
00073     const double s_i = sin(i);
00074     const double c_i = cos(i);
00075     //
00076     const double s_on = sin(omega_nod);
00077     const double c_on = cos(omega_nod);
00078     //
00079     const double s_op = sin(omega_per);
00080     const double c_op = cos(omega_per);
00081 #endif // HAVE_SINCOS
00082     
00083     // from Mathematica..
00084     /* 
00085        const double new_x = cos(omega_nod)*(x*cos(omega_per) - y*sin(omega_per)) + sin(omega_nod)*(z*sin(i) - cos(i)*(y*cos(omega_per) + x*sin(omega_per)));
00086        const double new_y = -(z*cos(omega_nod)*sin(i)) + cos(i)*cos(omega_nod)*(y*cos(omega_per) + x*sin(omega_per)) + sin(omega_nod) * (x*cos(omega_per) - y*sin(omega_per));
00087        const double new_z = z*cos(i) + sin(i)*(y*cos(omega_per) + x*sin(omega_per));
00088     */
00089     
00090     const double new_x = c_on*(x*c_op - y*s_op) + s_on*(z*s_i - c_i*(y*c_op + x*s_op));
00091     const double new_y = -(z*c_on*s_i) + c_i*c_on*(y*c_op + x*s_op) + s_on*(x*c_op - y*s_op);
00092     const double new_z = z*c_i + s_i*(y*c_op + x*s_op);
00093     
00094     x = new_x; 
00095     y = new_y;
00096     z = new_z;
00097     
00098     return * this;
00099   }

Here is the call graph for this function:

void Set double  _x,
double  _y,
double  _z
[inline]
 

Definition at line 96 of file orsa_coord.h.

References Vector::x, Vector::y, and Vector::z.

00096                                                      {
00097       x = _x;
00098       y = _y;
00099       z = _z;
00100     }

void Set Vector  v  )  [inline]
 

Definition at line 90 of file orsa_coord.h.

References Vector::x, Vector::y, and Vector::z.

Referenced by GalacticPotentialAllenPlusNewton::Acceleration(), JPLPlanetsNewton::Acceleration(), GalacticPotentialAllen::Acceleration(), ArmonicOscillator::Acceleration(), Relativistic::Acceleration(), and Newton::Acceleration().

00090                               {
00091       x = v.x;
00092       y = v.y;
00093       z = v.z;
00094     }


Member Data Documentation

double x
 

Definition at line 149 of file orsa_coord.h.

Referenced by GalacticPotentialAllen::Acceleration(), Orbit::Compute(), orsa::Compute_Gauss(), Sky::Compute_J2000(), orsa::Compute_TestMethod(), orsa::ComputeAcceleration(), orsa::gauss_v_df(), orsa::gauss_v_f(), Vector::GetX(), Vector::IsZero(), Vector::Length(), Vector::LengthSquared(), Vector::ManhattanLength(), Vector::Normalize(), Vector::Normalized(), Vector::operator *=(), Vector::operator+(), Vector::operator+=(), Vector::operator-(), Vector::operator-=(), Vector::operator/=(), GalacticPotentialAllen::PotentialEnergy(), Vector::rotate(), orsa::SearchCloseApproaches(), Vector::Set(), Radau15::Step(), and Vector::Vector().

double y
 

Definition at line 149 of file orsa_coord.h.

Referenced by GalacticPotentialAllen::Acceleration(), Orbit::Compute(), orsa::Compute_Gauss(), Sky::Compute_J2000(), orsa::Compute_TestMethod(), orsa::ComputeAcceleration(), orsa::gauss_v_df(), orsa::gauss_v_f(), Vector::GetY(), Vector::IsZero(), Vector::Length(), Vector::LengthSquared(), Vector::ManhattanLength(), Vector::Normalize(), Vector::Normalized(), Vector::operator *=(), Vector::operator+(), Vector::operator+=(), Vector::operator-(), Vector::operator-=(), Vector::operator/=(), GalacticPotentialAllen::PotentialEnergy(), Vector::rotate(), orsa::SearchCloseApproaches(), Vector::Set(), Radau15::Step(), and Vector::Vector().

double z
 

Definition at line 149 of file orsa_coord.h.

Referenced by GalacticPotentialAllen::Acceleration(), Orbit::Compute(), orsa::Compute_Gauss(), Sky::Compute_J2000(), orsa::Compute_TestMethod(), orsa::ComputeAcceleration(), orsa::gauss_v_df(), orsa::gauss_v_f(), Vector::GetZ(), Vector::IsZero(), Vector::Length(), Vector::LengthSquared(), Vector::ManhattanLength(), Vector::Normalize(), Vector::Normalized(), Vector::operator *=(), Vector::operator+(), Vector::operator+=(), Vector::operator-(), Vector::operator-=(), Vector::operator/=(), GalacticPotentialAllen::PotentialEnergy(), Vector::rotate(), orsa::SearchCloseApproaches(), Vector::Set(), Radau15::Step(), and Vector::Vector().


The documentation for this class was generated from the following files:
Generated on Tue Jan 11 15:28:10 2005 for liborsa by  doxygen 1.4.0