orsa_body.cc File Reference

#include "orsa_body.h"
#include "orsa_error.h"
#include "orsa_file.h"
#include <algorithm>
#include <iostream>

Include dependency graph for orsa_body.cc:

Go to the source code of this file.

Namespaces

namespace  orsa
namespace  std

Functions

static double local_mass (const JPL_planets planet)
static double local_J2 (const JPL_planets planet)
static double local_J3 (const JPL_planets planet)
static double local_J4 (const JPL_planets planet)
static double local_C22 (const JPL_planets planet)
static double local_C31 (const JPL_planets planet)
static double local_C32 (const JPL_planets planet)
static double local_C33 (const JPL_planets planet)
static double local_C41 (const JPL_planets planet)
static double local_C42 (const JPL_planets planet)
static double local_C43 (const JPL_planets planet)
static double local_C44 (const JPL_planets planet)
static double local_S31 (const JPL_planets planet)
static double local_S32 (const JPL_planets planet)
static double local_S33 (const JPL_planets planet)
static double local_S41 (const JPL_planets planet)
static double local_S42 (const JPL_planets planet)
static double local_S43 (const JPL_planets planet)
static double local_S44 (const JPL_planets planet)
void Interpolate (const vector< BodyWithParameter > &b_in, const double x, Body &b_out, Body &err_b_out)
void print (const Body &b)


Function Documentation

void Interpolate const vector< BodyWithParameter > &  b_in,
const double  x,
Body &  b_out,
Body &  err_b_out
 

Definition at line 442 of file orsa_body.cc.

00442                                                                                                         {
00443     
00444     unsigned int n_points = b_in.size();
00445     
00446     Vector p_interpolated, err_p_interpolated;
00447     Vector v_interpolated, err_v_interpolated;
00448     
00449     unsigned int j;
00450     
00451     vector<VectorWithParameter> pp(n_points), vv(n_points);
00452     
00453     for(j=0;j<n_points;j++) {
00454       pp[j].Set(b_in[j].position());
00455       vv[j].Set(b_in[j].velocity());
00456       pp[j].par = vv[j].par = b_in[j].par; 
00457     }
00458     
00459     Interpolate(pp,x,p_interpolated,err_p_interpolated);
00460     Interpolate(vv,x,v_interpolated,err_v_interpolated);
00461     
00462     b_out = b_in[0];
00463     b_out.SetPosition(p_interpolated);
00464     b_out.SetVelocity(v_interpolated);
00465     
00466     err_b_out = b_in[0];
00467     err_b_out.SetPosition(err_p_interpolated);
00468     err_b_out.SetVelocity(err_v_interpolated);
00469     
00470   }

static double local_C22 const JPL_planets  planet  )  [static]
 

Definition at line 278 of file orsa_body.cc.

References JPLFile::GetTag(), orsa::jpl_file, and orsa::MOON.

Referenced by JPLBody::JPLBody().

00278                                                     {
00279     if (planet == MOON) {
00280       return jpl_file->GetTag("C22M");
00281     } else {
00282       return 0.0;
00283     }
00284   }

Here is the call graph for this function:

static double local_C31 const JPL_planets  planet  )  [static]
 

Definition at line 286 of file orsa_body.cc.

References JPLFile::GetTag(), orsa::jpl_file, and orsa::MOON.

Referenced by JPLBody::JPLBody().

00286                                                     {
00287     if (planet == MOON) {
00288       return jpl_file->GetTag("C31M");
00289     } else {
00290       return 0.0;
00291     }
00292   }

Here is the call graph for this function:

static double local_C32 const JPL_planets  planet  )  [static]
 

Definition at line 294 of file orsa_body.cc.

References JPLFile::GetTag(), orsa::jpl_file, and orsa::MOON.

Referenced by JPLBody::JPLBody().

00294                                                     {
00295     if (planet == MOON) {
00296       return jpl_file->GetTag("C32M");
00297     } else {
00298       return 0.0;
00299     }
00300   }

Here is the call graph for this function:

static double local_C33 const JPL_planets  planet  )  [static]
 

Definition at line 302 of file orsa_body.cc.

