GithubHelp home page GithubHelp logo

vndmtrx / js_astro Goto Github PK

View Code? Open in Web Editor NEW

This project forked from astsakai/js_astro

0.0 1.0 0.0 32 KB

Sample code for astrological calculation written by JavaScript

License: MIT License

JavaScript 100.00%

js_astro's Introduction

js_astro

Sample code for astrological calculation written by JavaScript.

This library intent to:

  • calculation of major planetary position(geocentric, apparent longitude) for 0-4000 A.D. within 1 arcminute.
  • calculation of house cusp longitudes

Requirement

Environment

Newest Browser, but all comments are written in Japanese(Shift-JIS).

Library

Some functions requires spirntf.js, but if you don't want to use function cnv2*, not required.

License

Files in this repository are released under MIT license.

Usage

Calculate for planetary position

Include all libraries, and call calPlanetPositon2 as:

var planetPosition = new Array();
planetPosition = calPlanetPosition2( year, month, day, hour, minute, longitude, latitude );

calPlanetPosition2 returns array of 15 values:

  • Julian day
  • Planetary Position(Geocentric apparent ecliptic longitude): Sun, Moon, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto
  • Lunar Node & apogee Longitude(from approximate osculate orbital elements)
  • Longitude of Ascendant, MC(Mid heaven)
    • All value is expressed in degree, without Julian day.

Calculate for house cusp longitudes

Include all libraries, and call calHouseCusp2 as:

var cuspLongitudes = new Array();
cuspLongitudes = calHouseCusp2( year, month, day, hour, minute, longitude, latitude, 1 );

Last Argument 1 means Placidus house system.

calHouseCusp2 returns array of house cusp longitude(Index of this array starts 1, not 0).

Important notice

Timezone used in this library is Japan Standard Time(UTC+0900). You may consider to wrapper function to convert your local timezone. I never consider any Daylight Saving Time in past and future.

This library assumes eastern geographical longitude and northern geographical latitude as plus(eg. Tokyo: 139E42 = +139.70, 35N41 = +35.68).

Demonstration

To test this library, try this.

Errata for Leaflet written in Japanese

This library has a leaflet, and this leaflet has some error. Errata is here.

js_astro's People

Contributors

astsakai avatar

Watchers

 avatar

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.