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
coordinates
coordinates_2d.cpp
Go to the documentation of this file.
1
#include "
./coordinates_2d.hpp
"
2
3
#include "../util/types.hpp"
4
5
using namespace
std;
6
7
namespace
scifir
8
{
9
string
to_string
(
const
coordinates_2d<float>
& x)
10
{
11
return
x.
display_cartesian
();
12
}
13
14
float
distance
(
const
coordinates_2d<float>
& x,
const
coordinates_2d<float>
& y)
15
{
16
return
float
(std::sqrt(std::pow(x.
x
- y.
x
,2) + std::pow(x.y - y.y,2)));
17
}
18
}
19
20
ostream&
operator <<
(ostream& os,
const
scifir::coordinates_2d<float>
& x)
21
{
22
return
os <<
scifir::to_string
(x);
23
}
scifir::coordinates_1d
Definition
coordinates_1d.hpp:18
scifir::coordinates_1d::display_cartesian
string display_cartesian() const
Definition
coordinates_1d.hpp:77
scifir::coordinates_1d::x
T x
Definition
coordinates_1d.hpp:84
operator<<
ostream & operator<<(ostream &os, const scifir::coordinates_2d< float > &x)
Definition
coordinates_2d.cpp:20
coordinates_2d.hpp
scifir
The namespace scifir contains all scifir-units, excepting the string literals, which are outside.
Definition
address.cpp:6
scifir::to_string
string to_string(const aid &x)
Creates a string representation of aid, it's for aid equivalent to the display() function of aid.
Definition
aid.cpp:582
scifir::distance
float distance(const coordinates_1d< float > &x, const coordinates_1d< float > &y)
Definition
coordinates_1d.cpp:13
Generated by
1.9.8