References JPLFile::GetTag(), orsa::jpl_file, and orsa::MOON.

Referenced by JPLBody::JPLBody().

00302                                                     {
00303     if (planet == MOON) {
00304       return jpl_file->GetTag("C33M");
00305     } else {
00306       return 0.0;
00307     }
00308   }

Here is the call graph for this function:

static double local_C41 const JPL_planets  planet  )  [static]
 

Definition at line 310 of file orsa_body.cc.

References JPLFile::GetTag(), orsa::jpl_file, and orsa::MOON.

Referenced by JPLBody::JPLBody().

00310                                                     {
00311     if (planet == MOON) {
00312       return jpl_file->GetTag("C41M");
00313     } else {
00314       return 0.0;
00315     }
00316   }

Here is the call graph for this function:

static double local_C42 const JPL_planets  planet  )  [static]
 

Definition at line 318 of file orsa_body.cc.

References JPLFile::GetTag(), orsa::jpl_file, and orsa::MOON.

Referenced by JPLBody::JPLBody().

00318                                                     {
00319     if (planet == MOON) {
00320       return jpl_file->GetTag("C42M");
00321     } else {
00322       return 0.0;
00323     }
00324   }

Here is the call graph for this function:

static double local_C43 const JPL_planets  planet  )  [static]
 

Definition at line 326 of file orsa_body.cc.

References JPLFile::GetTag(), orsa::jpl_file, and orsa::MOON.

Referenced by JPLBody::JPLBody().

00326                                                     {
00327     if (planet == MOON) {
00328       return jpl_file->GetTag("C43M");
00329     } else {
00330       return 0.0;
00331     }
00332   }

Here is the call graph for this function:

static double local_C44 const JPL_planets  planet  )  [static]
 

Definition at line 334 of file orsa_body.cc.

References JPLFile::GetTag(), orsa::jpl_file, and orsa::MOON.

Referenced by JPLBody::JPLBody().

00334                                                     {
00335     if (planet == MOON) {
00336       return jpl_file->GetTag("C44M");
00337     } else {
00338       return 0.0;
00339     }
00340   }

Here is the call graph for this function:

static double local_J2 const JPL_planets  planet  )  [static]
 

Definition at line 247 of file orsa_body.cc.

References orsa::EARTH, JPLFile::GetTag(), orsa::jpl_file, orsa::MOON, and orsa::SUN.

Referenced by JPLBody::JPLBody().

00247                                                    {
00248     double J2_ = 0.0;
00249     switch (planet) {
00250     case SUN:   J2_ = jpl_file->GetTag("J2SUN"); break;
00251     case EARTH: J2_ = jpl_file->GetTag("J2E");   break;
00252     case MOON:  J2_ = jpl_file->GetTag("J2M");   break;
00253     default: /*********************************/ break;
00254     }
00255     return J2_;
00256   }

Here is the call graph for this function:

static double local_J3 const JPL_planets  planet  )  [static]
 

Definition at line 258 of file orsa_body.cc.

References orsa::EARTH, JPLFile::GetTag(), orsa::jpl_file, and orsa::MOON.

Referenced by JPLBody::JPLBody().

00258                                                    {
00259     double J3_ = 0.0;
00260     switch (planet) {
00261     case EARTH: J3_ = jpl_file->GetTag("J3E");   break;
00262     case MOON:  J3_ = jpl_file->GetTag("J3M");   break;
00263     default: /*********************************/ break;
00264     }
00265     return J3_;
00266   }

Here is the call graph for this function:

static double local_J4 const JPL_planets  planet  )  [static]
 

Definition at line 268 of file orsa_body.cc.

References orsa::EARTH, JPLFile::GetTag(), orsa::jpl_file, and orsa::MOON.

Referenced by JPLBody::JPLBody().

00268                                                    {
00269     double J4_ = 0.0;
00270     switch (planet) {
00271     case EARTH: J4_ = jpl_file->GetTag("J4E");   break;
00272     case MOON:  J4_ = jpl_file->GetTag("J4M");   break;
00273     default: /*********************************/ break;
00274     }
00275     return J4_;
00276   }

Here is the call graph for this function:

