scifir-units 2.0.0
scifir-units is a library of units of measurement, angles, coordinates, fields, and related data, all lightweight, that help in the development of scientific software and scientific machines
Loading...
Searching...
No Matches
conversion.hpp
Go to the documentation of this file.
1#ifndef SCIFIR_UNITS_UNITS_CONVERSION_HPP_INCLUDED
2#define SCIFIR_UNITS_UNITS_CONVERSION_HPP_INCLUDED
3
4#include "./dimension.hpp"
5
6#include <string>
7#include <vector>
8
9using namespace std;
10
11namespace scifir
12{
14 {
15 public:
17
18 /* Imperial units */
20
21 /* US customary units of measurement */
23
25
26 conversion();
28
29 long double get_conversion_factor() const;
31
32 bool is_special_conversion() const;
33
35 };
36
37 inline float fahrenheit_to_kelvin(float x)
38 {
39 return (x - 32.0f) * (5.0f / 9.0f) + 273.15f;
40 }
41
42 inline float kelvin_to_fahrenheit(float x)
43 {
44 return (x - 273.15f) * 1.8f + 32.0f;
45 }
46}
47
48#endif // SCIFIR_UNITS_UNITS_CONVERSION_HPP_INCLUDED
long double get_conversion_factor() const
vector< dimension > get_conversion_dimensions() const
bool is_special_conversion() const
conversion::type conversion_type
The namespace scifir contains all scifir-units, excepting the string literals, which are outside.
Definition address.cpp:6
float kelvin_to_fahrenheit(float x)
float fahrenheit_to_kelvin(float x)