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
|
#include "../meca_number/angle.hpp"
#include "../units/base_units.hpp"
#include "../derived_units/physics_units.hpp"
#include "../util/types.hpp"
#include "../units/constants.hpp"
#include "./latitude.hpp"
#include "./longitude.hpp"
#include <iostream>
#include <string>
#include <cmath>
Go to the source code of this file.
Classes | |
class | scifir::coordinates_3d< T > |
Class that represents the position in 3D spaces. The space can be a length or, for the case of imaginary spaces, any custom dimension. The most interesting feature is the fact that all the coordinates systems in 3D are present at the same time, it's possible to use cartesian, cylindrical or spherical coordinates as needed for the same instance of coordinates, it's not needed to select just one of those systems. The geographical coordinates aren't yet finished. More... | |
class | scifir::coordinates_3d< float > |
Specialization of coordinates_3d, with the same behaviour and functions, that is specialized for float types. It can be used when it's needed to save memory, because a float uses less memory than a scalar_unit. More... | |
Namespaces | |
namespace | scifir |
The namespace scifir contains all scifir-units, excepting the string literals, which are outside. | |
Enumerations | |
enum class | scifir::cardinale_point { scifir::NORTH , scifir::SOUTH , scifir::EAST , scifir::WEST } |
Functions | |
latitude | scifir::ECEF_to_LLA_latitude (const scalar_unit &x, scalar_unit y, const scalar_unit &z) |
longitude | scifir::ECEF_to_LLA_longitude (const scalar_unit &x, scalar_unit y, const scalar_unit &z) |
scalar_unit | scifir::ECEF_to_LLA_altitude (const scalar_unit &x, scalar_unit y, const scalar_unit &z) |
scalar_unit | scifir::LLA_to_ECEF_x (const latitude &latitude, const longitude &longitude, scalar_unit altitude) |
scalar_unit | scifir::LLA_to_ECEF_y (const latitude &latitude, const longitude &longitude, scalar_unit altitude) |
scalar_unit | scifir::LLA_to_ECEF_z (const latitude &latitude, const longitude &longitude, scalar_unit altitude) |
latitude | scifir::ECEF_to_LLA_latitude (float x, float y, float z) |
longitude | scifir::ECEF_to_LLA_longitude (float x, float y, float z) |
float | scifir::ECEF_to_LLA_altitude (float x, float y, float z) |
string | scifir::to_string (cardinale_point x) |
template<typename T > | |
string | scifir::to_string (const coordinates_3d< T > &x) |
Returns the string representation of coordinates_3d. | |
string | scifir::to_string (const coordinates_3d< float > &x) |
Returns the string representation of coordinates_3d<float>. | |
cardinale_point | scifir::create_cardinale_point (const string &x) |
template<typename T , typename U > | |
T | scifir::distance (const coordinates_3d< T > &x, const coordinates_3d< U > &y) |
Calculates the distance between two coordinates_3d. | |
float | scifir::distance (const coordinates_3d< float > &x, const coordinates_3d< float > &y) |
Calculates the distance between two coordinates_3d<float>. | |
scalar_unit | scifir::cartesian_3d_to_cylindrical_p (const scalar_unit &x, scalar_unit y, const scalar_unit &z) |
Returns the p coordinate of the cylindrical coordinates given the x, y and z of cartesian coordinates in 3D. | |
angle | scifir::cartesian_3d_to_cylindrical_theta (const scalar_unit &x, scalar_unit y, const scalar_unit &z) |
Returns the theta coordinate of the cylindrical coordinates given the x, y and z of cartesian coordinates in 3D. | |
scalar_unit | scifir::cartesian_3d_to_cylindrical_z (const scalar_unit &x, const scalar_unit &y, const scalar_unit &z) |
Returns the z coordinate of the cylindrical coordinates given the x, y and z of cartesian coordinates in 3D. | |
scalar_unit | scifir::cartesian_3d_to_spherical_r (const scalar_unit &x, scalar_unit y, scalar_unit z) |
Returns the r coordinate of the spherical coordinates given the x, y and z of cartesian coordinates in 3D. | |
angle | scifir::cartesian_3d_to_spherical_theta (const scalar_unit &x, scalar_unit y, const scalar_unit &z) |
Returns the theta coordinate of the spherical coordinates given the x, y and z of cartesian coordinates in 3D. | |
angle | scifir::cartesian_3d_to_spherical_phi (const scalar_unit &x, scalar_unit y, scalar_unit z) |
Returns the phi coordinate of the spherical coordinates given the x, y and z of cartesian coordinates in 3D. | |
scalar_unit | scifir::spherical_to_cartesian_3d_x (const scalar_unit &r, const angle &theta, const angle &phi) |
Returns the x coordinate of the cartesian coordinates in 3D given the r, theta and phi of spherical coordinates. | |
scalar_unit | scifir::spherical_to_cartesian_3d_y (const scalar_unit &r, const angle &theta, const angle &phi) |
Returns the y coordinate of the cartesian coordinates in 3D given the r, theta and phi of spherical coordinates. | |
scalar_unit | scifir::spherical_to_cartesian_3d_z (const scalar_unit &r, const angle &theta, const angle &phi) |
Returns the z coordinate of the cartesian coordinates in 3D given the r, theta and phi of spherical coordinates. | |
scalar_unit | scifir::spherical_to_cylindrical_p (const scalar_unit &r, const angle &theta, const angle &phi) |
Returns the p coordinate of the cylindrical coordinates given the r, theta and phi of spherical coordinates. | |
angle | scifir::spherical_to_cylindrical_theta (const scalar_unit &r, const angle &theta, const angle &phi) |
Returns the theta coordinate of the cylindrical coordinates given the r, theta and phi of spherical coordinates. | |
scalar_unit | scifir::spherical_to_cylindrical_z (const scalar_unit &r, const angle &theta, const angle &phi) |
Returns the z coordinate of the cylindrical coordinates given the r, theta and phi of spherical coordinates. | |
scalar_unit | scifir::cylindrical_to_cartesian_3d_x (const scalar_unit &p, const angle &theta, const scalar_unit &z) |
Returns the x coordinate of the cartesian coordinates in 3D given the p, theta and z of cylindrical coordinates. | |
scalar_unit | scifir::cylindrical_to_cartesian_3d_y (const scalar_unit &p, const angle &theta, const scalar_unit &z) |
Returns the y coordinate of the cartesian coordinates in 3D given the p, theta and z of cylindrical coordinates. | |
scalar_unit | scifir::cylindrical_to_cartesian_3d_z (const scalar_unit &p, const angle &theta, const scalar_unit &z) |
Returns the z coordinate of the cartesian coordinates in 3D given the p, theta and z of cylindrical coordinates. | |
scalar_unit | scifir::cylindrical_to_spherical_r (const scalar_unit &p, const angle &theta, scalar_unit z) |
Returns the r coordinate of the spherical coordinates given the p, theta and z of cylindrical coordinates. | |
angle | scifir::cylindrical_to_spherical_theta (const scalar_unit &p, const angle &theta, const scalar_unit &z) |
Returns the theta coordinate of the spherical coordinates given the p, theta and z of cylindrical coordinates. | |
angle | scifir::cylindrical_to_spherical_phi (const scalar_unit &p, const angle &theta, scalar_unit z) |
Returns the phi coordinate of the spherical coordinates given the p, theta and z of cylindrical coordinates. | |
float | scifir::cartesian_3d_to_cylindrical_p (float x, float y, float z) |
Returns the p coordinate of the cylindrical coordinates given the x, y and z of cartesian coordinates in 3D. | |
angle | scifir::cartesian_3d_to_cylindrical_theta (float x, float y, float z) |
Returns the theta coordinate of the cylindrical coordinates given the x, y and z of cartesian coordinates in 3D. | |
float | scifir::cartesian_3d_to_cylindrical_z (float x, float y, float z) |
Returns the z coordinate of the cylindrical coordinates given the x, y and z of cartesian coordinates in 3D. | |
float | scifir::cartesian_3d_to_spherical_r (float x, float y, float z) |
Returns the r coordinate of the spherical coordinates given the x, y and z of cartesian coordinates in 3D. | |
angle | scifir::cartesian_3d_to_spherical_theta (float x, float y, float z) |
Returns the theta coordinate of the spherical coordinates given the x, y and z of cartesian coordinates in 3D. | |
angle | scifir::cartesian_3d_to_spherical_phi (float x, float y, float z) |
Returns the phi coordinate of the spherical coordinates given the x, y and z of cartesian coordinates in 3D. | |
float | scifir::spherical_to_cartesian_3d_x (float r, const angle &theta, const angle &phi) |
Returns the x coordinate of the cartesian coordinates in 3D given the r, theta and phi of spherical coordinates. | |
float | scifir::spherical_to_cartesian_3d_y (float r, const angle &theta, const angle &phi) |
Returns the y coordinate of the cartesian coordinates in 3D given the r, theta and phi of spherical coordinates. | |
float | scifir::spherical_to_cartesian_3d_z (float r, const angle &theta, const angle &phi) |
Returns the z coordinate of the cartesian coordinates in 3D given the r, theta and phi of spherical coordinates. | |
float | scifir::spherical_to_cylindrical_p (float r, const angle &theta, const angle &phi) |
Returns the p coordinate of the cylindrical coordinates given the r, theta and phi of spherical coordinates. | |
angle | scifir::spherical_to_cylindrical_theta (float r, const angle &theta, const angle &phi) |
Returns the theta coordinate of the cylindrical coordinates given the r, theta and phi of spherical coordinates. | |
float | scifir::spherical_to_cylindrical_z (float r, const angle &theta, const angle &phi) |
Returns the z coordinate of the cylindrical coordinates given the r, theta and phi of spherical coordinates. | |
float | scifir::cylindrical_to_cartesian_3d_x (float p, const angle &theta, float z) |
Returns the x coordinate of the cartesian coordinates in 3D given the p, theta and z of cylindrical coordinates. | |
float | scifir::cylindrical_to_cartesian_3d_y (float p, const angle &theta, float z) |
Returns the y coordinate of the cartesian coordinates in 3D given the p, theta and z of cylindrical coordinates. | |
float | scifir::cylindrical_to_cartesian_3d_z (float p, const angle &theta, float z) |
Returns the z coordinate of the cartesian coordinates in 3D given the p, theta and z of cylindrical coordinates. | |
float | scifir::cylindrical_to_spherical_r (float p, const angle &theta, float z) |
Returns the r coordinate of the spherical coordinates given the p, theta and z of cylindrical coordinates. | |
angle | scifir::cylindrical_to_spherical_theta (float p, const angle &theta, float z) |
Returns the theta coordinate of the spherical coordinates given the p, theta and z of cylindrical coordinates. | |
angle | scifir::cylindrical_to_spherical_phi (float p, const angle &theta, float z) |
Returns the phi coordinate of the spherical coordinates given the p, theta and z of cylindrical coordinates. | |
template<typename T , typename U > | |
bool | operator== (const scifir::coordinates_3d< T > &x, const scifir::coordinates_3d< U > &y) |
Returns true if both coordinates are equal in the three components. | |
template<typename T , typename U > | |
bool | operator!= (const scifir::coordinates_3d< T > &x, const scifir::coordinates_3d< U > &y) |
Returns true if both coordinates are different. | |
template<typename T > | |
bool | operator== (const scifir::coordinates_3d< T > &x, const string &init_coordinates_3d) |
Returns true if the coordinates and the initialization string of coordinates_3d represent the same coordinates. | |
template<typename T > | |
bool | operator!= (const scifir::coordinates_3d< T > &x, const string &init_coordinates_3d) |
Returns true if the coordinates and the initialization string of coordinates_3d represent different coordinates. | |
template<typename T > | |
bool | operator== (const string &init_coordinates_3d, const scifir::coordinates_3d< T > &x) |
Returns true if the coordinates and the initialization string of coordinates_3d represent the same coordinates. | |
template<typename T > | |
bool | operator!= (const string &init_coordinates_3d, const scifir::coordinates_3d< T > &x) |
Returns true if the coordinates and the initialization string of coordinates_3d represent different coordinates. | |
template<typename T > | |
void | operator+= (string &x, const scifir::coordinates_3d< T > &y) |
Concatenates to the string x the string representation of the coordinates_3d y. | |
template<typename T > | |
string | operator+ (const string &x, const scifir::coordinates_3d< T > &y) |
Concatenates the string x and the string representation of the coordinates_3d y. | |
template<typename T > | |
string | operator+ (const scifir::coordinates_3d< T > &x, const string &y) |
Concatenates the string y and the string representation of the coordinates_3d x. | |
template<typename T > | |
ostream & | operator<< (ostream &os, const scifir::coordinates_3d< T > &x) |
Adds the string representation of the coordinates_3d x to an output stream os. | |
ostream & | operator<< (ostream &os, const scifir::coordinates_3d< float > &x) |
Adds the string representation of the coordinates_3d<float> x to an output stream os. | |
template<typename T > | |
istream & | operator>> (istream &is, scifir::coordinates_3d< T > &x) |
Allows that an istream initializes by string a coordinates_3d x. | |
bool operator!= | ( | const scifir::coordinates_3d< T > & | x, |
const scifir::coordinates_3d< U > & | y | ||
) |
Returns true if both coordinates are different.
Definition at line 930 of file coordinates_3d.hpp.
bool operator!= | ( | const scifir::coordinates_3d< T > & | x, |
const string & | init_coordinates_3d | ||
) |
Returns true if the coordinates and the initialization string of coordinates_3d represent different coordinates.
Definition at line 943 of file coordinates_3d.hpp.
bool operator!= | ( | const string & | init_coordinates_3d, |
const scifir::coordinates_3d< T > & | x | ||
) |
Returns true if the coordinates and the initialization string of coordinates_3d represent different coordinates.
Definition at line 956 of file coordinates_3d.hpp.
string operator+ | ( | const scifir::coordinates_3d< T > & | x, |
const string & | y | ||
) |
Concatenates the string y and the string representation of the coordinates_3d x.
Definition at line 974 of file coordinates_3d.hpp.
string operator+ | ( | const string & | x, |
const scifir::coordinates_3d< T > & | y | ||
) |
Concatenates the string x and the string representation of the coordinates_3d y.
Definition at line 968 of file coordinates_3d.hpp.
void operator+= | ( | string & | x, |
const scifir::coordinates_3d< T > & | y | ||
) |
Concatenates to the string x the string representation of the coordinates_3d y.
Definition at line 962 of file coordinates_3d.hpp.
ostream & operator<< | ( | ostream & | os, |
const scifir::coordinates_3d< float > & | x | ||
) |
Adds the string representation of the coordinates_3d<float> x to an output stream os.
Definition at line 55 of file coordinates_3d.cpp.
ostream & operator<< | ( | ostream & | os, |
const scifir::coordinates_3d< T > & | x | ||
) |
Adds the string representation of the coordinates_3d x to an output stream os.
Definition at line 980 of file coordinates_3d.hpp.
bool operator== | ( | const scifir::coordinates_3d< T > & | x, |
const scifir::coordinates_3d< U > & | y | ||
) |
Returns true if both coordinates are equal in the three components.
Definition at line 917 of file coordinates_3d.hpp.
bool operator== | ( | const scifir::coordinates_3d< T > & | x, |
const string & | init_coordinates_3d | ||
) |
Returns true if the coordinates and the initialization string of coordinates_3d represent the same coordinates.
Definition at line 936 of file coordinates_3d.hpp.
bool operator== | ( | const string & | init_coordinates_3d, |
const scifir::coordinates_3d< T > & | x | ||
) |
Returns true if the coordinates and the initialization string of coordinates_3d represent the same coordinates.
Definition at line 949 of file coordinates_3d.hpp.
istream & operator>> | ( | istream & | is, |
scifir::coordinates_3d< T > & | x | ||
) |
Allows that an istream initializes by string a coordinates_3d x.
Definition at line 988 of file coordinates_3d.hpp.