org.orekit.bodies
Class AbstractCelestialBody

java.lang.Object
  extended by org.orekit.bodies.AbstractCelestialBody
All Implemented Interfaces:
java.io.Serializable, CelestialBody, PVCoordinatesProvider

public abstract class AbstractCelestialBody
extends java.lang.Object
implements CelestialBody

Abstract implementation of the CelestialBody interface.

This abstract implementation provides basic services that can be shared by most implementations of the CelestialBody interface. It holds the attraction coefficient and the body-centered frame, and also provides a way to build this frame automatically if not already provided by sub-classes. The only method that still needs to be implemented by sub-classes is the getPVCoordinates method.

Version:
$Revision: 3067 $ $Date: 2010-02-04 13:14:07 +0100 (jeu. 04 févr. 2010) $
Author:
Luc Maisonobe
See Also:
Serialized Form

Constructor Summary
protected AbstractCelestialBody(double gm, Frame frame)
          Build an instance using an existing body-centered frame.
protected AbstractCelestialBody(double gm, java.lang.String frameName, Frame definingFrame)
          Build an instance and the underlying frame.
 
Method Summary
 Frame getFrame()
          Get an inertially oriented body-centered frame.
 double getGM()
          Get the attraction coefficient of the body.
abstract  PVCoordinates getPVCoordinates(AbsoluteDate date, Frame frame)
          Get the PVCoordinates of the body in the selected frame.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCelestialBody

protected AbstractCelestialBody(double gm,
                                Frame frame)
Build an instance using an existing body-centered frame.

Parameters:
gm - attraction coefficient (in m3/s2)
frame - existing body-centered frame to use

AbstractCelestialBody

protected AbstractCelestialBody(double gm,
                                java.lang.String frameName,
                                Frame definingFrame)
Build an instance and the underlying frame.

The underlying body-centered frame built is a direct child of EME2000. Its defining transform is a simple linear translation/velocity transform without any rotation. The frame axes are therefore always parallel to EME2000 frame axes.

Parameters:
gm - attraction coefficient (in m3/s2)
frameName - frame name to use
definingFrame - frame in which celestial body coordinates are defined
Method Detail

getGM

public double getGM()
Get the attraction coefficient of the body.

Specified by:
getGM in interface CelestialBody
Returns:
attraction coefficient of the body (m3/s2)

getFrame

public Frame getFrame()
Get an inertially oriented body-centered frame.

The frame is always bound to the body center, and its axes have a fixed orientation with respect to other inertial frames.

Specified by:
getFrame in interface CelestialBody
Returns:
an inertially oriented body-centered frame

getPVCoordinates

public abstract PVCoordinates getPVCoordinates(AbsoluteDate date,
                                               Frame frame)
                                        throws OrekitException
Get the PVCoordinates of the body in the selected frame.

Specified by:
getPVCoordinates in interface PVCoordinatesProvider
Parameters:
date - current date
frame - the frame where to define the position
Returns:
position/velocity of the body (m and m/s)
Throws:
OrekitException - if position cannot be computed in given frame


Copyright © 2002-2010 CS Communication & Systèmes. All Rights Reserved.