parent
a7e10d6796
commit
2cc6afb762
3 changed files with 24 additions and 17 deletions
@ -1,2 +1,17 @@ |
|||||||
# calculation-of-sun |
# calculation-of-sun |
||||||
Sun calculation fully based on formula from http://aa.quae.nl/en/reken/zonpositie.html |
Sun calculation fully based on formula from http://aa.quae.nl/en/reken/zonpositie.html |
||||||
|
|
||||||
|
## Warning |
||||||
|
This program is not really accurate about the calculation. For the sunrise and sunset, the error value is about 2 minutes miss from the actual time. For the Altitude the error value is near 0.6 degrees and the azimuth as well. |
||||||
|
|
||||||
|
# Install with npm |
||||||
|
'npm install calculation-ofsun' |
||||||
|
|
||||||
|
# Use |
||||||
|
'''jvascript |
||||||
|
// getSunInformation parameter: Date, Latitude, Longtitude |
||||||
|
|
||||||
|
const cls = require('calculation-ofsun') |
||||||
|
console.log(cls.getSunInformation(new Date(), 33, 3)) |
||||||
|
|
||||||
|
''' |
||||||
|
@ -1,13 +1,2 @@ |
|||||||
const a = require('./dist/solar-calculation'); |
const a = require('./dist/solar-calculation'); |
||||||
let b = new a(); |
console.log(a.getSunInformation(new Date(), 52, 5)); |
||||||
let lat = 3.597031; |
|
||||||
let long = 98.678513; |
|
||||||
function JDtoDate(jd) { |
|
||||||
let d = new Date((jd + 0.5 - 2440588) * (1000 * 60 * 60 * 24)) |
|
||||||
console.log(d); |
|
||||||
return d.toString(); |
|
||||||
} |
|
||||||
let sff = b.getSunInformation(new Date(), 3.597031, 98.678513) |
|
||||||
console.log(sff.clientJD) |
|
||||||
console.log(JDtoDate(sff.sunset)); |
|
||||||
console.log(sff) |
|
||||||
|
Loading…
Reference in new issue