A command-line tool for converting physical quantities between the CGS (Centimetre-Gram-Second) and SI (International System of Units) unit systems.
| Quantity | CGS unit | SI unit |
|---|---|---|
| Length | cm | m |
| Mass | g | kg |
| Time | s | s |
| Force | dyn | N |
| Energy/Work | Erg | J |
| Power | Erg/s | W |
| Pressure | dyn/cm² | Pa |
- C++23 compiler (GCC 13+ or Clang 17+)
- CMake 3.20+
Use the provided script (tho it may not work for everyone):
# Full rebuild + run
bash run.bash root
# Run only (assumes build already exists)
bash run.bashThe program runs interactively in a loop:
- Select conversion direction:
CGS -> SIorSI -> CGS - Select the quantity to convert
- Enter a positive numeric value
- Repeat or exit
Select what type of conversion:
1. CGS -> SI
2. SI -> CGS
Enter a value (1-2): 1
Select what do you want to convert:
1. Length (cm -> m)
...
Enter a value (1-7): 1
Enter a value: 150
Converted value: 1.50 m
Would you like to convert another value ? (y/n):
.
├── include/
│ └── convert.h # Quantity and UnitSystem classes
├── src/
│ └── main.cpp # Entry point and input handling
└── CMakeLists.txt