static double local_mass const JPL_planets  planet  )  [static]
 

Definition at line 243 of file orsa_body.cc.

References JPLFile::GetMass(), and orsa::jpl_file.

Referenced by JPLBody::JPLBody().

00243                                                      {
00244     return jpl_file->GetMass(planet);
00245   }

Here is the call graph for this function:

static double local_S31 const JPL_planets  planet  )  [static]
 

Definition at line 342 of file orsa_body.cc.

References JPLFile::GetTag(), orsa::jpl_file, and orsa::MOON.

Referenced by JPLBody::JPLBody().

00342                                                     {
00343     if (planet == MOON) {
00344       return jpl_file->GetTag("S31M");
00345     } else {
00346       return 0.0;
00347     }
00348   }

Here is the call graph for this function:

static double local_S32 const JPL_planets  planet  )  [static]
 

Definition at line 350 of file orsa_body.cc.

References JPLFile::GetTag(), orsa::jpl_file, and orsa::MOON.

Referenced by JPLBody::JPLBody().

00350                                                     {
00351     if (planet == MOON) {
00352       return jpl_file->GetTag("S32M");
00353     } else {
00354       return 0.0;
00355     }
00356   }

Here is the call graph for this function:

static double local_S33 const JPL_planets  planet  )  [static]
 

Definition at line 358 of file orsa_body.cc.

References JPLFile::GetTag(), orsa::jpl_file, and orsa::MOON.

Referenced by JPLBody::JPLBody().

00358                                                     {
00359     if (planet == MOON) {
00360       return jpl_file->GetTag("S33M");
00361     } else {
00362       return 0.0;
00363     }
00364   }

Here is the call graph for this function:

static double local_S41 const JPL_planets  planet  )  [static]
 

Definition at line 366 of file orsa_body.cc.

References JPLFile::GetTag(), orsa::jpl_file, and orsa::MOON.

Referenced by JPLBody::JPLBody().

00366                                                     {
00367     if (planet == MOON) {
00368       return jpl_file->GetTag("S41M");
00369     } else {
00370       return 0.0;
00371     }
00372   }

Here is the call graph for this function:

static double local_S42 const JPL_planets  planet  )  [static]
 

Definition at line 374 of file orsa_body.cc.

References JPLFile::GetTag(), orsa::jpl_file, and orsa::MOON.

Referenced by JPLBody::JPLBody().

00374                                                     {
00375     if (planet == MOON) {
00376       return jpl_file->GetTag("S42M");
00377     } else {
00378       return 0.0;
00379     }
00380   }

Here is the call graph for this function:

static double local_S43 const JPL_planets  planet  )  [static]
 

Definition at line 382 of file orsa_body.cc.

References JPLFile::GetTag(), orsa::jpl_file, and orsa::MOON.

Referenced by JPLBody::JPLBody().

00382                                                     {
00383     if (planet == MOON) {
00384       return jpl_file->GetTag("S43M");
00385     } else {
00386       return 0.0;
00387     }
00388   }

Here is the call graph for this function:

static double local_S44 const JPL_planets  planet  )  [static]
 

Definition at line 390 of file orsa_body.cc.

References JPLFile::GetTag(), orsa::jpl_file, and orsa::MOON.

Referenced by JPLBody::JPLBody().

00390                                                     {
00391     if (planet == MOON) {
00392       return jpl_file->GetTag("S44M");
00393     } else {
00394       return 0.0;
00395     }
00396   }

Here is the call graph for this function:

void print const Body &  b  ) 
 

Definition at line 472 of file orsa_body.cc.

Referenced by orsa::print().

00472                             {
00473     cout << "body name:   " << b.name() << "   mass: " << b.mass() << endl;
00474     /* if (b.parent) {
00475        cout << "parent body: " << b.parent->name() << endl;
00476        }
00477     */
00478 
00479     cout << "position:    " << b.position().x << " " << b.position().y << " " << b.position().z << endl;
00480     cout << "velocity:    " << b.velocity().x << " " << b.velocity().y << " " << b.velocity().z << endl;
00481   }


Generated on Tue Jan 11 15:26:36 2005 for liborsa by  doxygen 1.4.0