Unit Conversions Program
What It Does
The Units Conversions app is a simple Windows program / app that converts between multiple units for distance, time, velocity, acceleration, mass, energy, force, area, volume, density, power, and pressure.
For example, for distance units, it can convert between parsecs, light years, light hours, astronomical units, light minutes, light seconds, miles, meters, feet, as well as a variety of other units, such as Mercury diameter, Venus diameter, Earth diameter, Mars diameter, Jupiter diameter, Saturn diameter, Uranus diameter, Neptune diameter, Earth circumference, Sun diameter, Earth-Moon distance, Betelgeuse diameter, Sun-Mercury distance, Sun-Venus distance, Sun-Mars distance, Sun-Jupiter distance, Alpha Centauri distance, Hyades distance, globular cluster diameter (typical), Pleiades distance, Galactic center distance, Milky Way thin disk diameter, LMC (Large Magellanic Cloud) distance, M31 Andromeda Galaxy distance, M33 distance, M51 distance, M87 (Virgo Cluster) distance, Coma Cluster distance, Observable Universe diameter, New York to Los Angeles distance, New York to London distance, cruising altitude commercial airliner, Hydrogen nucleus diameter, and Uranium nucleus diameter.
Additional "custom" units can be added by modifying a plain text file.
Download the Unit Conversions Program
The Unit Conversions program is provided as a zip file. The zip file folder contains the Unit Conversions program and two plain text files for each unit (a total of 24 text files). For example, for distance units, the text files are "DISTANCE.txt" and "view_DISTANCE.txt." For time units, the text files are "TIME.txt" and "view_TIME.txt."
The Unit Conversions Program is a fully portable Windows application. It runs only from inside its folder, and the folder can be placed anywhere, including on a portable USB flash drive. It does not require any "installation" to run. Simply download the zip file, unzip it to a folder, and click on the G3D-Unit-Conversions.exe file in its folder to run the program (you can rename the folder containing the Unit Conversions program to any name you want).
Instructions
The program opens with Distance Units selected:
Enter the distance you wish to convert (in the example below, 1 light year) and then click "Convert":
This yields the conversions of the entered distance unit (in this example, 1 light year) into all the other distance units:
Click "Clear" to do another distance conversion:
A different distance unit (for example, the Hyades distance) can be chosen from the drop down lists:
Clicking "Convert" yields the conversion (in this example, 1 Hyades distance unit) into all the other distance units:
Note if you enter multiple distances to convert and click "Convert," the program will look for only the first filled distance unit box for the conversion and overwrite any others. In the example below, it will convert 1 astronomical unit, and overwrite inch:
To convert a different unit, click on the unit in the "Select Unit" box on the left ("Time" has been selected in the example below):
The example below shows the conversion from 1 "time unit" of the age of our Solar System:
In this example, "Volume" units are selected, and we see the conversions from the volume unit of 1 cubic astronomical unit:
Customization
The units available for conversion in each of the drop-down lists are read at the start of the program from a plain text file named after the particular conversion unit. The text files are located in the program folder. For example, for distance units, the text file is "DISTANCE.txt." For time units, the text file is "TIME.txt'. For volume units, the text file is 'VOLUME.txt'. These text file can be edited to make additional units available in the program for conversion.
For example, the following is part of the body of the "DISTANCE.txt" plain text file supplied with the program:
#############################============================================= Distance Unit Alpha Centauri distance Unit Pleural: Alpha Centauri distances Abbreviation: x Distance Units in LY: 2.289902e-1 Notes: 4.367 light years #############################============================================= Distance Unit Hyades distance Unit Pleural: Hyades distances Abbreviation: x Distance Units in LY: 6.618133686e-3 Notes: 151.1 ly #############################============================================= Distance Unit globular cluster diameter (Typical) Unit Pleural: globular cluster diameters (Typical) Abbreviation: x Distance Units in LY: 5.000000000e-3 Notes: ~60 pc; ~200 ly #############################============================================= Distance Unit Pleiades distance Unit Pleural: Pleiades distances Abbreviation: x Distance Units in LY: 2.251238181e-3 Notes: 444.2 ly; 135.2 +/- 5 pc (Gaia DR2) #############################============================================= Distance Unit Milky Way center distance Unit Pleural: Milky Way center distances Abbreviation: x Distance Units in LY: 3.846154e-5 Notes: 26,000 light years
To add an additional custom "distance" unit, simply insert the following 6 lines in sequence with other 6 line groups:
#############################============================================= Distance Unit NAME OF THE CUSTOM DISTANCE UNIT Unit Pleural: pleural version of the CUSTOM DISTANCE UNIT Abbreviation: x Distance Units in LY: number of CUSTOM DISTANCE UNITS in a light year Notes: any comments about the CUSTOM DISTANCE UNIT
The "NAME OF THE CUSTOM DISTANCE UNIT" must start as the 30th character on the line (the first 29 characters are ignored by the program). It will appear in the drop down lists in the same order it lies within the "DISTANCE.txt" plain text file. The "number of CUSTOM DISTANCE UNITS in a light year" is the floating point number used by the program for all conversions (you must use '.' as the decimal delimiter, and it must also start as the 30th character on its line). For example:
#############################============================================= Distance Unit Coma Cluster distance Unit Pleural: Coma Cluster distances Abbreviation: x Distance Units in LY: 3.096934035e-9 Notes: 322.9 million light years
If we take the Coma Cluster Distance as 322.9 million light years, then the number of Coma Cluster distances in 1 light year is 3.096934035 x 10-9. The x 10-9 is indicated by "e-9".
Another example: the Moon's diameter is 3476 km. The number of Moon diameters in 1 light year is 2.721729 x 109. The x 109 is indicated by "e09":
#############################============================================= Distance Unit Moon diameter Unit Pleural: Moon diameters Abbreviation: x Distance Units in LY: 2.721729e09 Notes: 1738 km x 2; 3476 km
The Abbreviation "x" means there is no standard abbreviation for the distance unit. If there is a standard abbreviation for the distance unit, it can be entered here (for example "m" for meters, "ly" for light years ...).
The program expects the "Notes" line, but the information on the "Notes" lines is ignored by the program.
The program supports up to 100 total distance units.
Custom units for Time, Velocity, Acceleration, Mass, Energy, Force, Area, Volume, Density, Power, and Pressure can similarly be added by editing their associated text files ("TIME.txt", "VELOCITY.txt", "ACCELERATION.txt", "MASS.txt", "ENERGY.txt", "FORCE.txt", "AREA.txt", "VOLUME.txt", "DENSITY.txt", "POWER.txt", and "PRESSURE.txt."). For example, to add an additional custom "time" unit, simply insert the following 6 lines in sequence with other 6 line groups in the text file "TIME.txt':
#############################============================================= Time Unit: NAME OF THE CUSTOM TIME UNIT Unit Pleural: pleural version of the CUSTOM TIME UNIT Abbreviation: x Time Unit in 1 second: number of CUSTOM TIME UNITS in 1 second Notes: any comments about the CUSTOM TIME UNIT
For example, "TIME.txt" already includes the following:
#############################============================================= Time Unit: Milky Way rotation Unit Pleural: Milky Way rotations Abbreviation: x Time Unit in 1 second: 144.03676279e-18 Notes: 220 million years #############################============================================= Time Unit: Average human lifespan Unit Pleural: Average human lifespans Abbreviation: x Time Unit in 1 second: 414.76554730e-12 Notes: 76.4 years #############################============================================= Time Unit: Age of the Universe Unit Pleural: Ages of the Universe Abbreviation: x Time Unit in 1 second: 2.2962382474e-18 Notes: 13.8 billion years
Notice there is a "base" unit used in each of the text files for the conversion factors. For Time conversions, the base unit is 1 second. In the above example, the "Time Unit in 1 second" for the Time Unit "Milky Way rotation" is "144.03676279e-18". That is, there are 144.03676279 x 10-18 Milky Way rotations in 1 second. For Distance conversions, the base unit was 1 light year. The base unit is listed at the top of each text file. For example, at the top of the "TIME.txt" file is:
#############################============================================= 00000000011111111112222222222333333333344444444445555555555666666666677777 12345678901234567890123456789012345678901234567890123456789012345678901234 #############################============================================= BASE UNIT second (s) #############################=============================================
And at the top of the "DISTANCE.txt" file:
#############################============================================= 00000000011111111112222222222333333333344444444445555555555666666666677777 12345678901234567890123456789012345678901234567890123456789012345678901234 #############################============================================= BASE UNIT light year (LY) #############################=============================================
The program supports up to 100 6-line entries in each of the text files.
There are also text files with the prefix "view_", for example "view_DISTANCE.txt" and "view_TIME.txt". These files should be left unaltered (they are used to store the index numbers of the particular unit in each drop down list when the program last ran).