Options
All
  • Public
  • Public/Protected
  • All
Menu

Class 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,
  },
});

Hierarchy

  • Orbit

Index

Constructors

constructor

Properties

Private Optional eclipticDropLines

eclipticDropLines: LineSegments<BufferGeometry, Material | Material[]>

Private ephem

Private options

options: OrbitOptions

Private Optional orbitPoints

orbitPoints: Vector3[]

Private Optional orbitShape

orbitShape: Line<BufferGeometry, Material | Material[]>

Private orbitStart

orbitStart: number

Private orbitStop

orbitStop: number

Private orbitType

orbitType: OrbitType

Methods

Private generateAndCacheOrbitShape

  • generateAndCacheOrbitShape(pointVectors: Vector3[]): Line<BufferGeometry, Material | Material[]>
  • Parameters

    • pointVectors: Vector3[]

    Returns Line<BufferGeometry, Material | Material[]>

    Line object

Private getEllipse

  • getEllipse(): Line<BufferGeometry, Material | Material[]>
  • Returns Line<BufferGeometry, Material | Material[]>

    The ellipse object that represents this orbit.

Private getEllipsePoints

  • getEllipsePoints(): Vector3[]
  • Returns Vector3[]

    A THREE.js geometry

getHexColor

  • getHexColor(): number
  • Get the color of this orbit.

    Returns number

    The hexadecimal color of the orbital ellipse.

Private getLine

  • getLine(orbitFn: (jd: number) => Coordinate3d, startJd: number, endJd: number, step: number): Line<BufferGeometry, Material | Material[]>
  • Compute a line between a given date range.

    Parameters

    Returns Line<BufferGeometry, Material | Material[]>

getLinesToEcliptic

  • getLinesToEcliptic(): LineSegments<BufferGeometry, Material | Material[]>
  • 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.

    Returns LineSegments<BufferGeometry, Material | Material[]>

    A geometry with many line segments.

getOrbitShape

  • getOrbitShape(jd?: number, forceCompute?: boolean): Line<BufferGeometry, Material | Material[]>
  • Calculates, caches, and returns the orbit state for this orbit around this time

    Parameters

    • Optional jd: number

      center time of the orbit (only used for ephemeris table ephemeris)

    • forceCompute: boolean = false

      forces the recomputing of the orbit on this call

    Returns Line<BufferGeometry, Material | Material[]>

getPositionAtTime

  • getPositionAtTime(jd: number, debug?: boolean): Coordinate3d
  • Get heliocentric position of object at a given JD.

    Parameters

    • jd: number

      Date value in JD.

    • debug: boolean = false

      Set true for debug output.

    Returns Coordinate3d

    [X, Y, Z] coordinates

getPositionAtTimeElliptical

  • getPositionAtTimeElliptical(jd: number, debug?: boolean): Coordinate3d

getPositionAtTimeHyperbolic

  • getPositionAtTimeHyperbolic(jd: number, debug?: boolean): Coordinate3d

getPositionAtTimeNearParabolic

  • getPositionAtTimeNearParabolic(jd: number, debug?: boolean): Coordinate3d

getPositionAtTimeParabolic

  • getPositionAtTimeParabolic(jd: number, debug?: boolean): Coordinate3d

getPositionAtTimeTable

  • getPositionAtTimeTable(jd: number, debug?: boolean): Coordinate3d

Private getTableOrbit

  • getTableOrbit(startJd: number, stopJd: number, step: number): Line<BufferGeometry, Material | Material[]>
  • Returns the orbit for a table lookup orbit definition

    Parameters

    • startJd: number

      start of orbit in JDate format

    • stopJd: number

      end of orbit in JDate format

    • step: number

      step size in days

    Returns Line<BufferGeometry, Material | Material[]>

getVisibility

  • getVisibility(): boolean
  • Get the visibility of this orbit.

    Returns 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.

needsUpdateForTime

  • needsUpdateForTime(jd: number): boolean
  • Returns whether the requested epoch is within the current orbit's definition. Used only for ephemeris tables.

    Parameters

    • jd: number

    Returns boolean

    true if it is within the orbit span, false if not

setHexColor

  • setHexColor(hexVal: number): void
  • Parameters

    • hexVal: number

      The hexadecimal color of the orbital ellipse.

    Returns void

setVisibility

  • setVisibility(val: boolean): void
  • Change the visibility of this orbit.

    Parameters

    • val: boolean

      Whether to show the orbital ellipse.

    Returns void

vectorToHeliocentric

  • Given true anomaly and heliocentric distance, returns the scaled heliocentric coordinates (X, Y, Z)

    Parameters

    • v: number

      True anomaly

    • r: number

      Heliocentric distance

    Returns Coordinate3d

    Heliocentric coordinates

Static getOrbitType

Generated using TypeDoc