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_2d.cpp
Go to the documentation of this file.
2
3#include "../util/types.hpp"
4
5using namespace std;
6
7namespace scifir
8{
10 {
11 return x.display_cartesian();
12 }
13
15 {
16 return float(std::sqrt(std::pow(x.x - y.x,2) + std::pow(x.y - y.y,2)));
17 }
18}
19
20ostream& operator <<(ostream& os,const scifir::coordinates_2d<float>& x)
21{
22 return os << scifir::to_string(x);
23}
string display_cartesian() const
ostream & operator<<(ostream &os, const scifir::coordinates_2d< float > &x)
The namespace scifir contains all scifir-units, excepting the string literals, which are outside.
Definition address.cpp:6
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
float distance(const coordinates_1d< float > &x, const coordinates_1d< float > &y)