Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sun azimuth at current time #43

Closed
E-Lizzy opened this issue Jun 6, 2023 · 7 comments
Closed

Sun azimuth at current time #43

E-Lizzy opened this issue Jun 6, 2023 · 7 comments
Assignees
Labels
question Further information is requested

Comments

@E-Lizzy
Copy link

E-Lizzy commented Jun 6, 2023

Hello,

thank you for your awesome work.

As the sun moves from sunrise to sunset in a given location you provide the azimuth of the sun on sunrise and sunset.
I have a question: is it possible to have the data of the current position of the sun. For example if it is 10h30 to see the position of the sun on the map between sunrise and sunset, and if the time evolves you see the sun on a map moving?

is this possible?

@seldon1000 seldon1000 added the question Further information is requested label Jun 6, 2023
@seldon1000
Copy link
Member

Hello there! We are glad that you like SunKit.

Current sun data is already present in your Sun object. For instance, you can check the current sun azimuth by simply accessing Sun's azimuth parameter. You can set the desired time of the day using setDate(_ newDate: Date) and azimuth will be updated to match the newly set date.

I hope I helped you.

@E-Lizzy
Copy link
Author

E-Lizzy commented Jun 6, 2023

how do you convert sun.azimuth to the current time? It is not clear to me

@seldon1000
Copy link
Member

You first set the time using the setDate method. The method will then update the azimuth value automatically.

@E-Lizzy
Copy link
Author

E-Lizzy commented Jun 6, 2023

Is it possible to provide an example ? It would be appreciated

@seldon1000
Copy link
Member

Oh course, you can find it in the README file.

@E-Lizzy
Copy link
Author

E-Lizzy commented Jun 6, 2023

Thank you very much for your help. I succeeded :-)

@seldon1000
Copy link
Member

You're welcome!

@seldon1000 seldon1000 self-assigned this Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants