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
derived_units
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
7
using namespace
std;
8
9
namespace
scifir
10
{
11
SCALAR_UNIT_CPP
(
area
,
"m2"
);
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
31
SCALAR_UNIT_CPP
(
volume_4d
,
"m4"
);
32
33
SCALAR_UNIT_CPP
(
curvature
,
"1/m"
);
34
}
scifir::coordinates_1d
Definition
coordinates_1d.hpp:18
scifir::scalar_unit
Class that allows to create scalar units, which are composed of a value (as a float) and dimensions....
Definition
scalar_unit.hpp:202
scifir
The namespace scifir contains all scifir-units, excepting the string literals, which are outside.
Definition
address.cpp:6
scifir::area
area(const size_2d< length > &)
Definition
space_units.cpp:13
SCALAR_UNIT_CPP
#define SCALAR_UNIT_CPP(name, init_real_dimensions)
Definition
scalar_unit.hpp:81
space_units.hpp
Generated by
1.9.8