# Intro

- Product: CalcPad
- Version: 1.14
- Release: 2020.03.29
- Development: 2014-2020
- Platform: Windows

CalcPad is a smart notepad that calculates answers based on what you type in. It allows you to type in math expressions, assign variables, define functions, convert units, add units together and much more. There is no enter button, it automatically evaluates everything you type as you type it. You can go back and edit, add, or delete anything you want at any time, just like a notepad, and all the calculations will update accordingly.

## About

CalcPad was designed to take full advantage of the computer screen, keyboard, and mouse. In the past many people tried to simulate calculators as closely as possible. They would even purposely add limitations to make it behave more like a regular calculator. For example, with many physical calculators, if you are typing in an expression and make a mistake, you had to start all over again. On a PC there is no reason for this, but people would add that behavior as if it was a feature. Because of this, I created my own calculator long before CalcPad, but always wanted something like this, so I made it.

### 3rd Party

- Settings are made portable using PortableSettingsProvider [ Making Application Settings Portable ]
- JSON files are read using Newton.JSON [ JamesNK / Newtonsoft.Json ]
- Colored text is made possible by the CodeBoxControl [ CodeBox 2: An Extended and Improved Version of ... ]
- Decimal Form to Fraction Form code from Kay Zed [ Algorithm for simplifying decimal to fractions ]

### Philosophy

While developing CalcPad, there are a couple things I keep in mind that help determine what features I add.

The Little Things Add Up: In software development, some features are categorized as "quality of life". They are often small changes that make things a bit more convenient. A good example of this is all the ways you can type numbers in (see: numeric syntax). I try to keep an eye out for these things and implement them when I can.

Empower Existing Features: When I added units to CalcPad, all you could do was convert one unit to the next. The "units" feature was not powerful. Instead of moving on to the next completely new feature, I kept working on the "units" feature and coming up with ideas to make it a better feature (see: unit support).

### Context (The Little Things Add Up)

Language can be ambiguous at times, even mathematical symbols, such as the dash "-". CalcPad is able to deal with some of these, and figure out the intended meaning of a symbol. So if you use the "-" symbol, CalcPad will figure out if you're trying to do subtraction or negation. Below is a list of words and symbols that CalcPad will use in a way that makes sense.

- Dash "-" can be subtraction or negation.
- Percent "%" can be percent suffix or modulo operator.
- Bash "!" can be factorial or logical not.
- Semicolon ":" can be division (i.e. ratio) or equals (e.g. price: $20).
- Logic And Bitwise Operators ("not", "and", "or", etc.) can be used on booleans (logic) or integers (bitwise).

Structural characters require context to be accounted for as well.

- Both "<" and ">" can be brackets for vectors: "<4,8>". Or as relational operators: "4 > 8", which outputs "False".
- The "," can be used in numbers: "2,000,000". Or as a delimiter for functions parameters: "f(2,-2)". And vectors: "<4,8>".

Keep in mind that any word or symbol you use as a variable or user-defined function will take precedence over its default meaning.

### Unit Support (Empower Existing Features)

There is a ton of unit support. This is a list of most of what you can do with units and how units behave.

1. Unit Conversion: You can convert units like so, "5 meters to feet" or "pound to kilogram".
2. Unit Conversion: To convert units you can type "to" or "in".
3. Unit arithmetic: "4 feet + 8 inches" outputs "4.66 feet".
4. Unit arithmetic: You can combine it with unit conversion, so "2 meters + 4 inches in feet" outputs "6.9 feet"
5. Implied 1. The units in "pint to cup" and the first unit in "foot + 2 meters" have an invisible 1 before it.
6. Implied first unit used. If you type "meter + 2 feet + 10", it is the same as typing "meter + 2 feet + 10 meters".
7. Multiple ways to type a unit: inch or inches and foot or feet.
8. Can pass angle units into trig functions: sin(1 radian) or sin(1.2 rads) & cos(90 degrees) or cos(180 degs).
9. Can pass units into user-defined functions.
10. Convert between mass & energy (E=mc^2) . E.g. 10 megatons to pounds = 1.03 pounds.
11. Constants are saved in their respective units. If you type in "speed of light" it will output "1,498,962,290 meter/second".
12. You can use unit conversion with constants. Typing "Earth.Circumference in inches" will output "1,577,755,956 inches".
13. Define your own units.
14. Dimensional Analysis.
15. Function "what is" can be used on units to give physical quantity or vise versa.
16. Function "in base units" can be used on units to break it down into the base SI units that make it up.
17. You can multiple/divide physical quantities, such as length/time = velocity.

## Sources

Part of creating CalcPad required a lot of research. I've kept tracked of many of the sources I used. Not all of them agreed with each other, which made it harder. You can find a list of these sources here.