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
Classes | Namespaces | Functions
coordinates_2d.hpp File Reference
#include "../units/base_units.hpp"
#include "../derived_units/physics_units.hpp"
#include "../util/types.hpp"
#include <iostream>
#include <string>
Include dependency graph for coordinates_2d.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  scifir::coordinates_2d< T >
 
class  scifir::coordinates_2d< float >
 

Namespaces

namespace  scifir
 The namespace scifir contains all scifir-units, excepting the string literals, which are outside.
 

Functions

template<typename T >
string scifir::to_string (const coordinates_2d< T > &x)
 
string scifir::to_string (const coordinates_2d< float > &x)
 
template<typename T , typename U >
T scifir::distance (const coordinates_2d< T > &x, const coordinates_2d< U > &y)
 
float scifir::distance (const coordinates_2d< float > &x, const coordinates_2d< float > &y)
 
scalar_unit scifir::cartesian_2d_to_polar_p (const scalar_unit &x, scalar_unit y)
 
angle scifir::cartesian_2d_to_polar_theta (const scalar_unit &x, scalar_unit y)
 
scalar_unit scifir::polar_to_cartesian_2d_x (const scalar_unit &p, const angle &theta)
 
scalar_unit scifir::polar_to_cartesian_2d_y (const scalar_unit &p, const angle &theta)
 
float scifir::cartesian_2d_to_polar_p (float x, float y)
 
angle scifir::cartesian_2d_to_polar_theta (float x, float y)
 
float scifir::polar_to_cartesian_2d_x (float p, const angle &theta)
 
float scifir::polar_to_cartesian_2d_y (float p, const angle &theta)
 
template<typename T , typename U >
bool operator== (const scifir::coordinates_2d< T > &x, const scifir::coordinates_2d< U > &y)
 
template<typename T , typename U >
bool operator!= (const scifir::coordinates_2d< T > &x, const scifir::coordinates_2d< U > &y)
 
template<typename T >
bool operator== (const scifir::coordinates_2d< T > &x, const string &init_coordinates_2d)
 
template<typename T >
bool operator!= (const scifir::coordinates_2d< T > &x, const string &init_coordinates_2d)
 
template<typename T >
bool operator== (const string &init_coordinates_2d, const scifir::coordinates_2d< T > &x)
 
template<typename T >
bool operator!= (const string &init_coordinates_2d, const scifir::coordinates_2d< T > &x)
 
template<typename T >
void operator+= (string &x, const scifir::coordinates_2d< T > &y)
 
template<typename T >
string operator+ (const string &x, const scifir::coordinates_2d< T > &y)
 
template<typename T >
string operator+ (const scifir::coordinates_2d< T > &x, const string &y)
 
template<typename T >
ostream & operator<< (ostream &os, const scifir::coordinates_2d< T > &x)
 
ostream & operator<< (ostream &os, const scifir::coordinates_2d< float > &x)
 
template<typename T >
istream & operator>> (istream &is, scifir::coordinates_2d< T > &x)
 

Function Documentation

◆ operator!=() [1/3]

template<typename T , typename U >
bool operator!= ( const scifir::coordinates_2d< T > &  x,
const scifir::coordinates_2d< U > &  y 
)

Definition at line 411 of file coordinates_2d.hpp.

412{
413 return !(x == y);
414}

◆ operator!=() [2/3]

template<typename T >
bool operator!= ( const scifir::coordinates_2d< T > &  x,
const string &  init_coordinates_2d 
)

Definition at line 424 of file coordinates_2d.hpp.

425{
426 return !(x == init_coordinates_2d);
427}

◆ operator!=() [3/3]

template<typename T >
bool operator!= ( const string &  init_coordinates_2d,
const scifir::coordinates_2d< T > &  x 
)

Definition at line 437 of file coordinates_2d.hpp.

438{
439 return !(init_coordinates_2d == x);
440}

◆ operator+() [1/2]

template<typename T >
string operator+ ( const scifir::coordinates_2d< T > &  x,
const string &  y 
)

Definition at line 455 of file coordinates_2d.hpp.

456{
457 return to_string(x) + y;
458}
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

◆ operator+() [2/2]

template<typename T >
string operator+ ( const string &  x,
const scifir::coordinates_2d< T > &  y 
)

Definition at line 449 of file coordinates_2d.hpp.

450{
451 return x + to_string(y);
452}

◆ operator+=()

template<typename T >
void operator+= ( string &  x,
const scifir::coordinates_2d< T > &  y 
)

Definition at line 443 of file coordinates_2d.hpp.

444{
445 x += to_string(y);
446}

◆ operator<<() [1/2]

ostream & operator<< ( ostream &  os,
const scifir::coordinates_2d< float > &  x 
)

Definition at line 20 of file coordinates_2d.cpp.

21{
22 return os << scifir::to_string(x);
23}

◆ operator<<() [2/2]

template<typename T >
ostream & operator<< ( ostream &  os,
const scifir::coordinates_2d< T > &  x 
)

Definition at line 461 of file coordinates_2d.hpp.

462{
463 return os << to_string(x);
464}

◆ operator==() [1/3]

template<typename T , typename U >
bool operator== ( const scifir::coordinates_2d< T > &  x,
const scifir::coordinates_2d< U > &  y 
)

Definition at line 398 of file coordinates_2d.hpp.

399{
400 if (x.x == y.x and x.y == y.y)
401 {
402 return true;
403 }
404 else
405 {
406 return false;
407 }
408}

◆ operator==() [2/3]

template<typename T >
bool operator== ( const scifir::coordinates_2d< T > &  x,
const string &  init_coordinates_2d 
)

Definition at line 417 of file coordinates_2d.hpp.

418{
419 scifir::coordinates_2d<T> y(init_coordinates_2d);
420 return (x == y);
421}

◆ operator==() [3/3]

template<typename T >
bool operator== ( const string &  init_coordinates_2d,
const scifir::coordinates_2d< T > &  x 
)

Definition at line 430 of file coordinates_2d.hpp.

431{
432 scifir::coordinates_2d<T> y(init_coordinates_2d);
433 return (x == y);
434}

◆ operator>>()

template<typename T >
istream & operator>> ( istream &  is,
scifir::coordinates_2d< T > &  x 
)

Definition at line 469 of file coordinates_2d.hpp.

470{
471 char a[256];
472 is.getline(a, 256);
473 string b(a);
474 boost::trim(b);
476 return is;
477}