npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sau_remote/kepler.js

v0.0.3

Published

A package for working with two-body Keplerian Orbits

Readme

Kepler.js

Build Status

A package for working with two-body Keplerian Orbits.

Installation

Release pending, but you can source it in your package.json from Github for now.

package.json

{
  "name": "my-package",
  "dependencies": {
    "kepler.js": "jordanstephens/kepler.js"
  }
}

Usage

Defining an Orbit

The easiest way to define an orbit is with common orbital elements.

var qzss = Kepler.Orbit.fromParams({
  semimajorAxis: 42164, // km
  eccentricity: 0.075,
  inclination: 43, // deg
  rightAscension: 195, // deg
  argumentOfPeriapsis: 270 // deg
});

QZSS orbital parameters from Wikipedia.

You can also use more colloquial elements like perigee and apogee instead of semimajorAxis and eccentricity.

var iss = Kepler.Orbit.fromParams({
  apogee: 426.9, // km
  perigee: 416.2, // km
  inclination: 51.65, // deg
  rightAscension: 304.1, // deg
  argumentOfPeriapsis: 117.8 // deg
});

ISS orbital parameters from Wolfram Alpha.

Or you can use position (r) and velocity (v) vectors.

var r = [-6045, -3490, 2500],
    v = [-3.457, 6.618, 2.533],
    orbit = new Kepler.Orbit(r, v);

Orbital Attributes

Defining an orbit gives you access to the object's current position (r) and velocity (v) vectors along with many other attributes, including:

  • semimajorAxis
  • semilatusRectum
  • apoapsis
  • periapsis
  • eccentricity
  • angularMomentum
  • radialVelocity
  • inclination
  • rightAscension
  • argumentOfPeriapsis
  • trueAnomaly
  • period

Updating an Orbit After dt

Once you have an initial orbit defined, you can get updated position (r) and velocity (v) vectors after a period of time (in seconds) has passed.

iss.r // => [4427.6294614883145, 662.2433879237291, 5103.355851378229]
iss.v // => [-3.000020372892516, 6.843005359324254, 1.7091866273043546]

// Update vectors after 45 minutes have passed
iss.update(60 * 45)

iss.r // => [-4662.9620885090435, -88.56494596532605, -4943.141439770972]
iss.v // => [2.5073027532818064, -6.876096362825007, -2.248327189819066]

Caveats

  • Only point objects are considered in a two-body environment.
  • Perturbations due to atmospheric drag, solar radiation, etc are not considered.
  • Nodal precession is not considered.

Tests

Tests can be run with npm

$ npm test

Most of the specs contain values used in examples found in Orbital Mechanics for Engineering Students.