An Astronomical Algorithms Library
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
DLL
Doc
README.md

README.md

AstroAlgo

AstroAlgo is an astronomical algorithms library, written in .NET Standard. It can be used to calculate astronomical data, like equator and ecliptic coordinate, planet rise and down time, elevation angle... Planets data are based on the planetary theory VSOP87.

NuGet : https://www.nuget.org/packages/AstroAlgo/

Don't use it for scientific calculations.

Catalogue

Reference

How to Get

  • NuGet Package Manager
PM> Install-Package AstroAlgo -Version 1.0.3
  • Add AstroAlgo.dll to project

Introduction

  • Calculate the Julian day
  • Sidereal time and Zone time converter
  • Coordinate system basic tools, include nutation, coordinate converter...
  • Angle to HoursMinutesSeconds or to DegreeMinutesSeconds
  • Eight planets, in the solar system, rise and down time, equator coordinate, ecliptic coordinate...
  • ......

Code Map

Version History

2018-2-22 1.0.3

  • Now you can calculate solar terms
  • Fixed bugs

2017-9-24 1.0.2

  • Now you can custom timezone when initialize the objects of SolarSystem
  • Fixed many many many bugs...

2017-9-23 1.0.1

  • Improve equinoxes and solstices accuracy
  • ElevationAngle2Time() return "0:0:0" if time dose not exist

2017/9/16 1.0.0

First Version

How to Use

After add reference to project

Julian Day

// Julian to Calendar
double julian = Julian.ToJulianDay(DateTime.Now);
// Calendar to Julian
DateTime now = Julian.ToCalendarDay(julian);

Sidereal Time

// Zone Time, Local Zone, Longitude
double angle = SiderealTime.LocalSiderealTime(DateTime.Now, TimeZoneInfo.Local, 117.18);
string time = BasicTools.Angle2HMS(angle);

Console.WriteLine(time);

Ecliptic Obliquity

double angle = CoordinateSystem.EclipticObliquity(DateTime.Now);

Coordinate Converter

Equator equator = Sun.EquatorialCoordinate(DateTime.Now);
Ecliptic ecliptic = CoordinateSystem.Equatorial2Ecliptic(equator);

Console.WriteLine(ecliptic.Latitude);
Console.WriteLine(ecliptic.Longitude);

Planets Data

// Your latitude and longitude
Venus v = new Venus(34.27, 117.15, TimeZoneInfo.Local);

Console.WriteLine(v.Rise);
Console.WriteLine(v.Culmination);
Console.WriteLine(v.Down);
Console.WriteLine();

Console.WriteLine(v.ElevationAngle);
Console.WriteLine(v.Azimuth);
Console.WriteLine();

Console.WriteLine(v.ToSun);
Console.WriteLine(v.ToEarth);