https://github.com/wolgemoth/unit-conversions
A C++ utility providing methods for converting between various speed, distance, rotation, time, temperature, pressure, mass, area, and volume units.
https://github.com/wolgemoth/unit-conversions
area cpp cpp17 distance hashtables header-only mass pressure rotation speed temperature templated templates time units-of-measurement volume
Last synced: 6 months ago
JSON representation
A C++ utility providing methods for converting between various speed, distance, rotation, time, temperature, pressure, mass, area, and volume units.
- Host: GitHub
- URL: https://github.com/wolgemoth/unit-conversions
- Owner: wolgemoth
- License: mit
- Created: 2024-05-01T14:13:02.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-05-09T17:08:45.000Z (over 1 year ago)
- Last Synced: 2025-02-06T00:31:49.560Z (8 months ago)
- Topics: area, cpp, cpp17, distance, hashtables, header-only, mass, pressure, rotation, speed, temperature, templated, templates, time, units-of-measurement, volume
- Language: C++
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Unit Conversions
### About
This is a C++ library implementing a number of conversions between common speed, distance, rotation, time, temperature, pressure, mass, area, and volume units, as according to their definitions in the International System of Units.
It makes use of hashtables to quickly deduce the unit as represented by a string literal.
If you find a bug or have a feature-request, please raise an issue.
### Disclaimer
This library is designed for use in situations requiring the rapid processing of large volumes of data, where concessions to the accuracy of the result are acceptable in favour of increased performance.
As it uses floating-point representations for the conversions it is not suitable for use in scientific applications requiring extreme precision or error correction. If your application needs anything other than an approximate conversion, I recommend you to use a different library which is better suited to your needs.
### Note
Units that vary depending on their situation or context use fixed values in this library:
- This library defines Mach as a constant of 340.29 *m/s*.
- This library uses the *c* constant to represent light speed.### Dependencies
#### [cpp-hashmap v2.0.1](https://github.com/wolgemoth/cpp-hashmap)
### Instructions
The implementation is header-only and written in templated C++17. You should not need to make any adjustments to your project settings or compiler flags.
To use in your project, simply include the header file and its dependency.