suncalc-php
suncalc-php copied to clipboard
Faulty calculation of SunPosition
I don't have any experience in solar calculations
It seems the getSunPosition() function is wrong. I did the same calculation with this library and a bit more complex sun-position-spa-php and used this website to calculate and visualize the result based on the same data.
Input data
- Lat: 47
- Long: 18
- DateTime: 2023-10-30 09:40:30 (GMT+1)
- Altitude: 50 ft
Results
DATE: 2023-10-30 09:40:30
LAT : 47
LONG: 18
SunCalc PHP CALC ---
Azimuth: -14.272991314245
Altitude: 28.283460212278
Sun-Position-SPA-php CALC ---
Azimuth: 150.18753268816
Altitude: 24.352291414304
and here is the visualization for these numbers: 3D visualization
2 out of 3 give the same results, based on the visualization and looking out of my window, unfortunately, this library is the wrong one.