astronomy-bundle
Version:
Bundle for astronomical calculations such as position of moon, sun and planets, sunrise, sunset or solar eclipses. Most of the calculations are based on Jean Meeus 'Astronomical Algorithms' book and the VSOP87 theory.
25 lines (24 loc) • 645 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.cos2 = exports.sin2 = exports.pad = exports.round = void 0;
function round(value, decimals = 0) {
const p = Math.pow(10, decimals);
return Math.round(value * p) / p;
}
exports.round = round;
function pad(num, size) {
let numStr = num.toString();
while (numStr.length < size) {
numStr = '0' + numStr;
}
return numStr;
}
exports.pad = pad;
function sin2(number) {
return Math.sin(number) * Math.sin(number);
}
exports.sin2 = sin2;
function cos2(number) {
return Math.cos(number) * Math.cos(number);
}
exports.cos2 = cos2;