Galactic
Celestial coordinate conversions and utilities
Usage
The following examples use some basic transforms:
var { return deg/180 * MathPI; };var { return rad*180 / MathPI; };
Where is alpha centauri in the sky above Toronto right now?
// Create coordinate in equatorial coordinate systemvar centauri = ; // Observer (Toronto, now)var observer = latitude: longitude: utc: Date; // Convert to horizontal given observer place/timevar horizontal = centauri; // Where is it?console;
Where is the sun in the skies of Toronto?
// Create coordinate in equatorial coordinate system// Calculate sun's mean longitude (approx)var n = galacticdates - galacticdatesJ2000var meanLongitude = 28046 + 09856474*nvar sun = ; // Observer (Toronto, now)var observer = latitude: longitude: utc: Date; // Convert to horizontal given observer place/timevar horizontal = sun; // Where is it?console;
Building
npm install
grunt
AMD and CJS compatible formats will be created in dist/
To Do
- Document API
- Example usage
- Clean up coordinate transforms API supporting multiple coord formats
- Extract celestial body definitions to generalize
- Add handy additional functions, e.g. sun and moon positions given date
- NPM prepublish compile step