-
Notifications
You must be signed in to change notification settings - Fork 418
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 position azimuth less than 0 #171
Comments
I'm having similar issues with the moon's azimuth from Europe: This month (June 2024), the moon sets in the west, but it azimuth values are far too low for that. Concerning the sun, it's the same, it sets in the West but the azimuth is too low for that. Edit: Wait... (thank you for quoting the docs, I did not see) "south to west"? That means I need to add 180° to the Azimuth.. and now it is not far from I what I expect anymore! |
@Jakub-Plan-d-k and Copilot completed my comment: const angle = azimuth * (180 / Math.PI) + 180 // azimuth needs to be converted from -180° to 180° to 0° to 360° Does this explain your negative value? |
-1.0092469987441774 radians is between negative pi and zero, so the sunset azimuth is usually on the western horizon. |
Hello,
in the documentation it is stated that sunPosition.azimuth is an angle in radians calculated from south to west.
Therefore I assumed the values should be between 0 and 2*PI, however this is apparently not the case. How should I interpret this angle then?
Steps to reproduce: run sunPosition with arguments:
date: Date Wed Jun 21 2023 11:09:23 GMT+0200 (Central European Summer Time)
latitude: 50.121110169781446
longitude: 8.768237964680083
Observe that azimuth is less than 0:
sunPosition.azimuth -1.0092469987441774
For the record, the sun is around south-east in real world for those parameters I posted.
The text was updated successfully, but these errors were encountered: