Giter VIP home page Giter VIP logo

astronomy's Introduction

C# Astronomy Library

Julian Day

Allows calculations of any date after noon on 1 January, 4713 BC.

    JulianDay JD = new JulianDay(333, 1, 27, 12);
    Debug.Assert(JD.JulianDayNumber == 1842713.0);

    JulianDay JD1 = new JulianDay(1957, 10, 4) + 0.81;
    Debug.Assert(JD1.JulianDayNumber == 2436116.31);

Instant

Helper class for calculating Sidereal time

    JulianDay JD = new JulianDay(1987, 04, 10, 0);

    double T = (JD.JulianDayNumber - 2451545.0) / 36525;

    Instant MeanSiderealDate = new Instant(6, 41, 50.54841);
    MeanSiderealDate += 8640184.812866 * T;
    MeanSiderealDate += 0.093104 * Math.Pow(T, 2);
    MeanSiderealDate += 0.0000062 * Math.Pow(T, 3);

    Debug.Assert(MeanSiderealDate.Hour == 13);
    Debug.Assert(MeanSiderealDate.Minute == 10);
    Debug.Assert(Math.Round(MeanSiderealDate.Second, 4) == 46.3668);

    Instant MeanSiderealInstant = new Instant(19, 21, 00);
    MeanSiderealInstant = MeanSiderealInstant * 1.00273790935;
    MeanSiderealInstant += MeanSiderealDate;
    Debug.Assert(MeanSiderealInstant.Hour == 8);
    Debug.Assert(MeanSiderealInstant.Minute == 34);
    Debug.Assert(Math.Round(MeanSiderealInstant.Second, 4) == 57.0896);

Islamic Calendar

Used to calculate dates on the Islamic calendar. Valid for all dates since 16 July 622 on the Julian calendar.

    IslamicCalendar MC = new IslamicCalendar(1421, 1, 1);
    JulianDay JD = MC.ToJulianDay();

    Debug.Assert(JD.Year == 2000);
    Debug.Assert(JD.Month == 4);
    Debug.Assert(JD.Day == 6);

    JulianDay JD1 = new JulianDay(1991, 8, 13);
    IslamicCalendar MC1 = IslamicCalendar.FromJulianDay(JD1);

    Debug.Assert(MC1.Year == 1412);
    Debug.Assert(MC1.Month == 2);
    Debug.Assert(MC1.Day == 2);

Equinox

Used to calculate dates of the equinoxes and solstices Valid for all years since the Julian Epoch (1 January 4713 BC);

    double JDE = Equinox.Approximate(1962, Season.Summer);
    Debug.Assert(JDE == 2437837.39245);

Events

Used to calculate the date of various yearly events.

Easter

Valid for all years since the Julian Epoch (1 January 4713 BC);

    JulianDay JD = Events.Easter(179);
    Debug.Assert(JD.Month == 04);
    Debug.Assert(JD.Day == 12);

    JulianDay JD2 = Events.Easter(1991);
    Debug.Assert(JD2.Month == 03);
    Debug.Assert(JD2.Day == 31);

Pesach (Passover)

Valid for all years since the Hebrew Calendar Epoch (7 October 3761 BCE);

    JulianDay JD3 = Events.Pesach(2015);
    Debug.Assert(JD3.Month == 4);
    Debug.Assert(JD3.Day == 4);

astronomy's People

Contributors

goodolclint avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

aloisdg t9mike hnjm

astronomy's Issues

What is JDE0?

Hello,

I am playing with meeus algorithm for a small project. I dont understand what is JDE0. Can you explain it to me? Thank you.

Also, are you the original developer of the google code project "meeus"?

Cheers,

Licence?

Heyas, I've recently discovered this library, and it has been really useful for calculating the equinoxes and solstices.
I would like to use it in my library (which I plan to release as open-source with a BSD licence soon), but I'd like to ask regarding the licence of this repo.

I hadn't been able to find any licence file nor any mention of licence anywhere. Without any licence, nobody can legally and safely use this library (see this Choose A License page). I would like to suggest adding a licence to this repo. My personal recommendations are permissive licences like the BSD 2-clause or the MIT licence.

Thank you for your work and have a nice day!

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.