solar-time
Version:
This library provides functions to calculate local solar time, also known as local apparent time, based on a given location and date.
36 lines (35 loc) • 1.29 kB
TypeScript
import dayjs from "dayjs";
import { Decimal } from "decimal.js";
/**
* Calculate solar time for a specific date with high precision using Decimal.js
* @param {Date} date - The date to calculate the solar time.
* @param {string} longitude - The longitude of the location.
* @param {Object} [options] - The options to calculate the solar time.
* @param {number} [options.utc] - The UTC offset to use, defaults to the local UTC offset.
* @returns {LST: Dayjs, TC: string, EoT: number, B: number, LSTM: number}
*/
export declare const SolarPrecise: (date: Date, longitude: string, options?: {
utc: number;
}) => {
LST: dayjs.Dayjs;
TC: string;
EoT: Decimal;
B: Decimal;
LSTM: Decimal;
};
/**
* Calculate solar time for the current date with high precision using Decimal.js
* @param {string} longitude - The longitude of the location.
* @param {Object} [options] - The options to calculate the solar time.
* @param {number} [options.utc] - The UTC offset to use, defaults to the local UTC offset.
* @returns {LST: Dayjs, TC: string, EoT: number, B: number, LSTM: number}
*/
export declare const SolarNowPrecise: (longitude: string, options?: {
utc: number;
}) => {
LST: dayjs.Dayjs;
TC: string;
EoT: Decimal;
B: Decimal;
LSTM: Decimal;
};