summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrien Hopkins <adrien.p.hopkins@gmail.com>2019-01-25 19:28:29 -0500
committerAdrien Hopkins <adrien.p.hopkins@gmail.com>2019-01-25 19:28:29 -0500
commitfceb0002659311f7d7c6481908d1c7f917160e6e (patch)
tree8ed846d34a240369cec66aa29908475ddca72f3b
parent8ff06e8e5661645c00656c40d15c8d13db665b57 (diff)
Created a README file.
-rw-r--r--README.org51
1 files changed, 51 insertions, 0 deletions
diff --git a/README.org b/README.org
new file mode 100644
index 0000000..9fa913d
--- /dev/null
+++ b/README.org
@@ -0,0 +1,51 @@
+* What is it?
+ This is a unit converter, which allows you to convert between different units, and includes a GUI which can read unit data from a file (using some unit math) and convert between units that you type in, and has a unit and prefix viewer to check the units that have been loaded in.
+* Features
+ - Convert between units and expressions of units
+ - linear or base unit can use unit prefixes (including non-metric units!)
+ - and prefixes are defined in an editable data file, in a simple and intuitive format.
+ - Viewer and Prefix Viewer which allow you to search through all of the available units and prefixes and learn details about them.
+ - All of SI included in default text file
+ - Choose your precision
+* How to Convert
+To convert units, simply enter the first unit in the From box and the second unit in the To box. Press Convert and a result will appear in the output box. Both boxes accept unit expressions, so you can input things like ‘1.7 m’, ‘85 km/h’ and ‘35 A * 14 s’ into either box.
+*Warning*: The space between the number and the unit name is required, or else the whole expression will be interpreted as a unit name. Spaces are not required for operators.
+Use the slider at the bottom to choose the maximum precision of the result, in significant digits, not decimal places.
+* Units Files and Expressions
+As mentioned previously, all units are loaded from a units file. The format for lines consists of a name for the unit, some tabs (not spaces), and an expression. The following operations are supported in expressions
+ - Multiplication using spaces ( ) or asterisks (*)
+ - Division using the forward slash (/)
+ - Exponentiation using the caret (^)
+Every argument can be either a linear unit, a base unit or a number, except exponents which must be integers. There is no way to use brackets to manipulate order of operations.
+
+Example (Explanation provided after # sign, this will *not* work in a real units file):
+inch 25.4 mm # Define ‘inch’ as equal to the product of 25.4 and ‘mm’
+mph mile / hour # Define ‘mph’ as equal to the quotient of ‘mile’ and ‘hour’
+litre 0.001 m^3 # Define ‘litre’ as equal to the product of 0.001 and the unit ‘m’ raised to the exponent 3
+
+Lines that start with the number sign (#) and blank lines will be ignored.
+
+Unit prefixes are defined differently. When a unit name ends with the dash (-) character, it is interpreted as a prefix. Prefix expressions are not as powerful as unit expressions, they can only be:
+ - a number (1000)
+ - an exponent (10^3)
+ - the name of another prefix without the dash (kilo)
+* Unit Prefixes
+In SI, you can have a unit prefix, which you attach to the start of a unit and it multiplies the unit by a certain value. For example, milli-metre = 0.001 * metre. This unit converter supports unit prefixes, and you can put any number of prefixes before a linear or base unit to transform it (this includes non-SI units).
+You can use more than one prefix at once (yottayottametre = really really long distance), but you may not convert prefixes alone. If you want to do that, use ‘unit’ or ‘u’ (ku = 1000000 mu). You can also use u for converting from numbers (tau = 6.28319 u).
+*Warning*: While the standard symbol for ‘deca’ is ‘da’, this program uses ‘D’ instead since ‘da’ can be confused with ‘deciatto’. Also, you may use capital letters for the symbols of ‘hecto’ and ‘kilo’.
+*Warning*: The standard prefixes will never use 1024 instead of 1000, even when operating on bits and bytes. Use ‘Ki’, ‘Mi’, ‘Gi’, ‘Ti’ and so on instead.
+* Nonlinear Units
+Sometimes, units cannot be converted from and to by simply multiplying and dividing. A common example of this is the Celsius and Fahrenheit temperature scales, which require multiplication and addition to convert to each other (and to their base, Kelvin).
+To use nonlinear units, use the following syntax:
+FROM: unit1(value)
+TO: unit2
+Nonlinear units cannot:
+ - multiply, divide or exponentiate
+ - use prefixes
+ - be defined by unit files
+To define a nonlinear unit, make an anonymous inner type (or any other subclass) of AbstractUnit, and define the conversion methods.
+* Unit and Prefix Viewers
+The unit and prefix viewers can be used to see the available units (without prefixes) and prefixes. Upon opening them, you will see a list of units or prefixes on your left. Using the text box above, the list can be filtered. When a unit is clicked on, details about will be displayed on the right.
+* Copyright and Licences
+The Unit Converter program is Copyright (C) 2018, 2019 Adrien Hopkins. It is released under the terms of the AGPL v3 licence.
+This document is Copyright (C) 2019 Adrien Hopkins. It is released under the terms of the CC BY-SA (Creative Commons Attribution-ShareAlike) licence.