Home Reference Source
import {Ephem} from 'spacekit/src/Ephem.js'
public class | source

Ephem

A class representing Kepler ephemerides.

Example:

const NEPTUNE = new Ephem({
  epoch: 2458426.500000000,
  a: 3.009622263428050E+01,
  e: 7.362571187193770E-03,
  i: 1.774569249829094E+00,
  om: 1.318695882492132E+02,
  w: 2.586226409499831E+02,
  ma: 3.152804988924479E+02,
}, 'deg'),

Constructor Summary

Public Constructor
public

constructor(initialValues: Object, units: 'deg' | 'rad')

Method Summary

Public Methods
public

copy(): *

public

get(attr: String, units: 'deg' | 'rad'): *

Gets an ephemerides attribute.

public

lock()

Make this ephem object immutable.

public

set(attr: String, val: Number, units: 'deg' | 'rad'): boolean

Sets an ephemerides attribute.

Public Constructors

public constructor(initialValues: Object, units: 'deg' | 'rad') source

Params:

NameTypeAttributeDescription
initialValues Object

A dictionary of initial values. Not all values are required as some may be inferred from others.

initialValues.a Number

Semimajor axis

initialValues.e Number

Eccentricity

initialValues.i Number

Inclination

initialValues.epoch Number

Epoch in JD

initialValues.period Number

Period in days

initialValues.ma Number

Mean anomaly

initialValues.n Number

Mean motion

initialValues.L Number

Mean longitude

initialValues.om Number

Longitude of Ascending Node

initialValues.w Number

Argument of Perihelion

initialValues.wBar Number

Longitude of Perihelion

initialValues.GM GM

Standard gravitational parameter in km^3/s^2. Defaults to GM.SUN. @see {GM}

units 'deg' | 'rad'

The unit of angles in the list of initial values.

Public Methods

public copy(): * source

Return:

*

public get(attr: String, units: 'deg' | 'rad'): * source

Gets an ephemerides attribute.

Params:

NameTypeAttributeDescription
attr String

The name of the attribute (e.g. 'a')

units 'deg' | 'rad'

The unit of angle desired, if applicable. This input is ignored for values that are not angle measurements.

Return:

*

public lock() source

Make this ephem object immutable.

public set(attr: String, val: Number, units: 'deg' | 'rad'): boolean source

Sets an ephemerides attribute.

Params:

NameTypeAttributeDescription
attr String

The name of the attribute (e.g. 'a')

val Number

The value of the attribute (e.g. 0.5)

units 'deg' | 'rad'

The unit of angle provided, if applicable.

Return:

boolean