Giter VIP home page Giter VIP logo

rust-sunrise's People

Contributors

aldaronlau avatar nathan-osman avatar remi-dupre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rust-sunrise's Issues

Invalid and misleading lat, lon in readme example

There's an error in coordinates that are used in the usage example in the readme file.

The readme gives the following example

// Calculate times for January 1, 2016 in Toronto
let (sunrise, sunset) = sunrise::sunrise_sunset(
    43.6532,
    79.3832,
    2016,
    1,
    1,
);

However, the valid coordinates for Toronto in Lat Lng format are 43.6532, -79.3832. Therefore the example above should be written this way:

// Calculate times for January 1, 2016 in Toronto
let (sunrise, sunset) = sunrise::sunrise_sunset(
    43.6532,
    -79.3832,
    2016,
    1,
    1,
);

It took me a bit of time at first to figure out why computations were incorrect.

How to implement dusk / dawn ?

I'd love to use this crate for a crate that provide an engine for OSM's opening hours, but it can be based on dawn and dusk. I'd be willing to make a PR that implement this change but I need some help understanding where to make a change. (This may also motivate to change a bit the API if there is more values to output).

Wikipedia defines "civil dawn" as follow:

Civil dawn begins when there is enough light for most objects to be distinguishable, so that some outdoor activities can commence. Formally, it occurs when the Sun is 6 degrees below the horizon in the morning.[4]

So this is seems it is just about adding / removing a 6° angle somewhere, should it be directly added / removed the sun declination, $\delta$ ?

How to decode the returned integers into a timepoint

Thanks for implementing this function.

However from reading the documentation I see that the function returns a tuple of i64. I do not yet understand how this i64 is representing a sunrise/sunset time. What is the encoding.

More specifically, how to convert this into something like a chrono::naive::NaiveTime

crates.io release after time dependency removal

I've found your crate of sunrise/sunset equation implementation exactly what I need in my embedded project. :)

Would you consider releasing a newer version of your package after time dependency removal?

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.