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

Orbit

A class that builds a visual representation of a Kepler orbit.

Example:

const orbit = new Spacekit.Orbit({
  ephem: new Spacekit.Ephem({...}),
  options: {
    color: 0xFFFFFF,
    eclipticLineColor: 0xCCCCCC,
  },
});

Constructor Summary

Public Constructor
public

constructor(ephem: Ephem, options: Object)

Method Summary

Public Methods
public

getEllipse(): THREE.Line

public

Get the color of this orbit.

public

getLinesToEcliptic(): THREE.Geometry

A geometry containing line segments that run between the orbit ellipse and the ecliptic plane of the solar system.

public

Get heliocentric position of object at a given JD.

public

Get the visibility of this orbit.

public

setHexColor(hexVal: Number)

public

Change the visibility of this orbit.

Public Constructors

public constructor(ephem: Ephem, options: Object) source

Params:

NameTypeAttributeDescription
ephem Ephem

The ephemerides that define this orbit.

options Object
options.color Object

The color of the orbital ellipse.

options.eclipticLineColor Object

The color of lines drawn perpendicular to the ecliptic in order to illustrate depth (defaults to 0x333333).

Public Methods

public getEllipse(): THREE.Line source

Return:

THREE.Line

The ellipse object that represents this orbit.

public getHexColor(): Number source

Get the color of this orbit.

Return:

Number

The hexadecimal color of the orbital ellipse.

public getLinesToEcliptic(): THREE.Geometry source

A geometry containing line segments that run between the orbit ellipse and the ecliptic plane of the solar system. This is a useful visual effect that makes it easy to tell when an orbit goes below or above the ecliptic plane.

Return:

THREE.Geometry

A geometry with many line segments.

public getPositionAtTime(jd: Number, debug: boolean): Array<Number> source

Get heliocentric position of object at a given JD.

Params:

NameTypeAttributeDescription
jd Number

Date value in JD.

debug boolean

Set true for debug output.

Return:

Array<Number>

[X, Y, Z] coordinates

public getVisibility(): boolean source

Get the visibility of this orbit.

Return:

boolean

Whether the orbital ellipse is visible. Note that although the ellipse may not be visible, it is still present in the underlying Scene and Simultation.

public setHexColor(hexVal: Number) source

Params:

NameTypeAttributeDescription
hexVal Number

The hexadecimal color of the orbital ellipse.

public setVisibility(val: boolean) source

Change the visibility of this orbit.

Params:

NameTypeAttributeDescription
val boolean

Whether to show the orbital ellipse.