igc-xc-score
Version:
igc-xc-score is a paragliding and hang-gliding XC scoring program in vanilla JS
49 lines (44 loc) • 1 kB
JavaScript
;
export const REarth = 6371;
export const WGS84 = {
a: 6378.137,
b: 6356.752314245,
f: 1 / 298.257223563
};
export function radians(degrees) {
return degrees / (180 / Math.PI);
}
export function degrees(radians) {
return radians * (180 / Math.PI);
}
export const consoleColors = {
bright: '\x1b[1m',
dim: '\x1b[2m',
underscore: '\x1b[4m',
blink: '\x1b[5m',
reverse: '\x1b[7m',
hidden: '\x1b[8m',
fg: {
black: '\x1b[30m',
red: '\x1b[31m',
green: '\x1b[32m',
yellow: '\x1b[33m',
blue: '\x1b[34m',
magenta: '\x1b[35m',
cyan: '\x1b[36m',
white: '\x1b[37m',
crimson: '\x1b[38m'
},
bg: {
black: '\x1b[40m',
red: '\x1b[41m',
green: '\x1b[42m',
yellow: '\x1b[43m',
blue: '\x1b[44m',
magenta: '\x1b[45m',
cyan: '\x1b[46m',
white: '\x1b[47m',
crimson: '\x1b[48m'
},
reset: '\x1b[0m'
};