Created
December 16, 2017 00:07
-
-
Save sajt/bc921ab8910b97e04feb8cc0ad11951f to your computer and use it in GitHub Desktop.
Kérdéshe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var swisseph = require ('swisseph'); | |
swisseph.swe_set_ephe_path (__dirname + '/ephem'); | |
swisseph.swe_utc_to_jd(1971, 9, 25, 5, 30, 0, swisseph.SE_GREG_CAL, function(julianDay) { | |
ret = swisseph.swe_houses(julianDay.julianDayUT, 47.30, 19.05, 'P', function(ret) { | |
ret.house.forEach(function (house, index) { | |
console.log(strtime(house)); | |
}); | |
}); | |
}); | |
function strtime(value) { | |
var jegyek = 'Kos, Bika, Ikrek, Rák, Oroszlán, Szűz, Márleg, Skorpió, Nyilas, Bak, Vízöntő, Halak'.split(', '); | |
var hour = Math.floor (value); | |
var jegy = Math.floor(value / 30); | |
var minFrac = (value - hour) * 60; | |
var min = Math.floor (minFrac); | |
var sec = Math.floor ((minFrac - min) * 60); | |
hour = hour - (jegy * 30); | |
return jegyek[jegy] + ' ' + hour + '" ' + min + '\' ' + sec; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "swish-test", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"swisseph": "^0.5.8" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment