{"id":15649066,"url":"https://github.com/onekiloparsec/aa-js","last_synced_at":"2026-02-20T10:03:01.017Z","repository":{"id":40854416,"uuid":"121948689","full_name":"onekiloparsec/aa-js","owner":"onekiloparsec","description":"A fairly comprehensive collection of accurate astronomical algorithms in JavaScript (TypeScript).","archived":false,"fork":false,"pushed_at":"2026-02-18T20:27:27.000Z","size":3284,"stargazers_count":48,"open_issues_count":0,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2026-02-18T20:49:32.522Z","etag":null,"topics":["astronomy","astronomy-astrophysics","astronomy-library","astronomy-software","coordinates-transformations","moon","planets","sun","transit"],"latest_commit_sha":null,"homepage":"https://onekiloparsec.dev/aa-js/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/onekiloparsec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"onekiloparsec"}},"created_at":"2018-02-18T12:13:07.000Z","updated_at":"2026-02-18T17:56:31.000Z","dependencies_parsed_at":"2024-06-19T16:05:03.009Z","dependency_job_id":"a8435004-18db-407b-8392-362c8f4b0f70","html_url":"https://github.com/onekiloparsec/aa-js","commit_stats":{"total_commits":975,"total_committers":7,"mean_commits":"139.28571428571428","dds":0.1497435897435897,"last_synced_commit":"38a8a9440d7b3f6ad7b77bd4a0820ed548ea58cb"},"previous_names":["onekiloparsec/aa.js"],"tags_count":91,"template":false,"template_full_name":null,"purl":"pkg:github/onekiloparsec/aa-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onekiloparsec%2Faa-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onekiloparsec%2Faa-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onekiloparsec%2Faa-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onekiloparsec%2Faa-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onekiloparsec","download_url":"https://codeload.github.com/onekiloparsec/aa-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onekiloparsec%2Faa-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29626891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T18:02:07.722Z","status":"ssl_error","status_checked_at":"2026-02-19T18:01:46.144Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["astronomy","astronomy-astrophysics","astronomy-library","astronomy-software","coordinates-transformations","moon","planets","sun","transit"],"created_at":"2024-10-03T12:27:33.705Z","updated_at":"2026-02-20T10:03:01.011Z","avatar_url":"https://github.com/onekiloparsec.png","language":"TypeScript","funding_links":["https://github.com/sponsors/onekiloparsec"],"categories":[],"sub_categories":[],"readme":"aa-js\n============\n\n![build and test](https://github.com/onekiloparsec/aa-js/actions/workflows/nodejs.yml/badge.svg?branch=master) [![codecov](https://codecov.io/gh/onekiloparsec/aa-js/graph/badge.svg?token=EfRJpZ4OTu)](https://codecov.io/gh/onekiloparsec/aa-js)\n\nA fairly comprehensive collection of accurate astronomical algorithms (AA) in JavaScript (TypeScript). \nIt started as an implementation of AA, but it is not yet complete.\n\nAt the beginning, `aa-js` is the port in javascript of the C++ implementation of Astronomical\nAlgorithms by J.P. Naughter, called [AA+](http://www.naughter.com/aa.html),\nbased on the reference text book by Jean Meeus. It is written in TypeScript, and\ncovered as much as possible with tests validating the correctness\nof the algorithms. Tests are inspired from Jean Meeus' book and those written in\nSwiftAA, and are much more extended than what is available\nin AA+.\n\nOther AA\nimplementations: [Swift (SwiftAA)](https://github.com/onekiloparsec/SwiftAA), [C# (AASharp)](https://github.com/jsauve/AASharp).\n\n\n`aa-js` is the backbone of scientific algorithms used\nin [Arcsecond.io](https://www.arcsecond.io).\n\n\nMain Changes in V4\n================\n\nThe v3 offered arbitrary-precision computations, thanks to [decimal.js](https://github.com/MikeMcl/decimal.js).\nBut it was thousands (if not millions) of times slower than the original implementation, making its usage in a browser\nvery difficult. After some nightly hours to optimise it and having most of both implementations side-by-side, we decided\nto remove decimal.js entirely.\n\nNo big API changes, except there are no more Decimal.js at all, and thus no `highPrecision` parameter. The method\nsignatures have not changed, but all return types are based on `number` instead of Decimal.\n\nSmall changes:\n\n- The return type of `getJulianDay` is now always `JulianDay` and not `JulianDay | undefined`. If really the build of a\n  JD is not correct, `J2000` is returned with a warning.\n\nMain Changes in V3\n================\n\n- ~~All algorithms based on arbitrary-precision operations thanks\n  to [decimal.js](https://github.com/MikeMcl/decimal.js).~~\n- **BREAKING** (since v3.2) Equatorial coordinates uses right ascension expressed in `Degree` not `Hour`.\n- **BREAKING** (since v3.2) Input parameters of the `coordinates` modules now use complete coordinates objects, rather\n  than individual members to reduce the number of parameters in the functions.\n- ~~**BREAKING** (since v3.4) The precision of Decimal.js is not set to a default value. It is left to the consumer.~~\n- Moved all (non-Earth) planets modules inside a `planets` folder.\n- **Addition of numerous orbital getters for planets** (mean longitude, semi-major axis, inclination, eccentricity...)\n- Much easier and cleaner distinction between *heliocentric* and *geocentric* coordinates of planets.\n- Added easy accessor for apparent geocentric equatorial coordinates of planets.\n- Added a transformation from equatorial to *topocentric* coordinates.\n- Important bugfix on `getPositionAngle` and `getPhaseAngle` in the `Moon` module.\n- Added easy accessors for rise, transit and set times for every planet.\n- Numerous bugfixes, and added methods for dates, julian days\n\nAvailable Modules\n================\n\n* Planets: all the (static and dynamic) details, coordinates, quantities about\n  `Mercury`, `Venus`, `Mars`, `Jupiter`, `Saturn`, `Neptune` and of course `Pluto`: planet constants, aphelion,\n  perihelion, phase angle, illuminated fraction, magnitude, semi-diameters, heliocentric \u0026 geocentric coordinates,\n  distance from earth, velocities, orbital details etc.\n* In addition, for `Mars`: the planetocentric declination of the Sun and the\n  Earth.\n* In addition, for `Jupiter`: the planetocentric declination of the Sun and the\n  Earth.\n* In addition, for `Saturn`: the details of the rings system.\n* `Sun`: mean \u0026 true anomaly, coordinates.\n* `Earth`: all the coordinates, mean anomaly, radius vector (distance) etc.\n* Inside `Earth` module: `nutation`: in longitude, for obliquity, true \u0026 mean obliquity of the ecliptic.\n* Inside `Earth` module: `aberration`: ecliptic and equatorial.\n* `Earth.Moon`: phases, age, apparent coordinates etc.\n* `juliandays`: creation, transformation, local mean sidereal time.\n* `times`: transformation between UTC, TT, AI, UT1...\n* `cosmology`: the cosmology calculator from Ned Wright's, but re-implemented, and tested.\n* `distances`: all the conversions of small and extra-galactic distances.\n* `coordinates`: all computation of parallactic angle, great circle angle, precessions, transformations (equatorial to\n  ecliptic, galactic, topocentric, and inverse etc.).\n* `sexagesimal`: utilities for transforming values between decimal and sexagesimal.\n* `risetransitset`: get rise, transit and set hours, dates, julian days, as well\n  as altitude.\n* `exoplanets`: **WIP** module to hold exoplanet transit details calculations.\n  as altitude.\n\nInstallation\n================\n\n`npm install aa-js`\n\n\nUsage\n================\n\n```\nimport { juliandays, Earth } from 'aa-js'\n\nconst jd = juliandays.getJulianDay(new Date())\nconst coords = Earth.Moon.getEquatorialCoordinates(jd)\n```\n\nDocumentation\n================\n\nAlmost every method is documented (quite sparingly\nsometimes). A good knowledge of basic astronomy helps very much.\nA copy of the Astronomical Algorithms textbook, by Jean Meeus\n([amazon](https://www.amazon.fr/Astronomical-Algorithms-J-Meeus/dp/0943396352/ref=sr_1_6?qid=1654447735\u0026refinements=p_27%3AJean+Meeus\u0026s=books\u0026sr=1-6))\nwould also help, since many methods refer to it.\n\nThe documentation is published in [onekiloparsec.dev/aa-js](https://onekiloparsec.dev/aa-js).\n\nBenchmarks\n================\n\nTo run benchmarks, install `vite-node` globally (`npm i -g vite-node`), then run\nindividual benchmark like this:\n\n```bash\nnpx vite-node benchmark/planets/jupiter/apparent-equatorial-coordinates.js\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonekiloparsec%2Faa-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonekiloparsec%2Faa-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonekiloparsec%2Faa-js/lists"}