#!/usr/bin/env node; /****************************************************************************** * This program estimates the volume of the Milky Way Galaxy. * * Copyright © 2020 Richard Lesh. All rights reserved. *****************************************************************************/ const Utils = require('./Utils'); const BULGE_RADIUS = 10000; const DISK_RADIUS = 52850; const DISK_THICKNESS = 1000; const main = async () => { const DISK_VOLUME = Math.PI * Math.pow(DISK_RADIUS - BULGE_RADIUS, 2.) * DISK_THICKNESS; const SPHERE_VOLUME = 4.0 / 3.0 * Math.PI * Math.pow(BULGE_RADIUS, 3.0); const MILKY_WAY_VOLUME = DISK_VOLUME + SPHERE_VOLUME; console.log(Utils.format("The Milky Way volume \u2248 {0:.3e} light-year\u00b3", MILKY_WAY_VOLUME)); } main().catch( e => { console.error(e) } );