Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

astronomia

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

astronomia

An astronomical library

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
155K
decreased by-2.59%
Maintainers
1
Weekly downloads
 
Created

What is astronomia?

The astronomia npm package provides a collection of algorithms and functions for astronomical calculations. It includes tools for computing positions of celestial bodies, converting between different time scales, and performing various other astronomical computations.

What are astronomia's main functionalities?

Compute Positions of Celestial Bodies

This feature allows you to compute the positions of planets. The code sample demonstrates how to compute the position of Earth on a given date.

const { planetposition, data } = require('astronomia');
const earth = new planetposition.Planet(data.earth);
const jupiter = new planetposition.Planet(data.jupiter);
const date = new Date('2023-10-01');
const pos = earth.position(date);
console.log(pos);

Convert Between Time Scales

This feature allows you to convert between different time scales, such as Julian Date and Gregorian Calendar. The code sample shows how to convert a Gregorian date to Julian Date and back.

const { julian, cal } = require('astronomia');
const jd = julian.CalendarGregorianToJD(2023, 10, 1);
const date = cal.JDToCalendarGregorian(jd);
console.log(date);

Compute Rise, Transit, and Set Times

This feature allows you to compute the rise, transit, and set times of celestial bodies. The code sample demonstrates how to compute these times for the Sun as observed from Berlin on a given date.

const { rise } = require('astronomia');
const observer = { lat: 52.5200, lon: 13.4050 }; // Berlin
const date = new Date('2023-10-01');
const times = rise.times(observer, date, 'sun');
console.log(times);

Other packages similar to astronomia

Keywords

FAQs

Package last updated on 29 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc