Code Monkey home page Code Monkey logo

orbit's Introduction

Orbit

Computing planetary positions solely based on the tutorials on the following site:

http://www.stjarnhimlen.se/comp/ppcomp.html

Usage

Node.js

// Compute mercury's orbital elements by time
var orbit = require('orbit');

var mercury = orbit.mercury;            // pre-defined element in the API
var time = new Date("April 19, 1990"); 	// time to compute positions for
var mercuryElements = orbit.computeOrbitalElementsByTime(mercury, time);

Produces:

{ date: Thu Apr 19 1990 00:00:00 GMT-0700 (PDT),
  d: -3543,
  orbitalElements:
   { N: 48.2162988259,
     i: 7.00452285,
     w: 29.088158390799997,
     a: 0.387098,
     e: 0.205633019463,
     M: 69.51529041759932 },
  E: 81.15715124786009,
  ecliptic:
   { x: -0.3678208693993786,
     y: 0.061084529098483234,
     z: 0.038699088054971874 },
  spherical:
   { r: 0.3748614825201232,
     lon: 170.57086510954474,
     lat: 5.925527266740476 } } }

orbit's People

Contributors

aaghevli avatar treeform avatar

Stargazers

Stephen Richardson  avatar Mel Florance avatar Chaz Straney avatar Paul avatar

Watchers

 avatar

Forkers

treeform

orbit's Issues

npm package

Hey,

Just curious if you'd be willing to discuss transferring this npm package? I can show you some details on what I've been working on, it's a large project of the same name. I'm nearing launch and would be keen to use the name for it, I think it'd be worthy!

Let me know, feel free to email it's in my profile.

toDateNumber incorrect

I've been comparing moon positions with the Horizons calculator and is shows the 'toDateNumber' calculation is incorrect by 1 or 2 depending on rounding.

The correct code should just be:
function toDateNumber(date) { var diff = (date - new Date("2000-01-01T00:00")); return (1 + diff.valueOf()/86400e3); }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.