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
space_units.cpp
Go to the documentation of this file.
1#include "./space_units.hpp"
2
3#include "../units/base_units.hpp"
4#include "../special_units/size_2d.hpp"
5#include "../special_units/size_3d.hpp"
6
7using namespace std;
8
9namespace scifir
10{
12
13 area::area(const size_2d<length>& x) : scalar_unit()
14 {
15 length x_height = x.height;
16 x_height.change_dimensions(x.width);
17 *this = x.width * x_height;
18 }
19
20 SCALAR_UNIT_CPP(volume,"m3");
21
22 volume::volume(const size_3d<length>& x) : scalar_unit()
23 {
24 length x_height = x.height;
25 length x_depth = x.depth;
26 x_height.change_dimensions(x.width);
27 x_depth.change_dimensions(x.width);
28 *this = x.width * x_height * x_depth;
29 }
30
32
34}
Class that allows to create scalar units, which are composed of a value (as a float) and dimensions....
The namespace scifir contains all scifir-units, excepting the string literals, which are outside.
Definition address.cpp:6
area(const size_2d< length > &)
#define SCALAR_UNIT_CPP(name, init_real_dimensions)