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_2dr.hpp File Reference
#include "./coordinates_2d.hpp"
#include "../coordinates/direction.hpp"
#include "../meca_number/angle.hpp"
#include "../util/types.hpp"
#include <iostream>
#include <string>
Include dependency graph for coordinates_2dr.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  scifir::coordinates_2dr< T >
 
class  scifir::coordinates_2dr< 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_2dr< T > &x)
 
string scifir::to_string (const coordinates_2dr< float > &x)
 
template<typename T , typename U >
T scifir::distance (const coordinates_2dr< T > &x, const coordinates_2dr< U > &y)
 
float scifir::distance (const coordinates_2dr< float > &x, const coordinates_2dr< float > &y)
 
template<typename T , typename U >
T scifir::distance (const coordinates_2dr< T > &x, const coordinates_2d< U > &y)
 
float scifir::distance (const coordinates_2dr< float > &x, const coordinates_2d< float > &y)
 
template<typename T , typename U >
T scifir::distance (const coordinates_2d< T > &x, const coordinates_2dr< U > &y)
 
float scifir::distance (const coordinates_2d< float > &x, const coordinates_2dr< float > &y)
 
template<typename T , typename U >
bool operator== (const scifir::coordinates_2dr< T > &x, const scifir::coordinates_2dr< U > &y)
 
template<typename T , typename U >
bool operator!= (const scifir::coordinates_2dr< T > &x, const scifir::coordinates_2dr< U > &y)
 
template<typename T , typename U >
bool operator== (const scifir::coordinates_2dr< T > &x, const scifir::coordinates_2d< U > &y)
 
template<typename T , typename U >
bool operator!= (const scifir::coordinates_2dr< T > &x, const scifir::coordinates_2d< U > &y)
 
template<typename T , typename U >
bool operator== (const scifir::coordinates_2d< T > &x, const scifir::coordinates_2dr< U > &y)
 
template<typename T , typename U >
bool operator!= (const scifir::coordinates_2d< T > &x, const scifir::coordinates_2dr< U > &y)
 
template<typename T >
bool operator== (const scifir::coordinates_2dr< T > &x, const string &init_coordinates_2dr)
 
template<typename T >
bool operator!= (const scifir::coordinates_2dr< T > &x, const string &init_coordinates_2dr)
 
template<typename T >
bool operator== (const string &init_coordinates_2dr, const scifir::coordinates_2dr< T > &x)
 
template<typename T >
bool operator!= (const string &init_coordinates_2dr, const scifir::coordinates_2dr< T > &x)
 
template<typename T >
void operator+= (string &x, const scifir::coordinates_2dr< T > &y)
 
template<typename T >
string operator+ (const string &x, const scifir::coordinates_2dr< T > &y)
 
template<typename T >
string operator+ (const scifir::coordinates_2dr< T > &x, const string &y)
 
template<typename T >
ostream & operator<< (ostream &os, const scifir::coordinates_2dr< T > &x)
 
ostream & operator<< (ostream &os, const scifir::coordinates_2dr< float > &x)
 
template<typename T >
istream & operator>> (istream &is, scifir::coordinates_2dr< T > &x)
 

Function Documentation

◆ operator!=() [1/5]

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

Definition at line 540 of file coordinates_2dr.hpp.

541{
542 return !(x == y);
543}

◆ operator!=() [2/5]

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

Definition at line 521 of file coordinates_2dr.hpp.

522{
523 return !(x == y);
524}

◆ operator!=() [3/5]

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

Definition at line 502 of file coordinates_2dr.hpp.

503{
504 return !(x == y);
505}

◆ operator!=() [4/5]

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

Definition at line 553 of file coordinates_2dr.hpp.

554{
555 return !(x == init_coordinates_2dr);
556}

◆ operator!=() [5/5]

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

Definition at line 566 of file coordinates_2dr.hpp.

567{
568 return !(init_coordinates_2dr == x);
569}

◆ operator+() [1/2]

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

Definition at line 584 of file coordinates_2dr.hpp.

585{
586 return to_string(x) + y;
587}
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_2dr< T > &  y 
)

Definition at line 578 of file coordinates_2dr.hpp.

579{
580 return x + to_string(y);
581}

◆ operator+=()

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

Definition at line 572 of file coordinates_2dr.hpp.

573{
574 x += to_string(y);
575}

◆ operator<<() [1/2]

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

Definition at line 28 of file coordinates_2dr.cpp.

29{
30 return os << scifir::to_string(x);
31}

◆ operator<<() [2/2]

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

Definition at line 590 of file coordinates_2dr.hpp.

591{
592 return os << to_string(x);
593}

◆ operator==() [1/5]

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

Definition at line 527 of file coordinates_2dr.hpp.

528{
529 if (x.x == y.x and x.y == y.y)
530 {
531 return true;
532 }
533 else
534 {
535 return false;
536 }
537}

◆ operator==() [2/5]

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

Definition at line 508 of file coordinates_2dr.hpp.

509{
510 if (x.x == y.x and x.y == y.y)
511 {
512 return true;
513 }
514 else
515 {
516 return false;
517 }
518}

◆ operator==() [3/5]

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

Definition at line 489 of file coordinates_2dr.hpp.

490{
491 if (x.x == y.x and x.y == y.y and x.theta == y.theta)
492 {
493 return true;
494 }
495 else
496 {
497 return false;
498 }
499}

◆ operator==() [4/5]

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

Definition at line 546 of file coordinates_2dr.hpp.

547{
548 scifir::coordinates_2dr<T> y(init_coordinates_2dr);
549 return (x == y);
550}

◆ operator==() [5/5]

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

Definition at line 559 of file coordinates_2dr.hpp.

560{
561 scifir::coordinates_2dr<T> y(init_coordinates_2dr);
562 return (x == y);
563}

◆ operator>>()

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

Definition at line 598 of file coordinates_2dr.hpp.

599{
600 char a[256];
601 is.getline(a, 256);
602 string b(a);
603 boost::trim(b);
605 return is;
606}