@hatijs/helper
Version:
Node.js library, which has increased usability in @hatijs/core library.
37 lines (36 loc) • 1.83 kB
JavaScript
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var path_1 = require("path");
var core_1 = __importDefault(require("@hatijs/core"));
var hati_1 = require("./hati");
var Hati = /** @class */ (function () {
function Hati(date, timeZone, longitude, latitude) {
// 기본 ephe 경로 설정
core_1.default.node_swe_set_ephe_path((0, path_1.join)(__dirname, '..', 'ephe'));
// tjdUT 설정
var sweUTCTimeZone = core_1.default.node_swe_utc_time_zone(date.getUTCFullYear(), date.getUTCMonth() + 1, date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), timeZone);
var sweJD = core_1.default.node_swe_utc_to_jd(sweUTCTimeZone.year, sweUTCTimeZone.month, sweUTCTimeZone.day, sweUTCTimeZone.hour, sweUTCTimeZone.minute, sweUTCTimeZone.second, core_1.default.SE_GREG_CAL);
if ('error' in sweJD) {
throw new Error(sweJD.error);
}
this.tjdUT = sweJD.julianDayUT;
// geometry 설정
this.geometry = {
longitude: longitude,
latitude: latitude,
};
// c언어 라이브러리 제공 export
this.swisseph = core_1.default;
// 가공된 라이브러리 제공 export
this.dignity = (0, hati_1.dignity)(this.tjdUT, this.geometry.longitude, this.geometry.latitude);
this.house = (0, hati_1.house)(this.tjdUT, this.geometry.longitude, this.geometry.latitude);
this.position = (0, hati_1.position)(this.tjdUT, this.geometry.longitude, this.geometry.latitude);
}
Hati.constant = hati_1.constant;
Hati.util = hati_1.util;
return Hati;
}());
exports.default = Hati;