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 | Typedefs | Enumerations | Functions | Variables
scifir Namespace Reference

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

Classes

class  address
 
class  aid
 Class that stores astronomical ids, not as an integer but with an string as identifier. Initialization string example: "(P) universe:milky-way:solar-system:earth". More...
 
class  angle
 Class that allows to work with angles. Each angle sizes 4 bytes. Initialization string example: "20°". More...
 
class  color
 
class  complex_number
 
class  conversion
 
class  coordinates_1d
 
class  coordinates_1d< float >
 
class  coordinates_2d
 
class  coordinates_2d< float >
 
class  coordinates_2dr
 
class  coordinates_2dr< float >
 
class  coordinates_3d
 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  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...
 
class  coordinates_3dr
 
class  coordinates_3dr< float >
 
class  coordinates_nd
 
class  coordinates_nd< float >
 
class  coordinates_ndr
 
class  coordinates_ndr< float >
 
class  dimension
 Class that represents dimensions of the SI system of units. Each dimension sizes 6 bytes, 1 byte for the dimension type, 1 byte for the prefix, 1 byte for the position (which can be the NUMERATOR or the DENOMINATOR), and 3 bytes for the custom dimension (in case it's used one). A base dimension is a dimension that doesn't has more base dimensions, a derived dimension has always base dimensions from which it's defined. More...
 
class  direction
 
struct  is_integer_number
 
struct  is_number
 
class  lab_number
 
class  latitude
 
class  longitude
 
class  matrix
 
class  percentage
 Class that allows to handle percentages and do calculations with it easy. It supports normal percentages (with %), ppm, ppb, ppt and ppq. The types ppb, ppt and ppq are currently not supported because the float type in percentage class can't store so lower values. More...
 
class  pixel
 
class  prefix
 Class that represents prefixes of the SI system of units. Each prefix sizes 1 byte. The prefix micro is added to a dimension with the symbol µ. More...
 
class  scalar_unit
 Class that allows to create scalar units, which are composed of a value (as a float) and dimensions. The dimensions can be of any number, and be simple dimensions, composite dimensions and/or special names of dimensions. All base and derived scalar unit classes inherit from scalar_unit. Initialization string example: "1 N". More...
 
class  size_2d
 Class that allows to store and calculate size in 2D, with width and height. The template parameter T allows to select any scalar_unit or numeric type to be the type of width and height (they always have the same type in the same instance). The width and height can be any scalar_unit, usually length, but imaginary spaces with custom dimensions are also allowed. Initialization string example: "1 m * 2 m". More...
 
class  size_2d< float >
 Specialization class of size_2d<T> that allows to store and calculate size in 2D, with width and height as float types. Initialization string example: "1 * 2". More...
 
class  size_3d
 Class that allows to store and calculate size in 3D, with width, height and depth. The template parameter T allows to select any scalar_unit or numeric type to be the type of the width, the height and the depth (they always have the same type in the same instance). The width, height and depth can be any scalar_unit, usually length, but imaginary spaces with custom dimensions are also allowed. Initialization string example: "1 m * 2 m * 4 m". More...
 
class  size_3d< float >
 Specialization class of size_3d<T> that allows to store and calculate size in 3D, with width, height and depth as float types. Initialization string example: "1 * 2 * 4". More...
 
class  size_nd
 
class  size_nd< float >
 
class  time_duration
 
class  vector_unit_2d
 Class that creates a vector unit in 2D. The vector is in polar coordinates with a value and dimensions of the scalar_unit, and an angle theta for his direction. All base and derived vectorial unit classes in 2D inherit from vector_unit_2d, and add the suffix **_2d** in their name. Initialization string example: "1 N 20θ". 'θ' is the Unicode Character U+03B8. More...
 
class  vector_unit_3d
 Class that creates a vector unit in 3D. The vector is in spherical coordinates with a value and dimensions of the scalar_unit, and an angle theta and another angle phi for his direction. All base and derived vectorial unit classes in 3D inherit from vector_unit_3d, and add the suffix **_3d** in their name. Initialization string example: "1 N 20θ 30Φ". 'θ' is the Unicode Character U+03B8. 'Φ' is the Unicode Character U+03A6. More...
 
class  vector_unit_nd
 Class that creates a vector in ND, which means a variable number of dimensions. A vector_unit_nd can change to be in 1D, in 2D or in 3D, but it cannot be in more than one dimension at the same time. The member-variables of vector_unit_nd are the value and the vector<dimension> of scalar_unit, and a vector<angle> angles. The number of angles is equal to the number of dimensions vector unit has - 1. In 1D vector_unit_nd doesn't has angles, in 2D vector_unit_nd is in polar coordinates and has 1 angle, and in 3D vector_unit_nd is in spherical coordinates and has 2 angles. All base and derived vectorial unit classes in ND inherit from vector_unit_nd, and add the suffix **_nd** in their name. Initialization string example: "1 N 20° 30° 40°". '°' is the Unicode Character U+00B0. More...
 
class  zid
 Class that allows to store information about a zone, including the astronomical object inside which the zone is. The zone can be in any astronomical object, not only the Earth is supported. Initialization string example: "(P) universe:milky-way:solar-system:earth (Z) chile:region-metropolitana:santiago:providencia". More...
 

Typedefs

typedef length wavelength
 

Enumerations

enum class  astronomical_body : int8_t {
  NONE , MILKY_WAY , ANDROMEDA , SOLAR_SYSTEM ,
  SUN , MOON , MERCURY , VENUS ,
  EARTH , MARS , JUPITER , SATURN ,
  URANUS , NEPTUNE , CERES , ORCUS ,
  PLUTO , HAUMEA , QUAOAR , MAKEMAKE ,
  GONGGONG , ERIS , SEDNA , IO ,
  EUROPA , GANYMEDE , CALLISTO , MIMAS ,
  ENCELADUS , TETHYS , DIONE , RHEA ,
  TITAN , IAPETUS , MIRANDA , ARIEL ,
  UMBRIEL , TITANIA , OBERON , TRITON ,
  CHARON , DYSNOMIA
}
 Contains predefined astronomical bodies to be set automatically in the aid class. All of them are important astronomical bodies, unimportant astronomical bodies aren't included. More...
 
enum class  cardinale_point { NORTH , SOUTH , EAST , WEST }
 

Functions

string to_string (const aid &x)
 Creates a string representation of aid, it's for aid equivalent to the display() function of aid.
 
string to_string (const aid::type &x)
 Converts a value of the enum aid::type to its string representation, which can be a single or a pair of letters. The value UNIVERSE returns U. The value GALAXY returns G. The value SOLAR_SYSTEM returns SS. The value PLANET returns P. The value STAR returns ST. The value ASTEROID returns A. The value MOON returns MN. The value METEOR returns MT. The value NONE returns an empty string.
 
aid::type create_astronomical_type (const string &astronomical_type_abbreviation)
 Creates an instance of an aid::type with the given string, which is the reverse as the to_string() function of aid::type.
 
string to_string (const coordinates_1d< float > &x)
 
float distance (const coordinates_1d< float > &x, const coordinates_1d< float > &y)
 
template<typename T >
string to_string (const coordinates_1d< T > &x)
 
template<typename T , typename U >
T distance (const coordinates_1d< T > &x, const coordinates_1d< U > &y)
 
string to_string (const coordinates_2d< float > &x)
 
float distance (const coordinates_2d< float > &x, const coordinates_2d< float > &y)
 
template<typename T >
string to_string (const coordinates_2d< T > &x)
 
template<typename T , typename U >
T distance (const coordinates_2d< T > &x, const coordinates_2d< U > &y)
 
scalar_unit cartesian_2d_to_polar_p (const scalar_unit &x, scalar_unit y)
 
angle cartesian_2d_to_polar_theta (const scalar_unit &x, scalar_unit y)
 
scalar_unit polar_to_cartesian_2d_x (const scalar_unit &p, const angle &theta)
 
scalar_unit polar_to_cartesian_2d_y (const scalar_unit &p, const angle &theta)
 
float cartesian_2d_to_polar_p (float x, float y)
 
angle cartesian_2d_to_polar_theta (float x, float y)
 
float polar_to_cartesian_2d_x (float p, const angle &theta)
 
float polar_to_cartesian_2d_y (float p, const angle &theta)
 
string to_string (const coordinates_2dr< float > &x)
 
float distance (const coordinates_2dr< float > &x, const coordinates_2dr< float > &y)
 
float distance (const coordinates_2dr< float > &x, const coordinates_2d< float > &y)
 
float distance (const coordinates_2d< float > &x, const coordinates_2dr< float > &y)
 
template<typename T >
string to_string (const coordinates_2dr< T > &x)
 
template<typename T , typename U >
T distance (const coordinates_2dr< T > &x, const coordinates_2dr< U > &y)
 
template<typename T , typename U >
T distance (const coordinates_2dr< T > &x, const coordinates_2d< U > &y)
 
template<typename T , typename U >
T distance (const coordinates_2d< T > &x, const coordinates_2dr< U > &y)
 
string to_string (cardinale_point x)
 
string to_string (const coordinates_3d< float > &x)
 Returns the string representation of coordinates_3d<float>.
 
cardinale_point create_cardinale_point (const string &x)
 
float distance (const coordinates_3d< float > &x, const coordinates_3d< float > &y)
 Calculates the distance between two coordinates_3d<float>.
 
latitude ECEF_to_LLA_latitude (const scalar_unit &x, scalar_unit y, const scalar_unit &z)
 
longitude ECEF_to_LLA_longitude (const scalar_unit &x, scalar_unit y, const scalar_unit &z)
 
scalar_unit ECEF_to_LLA_altitude (const scalar_unit &x, scalar_unit y, const scalar_unit &z)
 
scalar_unit LLA_to_ECEF_x (const latitude &latitude, const longitude &longitude, scalar_unit altitude)
 
scalar_unit LLA_to_ECEF_y (const latitude &latitude, const longitude &longitude, scalar_unit altitude)
 
scalar_unit LLA_to_ECEF_z (const latitude &latitude, const longitude &longitude, scalar_unit altitude)
 
latitude ECEF_to_LLA_latitude (float x, float y, float z)
 
longitude ECEF_to_LLA_longitude (float x, float y, float z)
 
float ECEF_to_LLA_altitude (float x, float y, float z)
 
template<typename T >
string to_string (const coordinates_3d< T > &x)
 Returns the string representation of coordinates_3d.
 
template<typename T , typename U >
T distance (const coordinates_3d< T > &x, const coordinates_3d< U > &y)
 Calculates the distance between two coordinates_3d.
 
scalar_unit 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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.
 
string to_string (const coordinates_3dr< float > &x)
 
float distance (const coordinates_3dr< float > &x, const coordinates_3dr< float > &y)
 
float distance (const coordinates_3dr< float > &x, const coordinates_3d< float > &y)
 
float distance (const coordinates_3d< float > &x, const coordinates_3dr< float > &y)
 
template<typename T >
string to_string (const coordinates_3dr< T > &x)
 
template<typename T , typename U >
T distance (const coordinates_3dr< T > &x, const coordinates_3dr< U > &y)
 
template<typename T , typename U >
T distance (const coordinates_3dr< T > &x, const coordinates_3d< U > &y)
 
template<typename T , typename U >
T distance (const coordinates_3d< T > &x, const coordinates_3dr< U > &y)
 
string to_string (const coordinates_nd< float > &x)
 
float distance (const coordinates_nd< float > &x, const coordinates_nd< float > &y)
 
template<typename T >
string to_string (const coordinates_nd< T > &x)
 
template<typename T , typename U >
T distance (const coordinates_nd< T > &x, const coordinates_nd< U > &y)
 
string to_string (const coordinates_ndr< float > &x)
 
float distance (const coordinates_ndr< float > &x, const coordinates_ndr< float > &y)
 
float distance (const coordinates_ndr< float > &x, const coordinates_nd< float > &y)
 
float distance (const coordinates_nd< float > &x, const coordinates_ndr< float > &y)
 
template<typename T >
string to_string (const coordinates_ndr< T > &x)
 
template<typename T , typename U >
T distance (const coordinates_ndr< T > &x, const coordinates_ndr< U > &y)
 
template<typename T , typename U >
T distance (const coordinates_ndr< T > &x, const coordinates_nd< U > &y)
 
template<typename T , typename U >
T distance (const coordinates_nd< T > &x, const coordinates_ndr< U > &y)
 
direction::name create_direction (const string &x)
 
direction::name invert (direction::name x)
 
string to_string (direction::name x)
 
string to_string (const direction &x)
 
bool is_latitude (const string &init_latitude)
 
bool is_longitude (const string &init_longitude)
 
string to_string (const zid &x)
 Returns a string representation of zid, same as display().
 
string to_string (const zid::type &x)
 Converts a value of the enum zid::type to its string representation, which is a single letter. The value COUNTRY returns C. The value REGION returns R. The value SETTLEMENT returns S. The value ZONE returns Z.
 
zid::type create_zone_type (const string &zone_type_abbreviation)
 Creates an instance of a zid::type with the given string, which is the reverse as the to_string() function of zid::type.
 
string to_string (const angle &x)
 Converts an angle to their string representation.
 
bool is_angle (const string &init_angle)
 Checks if some string is an initialization string of an angle.
 
bool parallel (const angle &x, const angle &y)
 Checks if two angles in a 2D correspond to parallel lines (or parallel vectors).
 
bool orthogonal (const angle &x, const angle &y)
 Checks if two angles in a 2D correspond to orthogonal lines (or orthogonal vectors).
 
angle sqrt (const angle &x)
 Calculates the square root of the angle x and returns that new angle.
 
angle sqrt_nth (const angle &x, int index)
 Calculates the nth root of the angle x and returns that new angle.
 
float sin (const angle &x)
 Calculates the sin of angle x. It uses the sin() function of the standard library of C++, the difference is that angle is in degrees, not in radians.
 
float cos (const angle &x)
 Calculates the cos of angle x. It uses the cos() function of the standard library of C++, the difference is that angle is in degrees, not in radians.
 
float tan (const angle &x)
 Calculates the tan of angle x. It uses the tan() function of the standard library of C++, the difference is that angle is in degrees, not in radians.
 
angle asin (float x)
 Calculates the asin of some value x and returns the result as angle in degrees.
 
angle acos (float x)
 Calculates the acos of some value x and returns the result as angle in degrees.
 
angle atan (float x)
 Calculates the atan of some value x and returns the result as angle in degrees.
 
angle atan2 (float y, float x)
 
float sinh (const angle &x)
 Calculates the sinh of angle x. It uses the sinh() function of the standard library of C++, the difference is that angle is in degrees, not in radians.
 
float cosh (const angle &x)
 Calculates the cosh of angle x. It uses the cosh() function of the standard library of C++, the difference is that angle is in degrees, not in radians.
 
float tanh (const angle &x)
 Calculates the tanh of angle x. It uses the tanh() function of the standard library of C++, the difference is that angle is in degrees, not in radians.
 
angle asinh (float x)
 Calculates the asinh of some value x and returns the result as angle in degrees.
 
angle acosh (float x)
 Calculates the acosh of some value x and returns the result as angle in degrees.
 
angle atanh (float x)
 Calculates the atanh of some value x and returns the result as angle in degrees.
 
float radian_to_degree (float x)
 Converts a radian to degree.
 
float gradian_to_degree (float x)
 
float turn_to_degree (float x)
 
float degree_to_radian (float x)
 Converts a degree to a radian.
 
float gradian_to_radian (float x)
 
float turn_to_radian (float x)
 
float degree_to_gradian (float x)
 
float radian_to_gradian (float x)
 
float turn_to_gradian (float x)
 
float degree_to_turn (float x)
 
float radian_to_turn (float x)
 
float gradian_to_turn (float x)
 
float asin_degree (float x)
 Calculates the asin receiving x in degrees. It uses the asin() function of the standard library of C++, but the difference is that the argument is in degrees, not in radians.
 
float acos_degree (float x)
 Calculates the acos receiving x in degrees. It uses the acos() function of the standard library of C++, but the difference is that the argument is in degrees, not in radians.
 
float atan_degree (float x)
 Calculates the atan receiving x in degrees. It uses the atan() function of the standard library of C++, but the difference is that the argument is in degrees, not in radians.
 
float asinh_degree (float x)
 Calculates the asinh receiving x in degrees. It uses the asinh() function of the standard library of C++, but the difference is that the argument is in degrees, not in radians.
 
float acosh_degree (float x)
 Calculates the acosh receiving x in degrees. It uses the acosh() function of the standard library of C++, but the difference is that the argument is in degrees, not in radians.
 
float atanh_degree (float x)
 Calculates the atanh receiving x in degrees. It uses the atanh() function of the standard library of C++, but the difference is that the argument is in degrees, not in radians.
 
bool is_complex (const string &init_complex_number)
 
template<typename T >
string to_string (const complex_number< T > &x)
 
template<typename T >
T abs (const complex_number< T > &x)
 
template<typename T >
complex_number< scalar_unitsqrt (const complex_number< T > &x)
 
bool is_lab_number (const string &init_lab_number)
 
template<typename T >
string to_string (const lab_number< T > &x)
 
string to_string (const percentage &x)
 Returns a string representation of percentage x.
 
bool is_percentage (const string &init_percentage)
 Checks if a string is an initialization string of percentage.
 
 VECTOR_UNIT_CPP (specific_angular_momentum,"m2/s")
 
 VECTOR_UNIT_HPP (specific_angular_momentum)
 
 SCALAR_UNIT_CPP (brain_memory,"memo")
 
 SCALAR_UNIT_HPP (brain_memory)
 
 SCALAR_UNIT_CPP (density,"g/m3")
 
 SCALAR_UNIT_CPP (viscosity,"m2/s")
 
 SCALAR_UNIT_CPP (specific_volume,"m3/g")
 
 SCALAR_UNIT_CPP (specific_heat_capacity,"J/K*kg")
 
 SCALAR_UNIT_CPP (specific_entropy,"m2/s2*K")
 
 SCALAR_UNIT_CPP (specific_energy,"m2/s2")
 
 SCALAR_UNIT_CPP (molar_volume,"m3/mol")
 
 SCALAR_UNIT_CPP (molar_mass,"g/mol")
 
 SCALAR_UNIT_CPP (molar_heat_capacity,"m2*g/s2*K*mol")
 
 SCALAR_UNIT_CPP (molar_enthalpy,"m2*g/s2*mol")
 
 SCALAR_UNIT_CPP (molar_entropy,"m2*g/s2*K*mol")
 
 SCALAR_UNIT_CPP (molar_energy,"m2*g/s2*mol")
 
 SCALAR_UNIT_CPP (molar_conductivity,"s3*A2/g*mol")
 
 SCALAR_UNIT_CPP (energy_density,"g/m*s2")
 
 SCALAR_UNIT_CPP (catalytic_efficiency,"m3/s*mol")
 
 SCALAR_UNIT_CPP (molarity,"M")
 
 SCALAR_UNIT_CPP (molality,"mol/g")
 
 SCALAR_UNIT_CPP (linear_mass_density,"g/m")
 
 SCALAR_UNIT_CPP (area_density,"g/m2")
 
 SCALAR_UNIT_CPP (dynamic_viscosity,"g/m*s")
 
 SCALAR_UNIT_CPP (mass_flow_rate,"g/s")
 
 SCALAR_UNIT_CPP (catalytic_activity,"kat")
 
 SCALAR_UNIT_CPP (amount_of_effect,"IU")
 
 SCALAR_UNIT_HPP (density)
 
 SCALAR_UNIT_HPP (viscosity)
 
 SCALAR_UNIT_HPP (specific_volume)
 
 SCALAR_UNIT_HPP (specific_heat_capacity)
 
 SCALAR_UNIT_HPP (specific_entropy)
 
 SCALAR_UNIT_HPP (specific_energy)
 
 SCALAR_UNIT_HPP (molar_volume)
 
 SCALAR_UNIT_HPP (molar_mass)
 
 SCALAR_UNIT_HPP (molar_heat_capacity)
 
 SCALAR_UNIT_HPP (molar_enthalpy)
 
 SCALAR_UNIT_HPP (molar_entropy)
 
 SCALAR_UNIT_HPP (molar_energy)
 
 SCALAR_UNIT_HPP (molar_conductivity)
 
 SCALAR_UNIT_HPP (energy_density)
 
 SCALAR_UNIT_HPP (catalytic_efficiency)
 
 SCALAR_UNIT_HPP (molarity)
 
 SCALAR_UNIT_HPP (molality)
 
 SCALAR_UNIT_HPP (linear_mass_density)
 
 SCALAR_UNIT_HPP (area_density)
 
 SCALAR_UNIT_HPP (dynamic_viscosity)
 
 SCALAR_UNIT_HPP (mass_flow_rate)
 
 SCALAR_UNIT_HPP (catalytic_activity)
 
 SCALAR_UNIT_HPP (amount_of_effect)
 
 SCALAR_UNIT_CPP (electrical_conductivity,"S/m")
 
 SCALAR_UNIT_CPP (resistance,"Ω")
 
 SCALAR_UNIT_CPP (electric_conductance,"S")
 
 SCALAR_UNIT_CPP (capacitance,"F")
 
 SCALAR_UNIT_CPP (permittivity,"F/m")
 
 SCALAR_UNIT_CPP (resistivity,"Ω*m")
 
 SCALAR_UNIT_CPP (linear_charge_density,"C/m")
 
 SCALAR_UNIT_CPP (surface_charge_density,"C/m2")
 
 SCALAR_UNIT_CPP (volume_charge_density,"C/m3")
 
 SCALAR_UNIT_CPP (frequency_drift,"1/s2")
 
 SCALAR_UNIT_HPP (electrical_conductivity)
 
 SCALAR_UNIT_HPP (resistance)
 
 SCALAR_UNIT_HPP (electric_conductance)
 
 SCALAR_UNIT_HPP (capacitance)
 
 SCALAR_UNIT_HPP (permittivity)
 
 SCALAR_UNIT_HPP (resistivity)
 
 SCALAR_UNIT_HPP (linear_charge_density)
 
 SCALAR_UNIT_HPP (surface_charge_density)
 
 SCALAR_UNIT_HPP (volume_charge_density)
 
 SCALAR_UNIT_HPP (frequency_drift)
 
 SCALAR_UNIT_CPP (transfer_speed,"B/s")
 
 SCALAR_UNIT_HPP (transfer_speed)
 
 VECTOR_UNIT_2D_CPP (displacement,"m")
 
 VECTOR_UNIT_3D_CPP (displacement,"m")
 
 VECTOR_UNIT_ND_CPP (displacement,"m")
 
 VECTOR_UNIT_CPP (velocity,"m/s")
 
 VECTOR_UNIT_CPP (acceleration,"m/s2")
 
 VECTOR_UNIT_CPP (momentum,"kg*m/s")
 
 VECTOR_UNIT_CPP (jerk,"m/s3")
 
 VECTOR_UNIT_CPP (snap,"m/s4")
 
 VECTOR_UNIT_CPP (angular_velocity,"rad/s")
 
 VECTOR_UNIT_CPP (angular_acceleration,"rad/s2")
 
 VECTOR_UNIT_CPP (angular_momentum,"m2*kg/s")
 
 VECTOR_UNIT_CPP (impulse,"m*kg/s")
 
 VECTOR_UNIT_CPP (force,"N")
 
 VECTOR_UNIT_CPP (torque,"kg*m2/s2")
 
 VECTOR_UNIT_CPP (pressure,"Pa")
 
 VECTOR_UNIT_CPP (surface_tension,"kg/s2")
 
 SCALAR_UNIT_CPP (stiffness,"kg/s2")
 
 SCALAR_UNIT_CPP (moment_of_inertia,"m2*kg")
 
 VECTOR_UNIT_CPP (yank,"N/s")
 
 SCALAR_UNIT_CPP (electric_current,"A")
 
 SCALAR_UNIT_CPP (voltage,"V")
 
 VECTOR_UNIT_CPP (electric_displacement_field,"C/m2")
 
 SCALAR_UNIT_CPP (electric_charge_density,"C/m3")
 
 SCALAR_UNIT_CPP (electric_current_density,"A/m2")
 
 VECTOR_UNIT_CPP (electric_field_strength,"V/m")
 
 SCALAR_UNIT_CPP (electron_mobility,"m2/V*s")
 
 SCALAR_UNIT_CPP (inductance,"H")
 
 SCALAR_UNIT_CPP (volumetric_flow,"m3/s")
 
 SCALAR_UNIT_CPP (diffusion_coefficient,"m2/s")
 
 SCALAR_UNIT_CPP (compressibility,"m*s2/kg")
 
 SCALAR_UNIT_CPP (polarization_density,"C/m2")
 
 SCALAR_UNIT_CPP (magnetic_permeability,"H/m")
 
 SCALAR_UNIT_CPP (magnetization,"A/m")
 
 SCALAR_UNIT_CPP (magnetic_flux,"Wb")
 
 VECTOR_UNIT_CPP (magnetic_flux_density,"T")
 
 VECTOR_UNIT_CPP (magnetic_moment,"Wb*m")
 
 SCALAR_UNIT_CPP (magnetic_reluctance,"1/H")
 
 VECTOR_UNIT_CPP (magnetic_vector_potential,"Wb/m")
 
 SCALAR_UNIT_CPP (magnetic_rigidity,"T*m")
 
 VECTOR_UNIT_CPP (magnetomotive_force,"A*rad")
 
 SCALAR_UNIT_CPP (magnetic_susceptibility,"m/H")
 
 SCALAR_UNIT_CPP (optical_power,"1/m")
 
 SCALAR_UNIT_CPP (illuminance,"lx")
 
 SCALAR_UNIT_CPP (luminous_flux,"lm")
 
 SCALAR_UNIT_CPP (luminous_energy,"lm*s")
 
 SCALAR_UNIT_CPP (luminous_exposure,"lx*s")
 
 SCALAR_UNIT_CPP (luminous_efficacy,"lm/W")
 
 SCALAR_UNIT_CPP (ionizing_radiation,"Gy")
 
 SCALAR_UNIT_CPP (absorbed_dose,"Gy/s")
 
 SCALAR_UNIT_CPP (energy,"J")
 
 SCALAR_UNIT_CPP (action,"kg*m2/s")
 
 SCALAR_UNIT_CPP (power,"W")
 
 SCALAR_UNIT_CPP (power_density,"kg/m*s3")
 
 SCALAR_UNIT_CPP (entropy,"kg*m2/K*s2")
 
 SCALAR_UNIT_CPP (heat_capacity,"J/K")
 
 SCALAR_UNIT_CPP (heat_flux_density,"kg/s3")
 
 SCALAR_UNIT_CPP (thermal_conductivity,"W/m*K")
 
 SCALAR_UNIT_CPP (thermal_diffusivity,"m2/s")
 
 SCALAR_UNIT_CPP (thermal_resistance,"K/W")
 
 SCALAR_UNIT_CPP (thermal_expansion_coefficient,"1/K")
 
 VECTOR_UNIT_CPP (temperature_gradient,"K/m")
 
 SCALAR_UNIT_CPP (energy_flux_density,"kg/s3")
 
 SCALAR_UNIT_CPP (fuel_efficiency,"1/m2")
 
 SCALAR_UNIT_CPP (wavenumber,"1/m")
 
 SCALAR_UNIT_CPP (frequency,"Hz")
 
 SCALAR_UNIT_CPP (sound_power,"dB")
 
 VECTOR_UNIT_2D_HPP (displacement)
 
 VECTOR_UNIT_3D_HPP (displacement)
 
 VECTOR_UNIT_ND_HPP (displacement)
 
 VECTOR_UNIT_HPP (velocity)
 
 VECTOR_UNIT_HPP (acceleration)
 
 VECTOR_UNIT_HPP (momentum)
 
 VECTOR_UNIT_HPP (jerk)
 
 VECTOR_UNIT_HPP (snap)
 
 VECTOR_UNIT_HPP (angular_velocity)
 
 VECTOR_UNIT_HPP (angular_acceleration)
 
 VECTOR_UNIT_HPP (angular_momentum)
 
 VECTOR_UNIT_HPP (impulse)
 
 VECTOR_UNIT_HPP (force)
 
 VECTOR_UNIT_HPP (torque)
 
 VECTOR_UNIT_HPP (pressure)
 
 VECTOR_UNIT_HPP (surface_tension)
 
 SCALAR_UNIT_HPP (stiffness)
 
 SCALAR_UNIT_HPP (moment_of_inertia)
 
 VECTOR_UNIT_HPP (yank)
 
 SCALAR_UNIT_HPP (electric_current)
 
 SCALAR_UNIT_HPP (voltage)
 
 VECTOR_UNIT_HPP (electric_displacement_field)
 
 SCALAR_UNIT_HPP (electric_charge_density)
 
 SCALAR_UNIT_HPP (electric_current_density)
 
 VECTOR_UNIT_HPP (electric_field_strength)
 
 SCALAR_UNIT_HPP (electron_mobility)
 
 SCALAR_UNIT_HPP (inductance)
 
 SCALAR_UNIT_HPP (volumetric_flow)
 
 SCALAR_UNIT_HPP (diffusion_coefficient)
 
 SCALAR_UNIT_HPP (compressibility)
 
 SCALAR_UNIT_HPP (polarization_density)
 
 SCALAR_UNIT_HPP (magnetic_permeability)
 
 SCALAR_UNIT_HPP (magnetization)
 
 SCALAR_UNIT_HPP (magnetic_flux)
 
 VECTOR_UNIT_HPP (magnetic_flux_density)
 
 VECTOR_UNIT_HPP (magnetic_moment)
 
 SCALAR_UNIT_HPP (magnetic_reluctance)
 
 VECTOR_UNIT_HPP (magnetic_vector_potential)
 
 SCALAR_UNIT_HPP (magnetic_rigidity)
 
 VECTOR_UNIT_HPP (magnetomotive_force)
 
 SCALAR_UNIT_HPP (magnetic_susceptibility)
 
 SCALAR_UNIT_HPP (optical_power)
 
 SCALAR_UNIT_HPP (illuminance)
 
 SCALAR_UNIT_HPP (luminous_flux)
 
 SCALAR_UNIT_HPP (luminous_energy)
 
 SCALAR_UNIT_HPP (luminous_exposure)
 
 SCALAR_UNIT_HPP (luminous_efficacy)
 
 SCALAR_UNIT_HPP (ionizing_radiation)
 
 SCALAR_UNIT_HPP (absorbed_dose)
 
 SCALAR_UNIT_HPP (energy)
 
 SCALAR_UNIT_HPP (action)
 
 SCALAR_UNIT_HPP (power)
 
 SCALAR_UNIT_HPP (power_density)
 
 SCALAR_UNIT_HPP (entropy)
 
 SCALAR_UNIT_HPP (heat_capacity)
 
 SCALAR_UNIT_HPP (heat_flux_density)
 
 SCALAR_UNIT_HPP (thermal_conductivity)
 
 SCALAR_UNIT_HPP (thermal_diffusivity)
 
 SCALAR_UNIT_HPP (thermal_resistance)
 
 SCALAR_UNIT_HPP (thermal_expansion_coefficient)
 
 VECTOR_UNIT_HPP (temperature_gradient)
 
 SCALAR_UNIT_HPP (energy_flux_density)
 
 SCALAR_UNIT_HPP (fuel_efficiency)
 
 SCALAR_UNIT_HPP (wavenumber)
 
 SCALAR_UNIT_HPP (frequency)
 
 SCALAR_UNIT_HPP (sound_power)
 
 SCALAR_UNIT_CPP (radioactivity,"Bq")
 
 VECTOR_UNIT_CPP (irradiance,"kg/s3")
 
 VECTOR_UNIT_CPP (radiant_exposure,"kg/s2")
 
 SCALAR_UNIT_CPP (radiant_intensity,"kg*m2/s3")
 
 SCALAR_UNIT_CPP (radiance,"kg/s3")
 
 SCALAR_UNIT_CPP (spectral_radiance,"kg/m*s3")
 
 VECTOR_UNIT_CPP (radiant_flux,"kg*m2/s3")
 
 VECTOR_UNIT_CPP (spectral_flux,"kg*m/s3")
 
 SCALAR_UNIT_HPP (radioactivity)
 
 VECTOR_UNIT_HPP (irradiance)
 
 VECTOR_UNIT_HPP (radiant_exposure)
 
 SCALAR_UNIT_HPP (radiant_intensity)
 
 SCALAR_UNIT_HPP (radiance)
 
 SCALAR_UNIT_HPP (spectral_radiance)
 
 VECTOR_UNIT_HPP (radiant_flux)
 
 VECTOR_UNIT_HPP (spectral_flux)
 
 SCALAR_UNIT_CPP (area,"m2")
 
 SCALAR_UNIT_CPP (volume,"m3")
 
 SCALAR_UNIT_CPP (volume_4d,"m4")
 
 SCALAR_UNIT_CPP (curvature,"1/m")
 
 SCALAR_UNIT_HPP_BEGIN (area)
 
 area (const size_2d< length > &)
 
 SCALAR_UNIT_HPP_END ()
 
 SCALAR_UNIT_HPP_BEGIN (volume)
 
 volume (const size_3d< length > &)
 
 SCALAR_UNIT_HPP (volume_4d)
 
 SCALAR_UNIT_HPP (curvature)
 
string to_string (const pixel &x)
 
bool is_pixel (const string &init_pixel)
 
pixel sqrt (const pixel &x)
 
pixel sqrt_nth (const pixel &x, int index)
 
string to_string (const size_2d< float > &x)
 Returns a string representation of size_2d<float>.
 
template<typename T >
string to_string (const size_2d< T > &x)
 Returns a string representation of size_2d<T>.
 
string to_string (const size_3d< float > &x)
 Returns a string representation of size_3d<float>.
 
template<typename T >
string to_string (const size_3d< T > &x)
 Returns a string representation of size_3d<T>.
 
string to_string (const size_nd< float > &x)
 
template<typename T >
string to_string (const size_nd< T > &x)
 
 SCALAR_UNIT_CPP (length,"m")
 
 SCALAR_UNIT_CPP (mass,"g")
 
 SCALAR_UNIT_CPP (charge,"C")
 
 SCALAR_UNIT_CPP (temperature,"K")
 
 SCALAR_UNIT_CPP (mole,"mol")
 
 SCALAR_UNIT_CPP (light_intensity,"cd")
 
 SCALAR_UNIT_CPP (information_size,"B")
 
 SCALAR_UNIT_HPP (length)
 
 SCALAR_UNIT_HPP_BEGIN (mass)
 
 mass (const percentage &new_percentage, const mass &new_mass)
 
 mass (const string &init_percentage, const string &init_mass)
 
 SCALAR_UNIT_HPP (charge)
 
 SCALAR_UNIT_HPP (temperature)
 
 SCALAR_UNIT_HPP_BEGIN (mole)
 
 mole (const percentage &new_percentage, const mole &new_mole)
 
 mole (const string &init_percentage, const string &init_mole)
 
int get_number_of_particles () const
 
 SCALAR_UNIT_HPP (light_intensity)
 
 SCALAR_UNIT_HPP (information_size)
 
float fahrenheit_to_kelvin (float x)
 
float kelvin_to_fahrenheit (float x)
 
string to_string (const dimension &x)
 Creates the string representation of a dimension.
 
string to_string (const vector< dimension > &x_dimensions, bool with_brackets)
 Creates the string representation of a vector of dimensions. Used to display the dimensions of scalar_unit and all vector_unit classes. The dimensions can be displayed optionally between brackets like '[]' too.
 
string to_latex (const vector< dimension > &x_dimensions, bool with_brackets)
 
vector< dimensioncreate_dimensions (string init_dimensions)
 Creates the dimensions from an initialization string of dimensions.
 
vector< dimensioncreate_base_dimensions (const string &init_dimensions)
 Creates the base dimensions from an initialization string of dimensions.
 
vector< dimensioncreate_base_dimensions (const vector< dimension > &x)
 Creates all the base dimensions from a vector of dimensions.
 
vector< dimensioncreate_base_dimensions (const vector< dimension > &x, long double &value)
 Creates all the base dimensions from a vector of dimensions, updating also the associated value related to those dimensions based on the prefix math and the conversion factor of the dimension, if that conversion factor is different than one.
 
vector< dimensionmultiply_dimensions (const vector< dimension > &x, const vector< dimension > &y)
 Multiplies two vectors of dimensions. The result is normalized after, which means that equal dimensions at the numerator and at the denominator are cancelled.
 
vector< dimensionmultiply_dimensions (vector< dimension > x, const vector< dimension > &y, long double &value)
 Multiplies two vectors of dimensions. The result is normalized after, which means that equal dimensions at the numerator and at the denominator are cancelled. It also updates the value associated with those two vectors of dimensions with the prefix m ath and the conversion factor of those dimensions.
 
vector< dimensiondivide_dimensions (vector< dimension > x, const vector< dimension > &y, long double &value)
 Divides the first vector of dimensions with the other. The result is normalized after, which means that equal dimensions at the numerator and at the denominator are cancelled. It also updates the value associated with those two vectors of dimensions with the prefix m ath and the conversion factor of those dimensions.
 
vector< dimensionsquare_dimensions (vector< dimension > x, int index, long double &value)
 Squares a vector of dimensions by an index. The value is updated too related to the prefix math and the conversion factor of this operation.
 
vector< dimensionpower_dimensions (const vector< dimension > &x, int exponent)
 Powers the dimensions by an exponent.
 
vector< dimensionnormalize_dimensions (const vector< dimension > &x)
 Normalizes the dimensions, which means that repited dimensions at the numerator and at the denominator are cancelled.
 
vector< dimensionnormalize_dimensions (const vector< dimension > &x, long double &value)
 Normalizes the dimensions, which means that repited dimensions at the numerator and at the denominator are cancelled. The value is updated if there are dimensions cancelled.
 
bool is_dimension_char (const UChar32 &x)
 
bool common_dimension (const dimension &x, const dimension &y)
 Checks if there's an equal basic dimension between the basic dimensions of those two dimensions.
 
bool equal_dimensions (const string &init_dimensions_x, const string &init_dimensions_y)
 Checks if two initialization strings of dimensions initialize the same basic dimensions.
 
bool equal_dimensions (const vector< dimension > &x, const vector< dimension > &y)
 
bool equal_dimensions_and_prefixes (const vector< dimension > &x, const vector< dimension > &y)
 Checks if the base dimensions of two vectors of dimensions are equal, and if they have also the same prefixes.
 
prefix::type prefix_string (const string &x)
 Returns the value of the enum prefix::type associated with the string x given.
 
prefix closest_prefix (const prefix &actual_prefix, int actual_scale)
 Returns the closes prefix related to the scale of the current value. It is used when displaying a scalar_unit to the most close prefix available.
 
prefix create_prefix_by_factor (int factor)
 Creates the prefix of the factor given, which is always between a range.
 
string to_string (const scalar_unit &x)
 Generates a string representation of the scalar_unit, it uses the display of the scalar_unit with 2 decimals, without brackets and without a close prefix.
 
bool is_scalar_unit (const string &init_scalar)
 Checks if an string is an initialization string of a scalar_unit.
 
float abs (const scalar_unit &x)
 Returns the absolute value of the scalar_unit, without dimensions.
 
scalar_unit pow (const scalar_unit &x, int exponent)
 Exponentiates a scalar_unit to some numeric type, the dimensions are also exponentiated.
 
scalar_unit sqrt (const scalar_unit &x)
 Square root of a scalar_unit, it squares the dimensions too.
 
scalar_unit sqrt_nth (const scalar_unit &x, int index)
 Nth root of a scalar_unit to any numeric value, it squares the dimensions too.
 
scalar_unit norm (const vector_unit_2d &x)
 It returns the value of the vector in polar coordinates, p.
 
vector_unit_2d sqrt (const vector_unit_2d &x)
 It squares the vector, creating a vector_unit_2d with the value squared and always the same theta. The dimensions are squared with the same rules for the square of dimensions than scalar_unit classes.
 
vector_unit_2d sqrt_nth (const vector_unit_2d &x, int index)
 It takes the root of the vector with the index given, creating a vector_unit_2d with the value rooted to that index and always maintains the same theta. The dimensions are squared with the same rules for the square of dimensions than scalar_unit classes.
 
scalar_unit dot_product (const vector_unit_2d &x, const vector_unit_2d &y)
 Creates a scalar_unit as the dot product of the two vectors x and y.
 
angle angle_between (const vector_unit_2d &x, const vector_unit_2d &y)
 Returns the angle between two vectors x and y inside a 2D space.
 
bool same_direction (const vector_unit_2d &x, const vector_unit_2d &y)
 Checks if two vectors x and y have the same direction.
 
bool parallel (const vector_unit_2d &x, const vector_unit_2d &y)
 Checks if two vectors x and y are parallel, which means that their direction is the same or the exact opposite.
 
bool orthogonal (const vector_unit_2d &x, const vector_unit_2d &y)
 Checks if two vectors x and y are orthogonal, that's, if they have 90 degrees of difference.
 
string to_string (const vector_unit_2d &x)
 It generates a string representation of vector_unit_2d.
 
scalar_unit norm (const vector_unit_3d &x)
 It returns the value of the vector in spherical coordinates, r.
 
vector_unit_3d sqrt (const vector_unit_3d &x)
 It squares the vector, creating a vector_unit_3d with the value squared and always the same theta and the same phi. The dimensions are squared with the same rules for the square of dimensions than scalar_unit classes.
 
vector_unit_3d sqrt_nth (const vector_unit_3d &x, int index)
 It takes the root of the vector with the index given, creating a vector_unit_3d with the value rooted to that index and always maintains the same theta and the same phi. The dimensions are squared with the same rules for the square of dimensions than scalar_unit classes.
 
scalar_unit dot_product (const vector_unit_3d &x, const vector_unit_3d &y)
 Creates a scalar_unit as the dot product of the two vectors x and y.
 
vector_unit_3d cross_product (const vector_unit_3d &x, const vector_unit_3d &y)
 Creates a vector_unit_3d as the cross product of the two vectors x and y.
 
angle angle_between (const vector_unit_3d &x, const vector_unit_3d &y)
 Returns the angle between two vectors x and y inside a 3D space.
 
bool same_direction (const vector_unit_3d &x, const vector_unit_3d &y)
 Checks if two vectors x and y have the same direction.
 
bool parallel (const vector_unit_3d &x, const vector_unit_3d &y)
 Checks if two vectors x and y are parallel, which means that their direction is the same or the exact opposite.
 
bool orthogonal (const vector_unit_3d &x, const vector_unit_3d &y)
 Checks if two vectors x and y are orthogonal, that's, if they have 90 degrees between them.
 
string to_string (const vector_unit_3d &x)
 It generates a string representation of vector_unit_3d.
 
string to_string (const vector_unit_nd &x)
 It generates a string representation of vector_unit_nd.
 
scalar_unit norm (const vector_unit_nd &x)
 It returns the value of the vector, which is the value in 1D, p in 2D (polar coordinates), or r in 3D (spherical coordinates).
 
vector_unit_nd sqrt (const vector_unit_nd &x)
 It squares the vector, creating a vector_unit_nd with the value squared and always the same angles. The dimensions are squared with the same rules for the square of dimensions than scalar_unit classes.
 
vector_unit_nd sqrt_nth (const vector_unit_nd &x, int index)
 It takes the root of the vector with the index given, creating a vector_unit_nd with the value rooted to that index and always maintains the same angles. The dimensions are squared with the same rules for the square of dimensions than scalar_unit classes.
 
scalar_unit dot_product (const vector_unit_nd &x, const vector_unit_nd &y)
 Creates a scalar_unit as the dot product of the two vectors x and y.
 
vector_unit_nd cross_product (const vector_unit_nd &x, const vector_unit_nd &y)
 Creates a vector_unit_nd as the cross product of the two vectors x and y. If both vectors aren't in 3D, it returns an empty vector_unit_nd, because the cross product doesn't exists outside 3D.
 
angle angle_between (const vector_unit_nd &x, const vector_unit_nd &y)
 Returns the angle between two vectors x and y inside the ND space, which can be 2D or 3D, depending on the ND of the vectors. If the vectors have different ND, it returns an empty vector_unit_nd instead.
 
bool same_nd (const vector_unit_nd &x, const vector_unit_nd &y)
 Checks if two vectors have the same number of dimensions.
 
bool same_direction (const vector_unit_nd &x, const vector_unit_nd &y)
 Checks if two vectors x and y have the same direction. Both vectors must have the same ND, otherwise it returns an empty vector_unit_nd instead.
 
bool parallel (const vector_unit_nd &x, const vector_unit_nd &y)
 Checks if two vectors x and y are parallel, which means that their direction is the same or the exact opposite. Both vectors must have the same ND, otherwise it returns an empty vector_unit_nd instead.
 
bool orthogonal (const vector_unit_nd &x, const vector_unit_nd &y)
 Checks if two vectors x and y are orthogonal, that's, if they have 90 degrees between them. Both vectors must have the same ND, otherwise it returns an empty vector_unit_nd instead.
 
float parse_float (const string &x)
 
int parse_int (const string &x)
 
string display_float (const float &value, int number_of_decimals)
 
string display_double (const double &value, int number_of_decimals)
 
string display_long_double (const long double &value, int number_of_decimals)
 

Variables

angle coordinates_ndr_no_angle = angle()
 
const scalar_unit WGS84_EARTH_SEMIAXIS_A = 6378137_m
 
const scalar_unit WGS84_EARTH_SEMIAXIS_B = 6356752.314245_m
 
const long double HYPERFINE_TRANSITION_FREQUENCY_OF_CS = 9192631770.0l
 
const long double SPEED_OF_LIGHT = 299792458.0l
 
const long double PLANCK_CONSTANT = 6.62607015e-34
 
const long double ELEMENTARY_CHARGE = 1.602176634e-19
 
const long double BOLTZMANN_CONSTANT = 1.380649e-23
 
const long double AVOGADRO_CONSTANT = 6.02214076e23
 
const long double LUMINOUS_EFFICACY_OF_540_THZ_RADIATION = 683.0l
 
const long double GRAVITATIONAL_CONSTANT = 6.6743e-11
 
const long double MOLAR_GAS_CONSTANT = 8.31446261815324l
 
const long double ATOMIC_MASS_CONSTANT = 1.66053906660e-27
 
const long double COULOMB_CONSTANT = 8.9875517873681764e9
 
const long double VACUUM_PERMITTIVITY = 8.8541878188e-12
 
const long double RYDBERG_CONSTANT = 1.0973731568539e7
 
const long double FARADAY_CONSTANT = 9.64853321233100184e4
 

Detailed Description

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

Typedef Documentation

◆ wavelength

Definition at line 97 of file physics_units.hpp.

Enumeration Type Documentation

◆ astronomical_body

Contains predefined astronomical bodies to be set automatically in the aid class. All of them are important astronomical bodies, unimportant astronomical bodies aren't included.

Enumerator
NONE 

No predefined astronomical body selected.

MILKY_WAY 

The Milky Way galaxy.

ANDROMEDA 

The Andromeda galaxy, 2.5 million light years from Earth.

SOLAR_SYSTEM 

The Solar System of the Earth.

SUN 

The Sun, the sun of the solar system of the Earth.

MOON 

The Moon of the Earth.

MERCURY 

The planet Mercury.

VENUS 

The planet Venus.

EARTH 

The planet Earth.

MARS 

The planet Mars.

JUPITER 

The planet Jupiter.

SATURN 

The planet Saturn.

URANUS 

The planet Uranus.

NEPTUNE 

The planet Neptune.

CERES 

The dwarf planet Ceres.

ORCUS 

The possible dwarf planet Orcus.

PLUTO 

The dwarf planet Pluto.

HAUMEA 

The dwarf planet Haumea.

QUAOAR 

The dwarf planet Quaoar.

MAKEMAKE 

The dwarf planet Makemake.

GONGGONG 

The possible dwarf planet Gonggong.

ERIS 

The dwarf planet Eris.

SEDNA 

The minor body Sedna.

IO 

The moon of Jupiter Io.

EUROPA 

The moon of Jupiter Europa.

GANYMEDE 

The moon of Jupiter Ganymede.

CALLISTO 

The moon of Jupiter Callisto.

MIMAS 

The moon of Saturn Mimas.

ENCELADUS 

The moon of Saturn Enceladus.

TETHYS 

The moon of Saturn Tethys.

DIONE 

The moon of Saturn Dione.

RHEA 

The moon of Saturn Rhea.

TITAN 

The moon of Saturn Titan.

IAPETUS 

The moon of Saturn Iapetus.

MIRANDA 

The moon of Uranus Miranda.

ARIEL 

The moon of Uranus Ariel.

UMBRIEL 

The moon of Uranus Umbriel.

TITANIA 

The moon of Uranus Titania.

OBERON 

The moon of Uranus Oberon.

TRITON 

The moon of Neptune Triton.

CHARON 

The moon of Pluto Charon.

DYSNOMIA 

The moon of Eris Dysnomia.

Definition at line 11 of file aid.hpp.

@ IAPETUS
The moon of Saturn Iapetus.
@ DYSNOMIA
The moon of Eris Dysnomia.
@ ENCELADUS
The moon of Saturn Enceladus.
@ MILKY_WAY
The Milky Way galaxy.
@ MIMAS
The moon of Saturn Mimas.
@ CERES
The dwarf planet Ceres.
@ OBERON
The moon of Uranus Oberon.
@ RHEA
The moon of Saturn Rhea.
@ ANDROMEDA
The Andromeda galaxy, 2.5 million light years from Earth.
@ GANYMEDE
The moon of Jupiter Ganymede.
@ EUROPA
The moon of Jupiter Europa.
@ TITANIA
The moon of Uranus Titania.
@ SATURN
The planet Saturn.
@ MARS
The planet Mars.
@ HAUMEA
The dwarf planet Haumea.
@ MIRANDA
The moon of Uranus Miranda.
@ UMBRIEL
The moon of Uranus Umbriel.
@ QUAOAR
The dwarf planet Quaoar.
@ URANUS
The planet Uranus.
@ TITAN
The moon of Saturn Titan.
@ ERIS
The dwarf planet Eris.
@ GONGGONG
The possible dwarf planet Gonggong.
@ SUN
The Sun, the sun of the solar system of the Earth.
@ TRITON
The moon of Neptune Triton.
@ VENUS
The planet Venus.
@ ARIEL
The moon of Uranus Ariel.
@ JUPITER
The planet Jupiter.
@ NEPTUNE
The planet Neptune.
@ SEDNA
The minor body Sedna.
@ CALLISTO
The moon of Jupiter Callisto.
@ MERCURY
The planet Mercury.
@ TETHYS
The moon of Saturn Tethys.
@ NONE
No predefined astronomical body selected.
@ EARTH
The planet Earth.
@ DIONE
The moon of Saturn Dione.
@ CHARON
The moon of Pluto Charon.
@ PLUTO
The dwarf planet Pluto.
@ MAKEMAKE
The dwarf planet Makemake.
@ MOON
The Moon of the Earth.
@ IO
The moon of Jupiter Io.
@ ORCUS
The possible dwarf planet Orcus.
@ SOLAR_SYSTEM
The Solar System of the Earth.

◆ cardinale_point

Enumerator
NORTH 
SOUTH 
EAST 
WEST 

Definition at line 20 of file coordinates_3d.hpp.

Function Documentation

◆ abs() [1/2]

template<typename T >
T scifir::abs ( const complex_number< T > &  x)

Definition at line 186 of file complex_number.hpp.

187 {
188 return T(scifir::sqrt(scifir::pow(x.real,2) + scifir::pow(x.imaginary,2)));
189 }
scalar_unit pow(const scalar_unit &x, int exponent)
Exponentiates a scalar_unit to some numeric type, the dimensions are also exponentiated.
angle sqrt(const angle &x)
Calculates the square root of the angle x and returns that new angle.
Definition angle.cpp:416

◆ abs() [2/2]

float scifir::abs ( const scalar_unit x)

Returns the absolute value of the scalar_unit, without dimensions.

Definition at line 937 of file scalar_unit.cpp.

938 {
939 return std::abs(x.get_value());
940 }
const float & get_value() const
Read-only getter of the value.

◆ acos()

angle scifir::acos ( float  x)

Calculates the acos of some value x and returns the result as angle in degrees.

Definition at line 446 of file angle.cpp.

447 {
448 return angle(radian_to_degree(std::acos(x)));
449 }
Class that allows to work with angles. Each angle sizes 4 bytes. Initialization string example: "20°"...
Definition angle.hpp:77
float radian_to_degree(float x)
Converts a radian to degree.
Definition angle.hpp:16

◆ acos_degree()

float scifir::acos_degree ( float  x)
inline

Calculates the acos receiving x in degrees. It uses the acos() function of the standard library of C++, but the difference is that the argument is in degrees, not in radians.

Definition at line 247 of file angle.hpp.

248 {
249 return radian_to_degree(std::acos(x));
250 }

◆ acosh()

angle scifir::acosh ( float  x)

Calculates the acosh of some value x and returns the result as angle in degrees.

Definition at line 481 of file angle.cpp.

482 {
483 return angle(radian_to_degree(std::acosh(x)));
484 }

◆ acosh_degree()

float scifir::acosh_degree ( float  x)
inline

Calculates the acosh receiving x in degrees. It uses the acosh() function of the standard library of C++, but the difference is that the argument is in degrees, not in radians.

Definition at line 262 of file angle.hpp.

263 {
264 return radian_to_degree(std::acosh(x));
265 }

◆ angle_between() [1/3]

angle scifir::angle_between ( const vector_unit_2d x,
const vector_unit_2d y 
)

Returns the angle between two vectors x and y inside a 2D space.

Definition at line 369 of file vector_unit_2d.cpp.

370 {
371 return scifir::atan2(float(y.y_projection() * x.x_projection() - y.x_projection() * x.y_projection()),float(y.x_projection() * x.x_projection() + y.y_projection() * x.y_projection()));
372 }
scalar_unit y_projection() const
It creates the y projection of the vector, returning it as a scalar_unit of the same dimensions,...
scalar_unit x_projection() const
It creates the x projection of the vector, returning it as a scalar_unit of the same dimensions,...
angle atan2(float y, float x)
Definition angle.cpp:456

◆ angle_between() [2/3]

angle scifir::angle_between ( const vector_unit_3d x,
const vector_unit_3d y 
)

Returns the angle between two vectors x and y inside a 3D space.

Definition at line 496 of file vector_unit_3d.cpp.

497 {
498 return scifir::acos(float(dot_product(x,y)/(norm(x)*norm(y))));
499 }
scalar_unit dot_product(const vector_unit_2d &x, const vector_unit_2d &y)
Creates a scalar_unit as the dot product of the two vectors x and y.
scalar_unit norm(const vector_unit_2d &x)
It returns the value of the vector in polar coordinates, p.
angle acos(float x)
Calculates the acos of some value x and returns the result as angle in degrees.
Definition angle.cpp:446

◆ angle_between() [3/3]

angle scifir::angle_between ( const vector_unit_nd x,
const vector_unit_nd y 
)

Returns the angle between two vectors x and y inside the ND space, which can be 2D or 3D, depending on the ND of the vectors. If the vectors have different ND, it returns an empty vector_unit_nd instead.

Definition at line 843 of file vector_unit_nd.cpp.

844 {
845 return scifir::acos(float(dot_product(x,y)/(norm(x) * norm(y))));
846 }

◆ area()

scifir::area::area ( const size_2d< length > &  x)
explicit

Definition at line 13 of file space_units.cpp.

13 : scalar_unit()
14 {
15 length x_height = x.height;
16 x_height.change_dimensions(x.width);
17 *this = x.width * x_height;
18 }
Class that allows to create scalar units, which are composed of a value (as a float) and dimensions....

◆ asin()

angle scifir::asin ( float  x)

Calculates the asin of some value x and returns the result as angle in degrees.

Definition at line 441 of file angle.cpp.

442 {
443 return angle(radian_to_degree(std::asin(x)));
444 }

◆ asin_degree()

float scifir::asin_degree ( float  x)
inline

Calculates the asin receiving x in degrees. It uses the asin() function of the standard library of C++, but the difference is that the argument is in degrees, not in radians.

Definition at line 242 of file angle.hpp.

243 {
244 return radian_to_degree(std::asin(x));
245 }

◆ asinh()

angle scifir::asinh ( float  x)

Calculates the asinh of some value x and returns the result as angle in degrees.

Definition at line 476 of file angle.cpp.

477 {
478 return angle(radian_to_degree(std::asinh(x)));
479 }

◆ asinh_degree()

float scifir::asinh_degree ( float  x)
inline

Calculates the asinh receiving x in degrees. It uses the asinh() function of the standard library of C++, but the difference is that the argument is in degrees, not in radians.

Definition at line 257 of file angle.hpp.

258 {
259 return radian_to_degree(std::asinh(x));
260 }

◆ atan()

angle scifir::atan ( float  x)

Calculates the atan of some value x and returns the result as angle in degrees.

Definition at line 451 of file angle.cpp.

452 {
453 return angle(radian_to_degree(std::atan(x)));
454 }

◆ atan2()

angle scifir::atan2 ( float  y,
float  x 
)

Definition at line 456 of file angle.cpp.

457 {
458 return angle(radian_to_degree(std::atan2(y,x)));
459 }

◆ atan_degree()

float scifir::atan_degree ( float  x)
inline

Calculates the atan receiving x in degrees. It uses the atan() function of the standard library of C++, but the difference is that the argument is in degrees, not in radians.

Definition at line 252 of file angle.hpp.

253 {
254 return radian_to_degree(std::atan(x));
255 }

◆ atanh()

angle scifir::atanh ( float  x)

Calculates the atanh of some value x and returns the result as angle in degrees.

Definition at line 486 of file angle.cpp.

487 {
488 return angle(radian_to_degree(std::atanh(x)));
489 }

◆ atanh_degree()

float scifir::atanh_degree ( float  x)
inline

Calculates the atanh receiving x in degrees. It uses the atanh() function of the standard library of C++, but the difference is that the argument is in degrees, not in radians.

Definition at line 267 of file angle.hpp.

268 {
269 return radian_to_degree(std::atanh(x));
270 }

◆ cartesian_2d_to_polar_p() [1/2]

scalar_unit scifir::cartesian_2d_to_polar_p ( const scalar_unit x,
scalar_unit  y 
)
inline

Definition at line 354 of file coordinates_2d.hpp.

355 {
357 return scalar_unit(std::sqrt(std::pow(float(x),2) + std::pow(float(y),2)),x.get_dimensions());
358 }
const vector< dimension > & get_dimensions() const
Read-only getter of the dimensions.
void change_dimensions(const string &init_dimensions)
Changes the dimensions to the dimensions specified by the initialization string of dimensions.

◆ cartesian_2d_to_polar_p() [2/2]

float scifir::cartesian_2d_to_polar_p ( float  x,
float  y 
)
inline

Definition at line 376 of file coordinates_2d.hpp.

377 {
378 return float(std::sqrt(std::pow(x,2) + std::pow(y,2)));
379 }

◆ cartesian_2d_to_polar_theta() [1/2]

angle scifir::cartesian_2d_to_polar_theta ( const scalar_unit x,
scalar_unit  y 
)
inline

Definition at line 360 of file coordinates_2d.hpp.

361 {
363 return scifir::angle(scifir::atan_degree(float(y)/float(x)));
364 }
float atan_degree(float x)
Calculates the atan receiving x in degrees. It uses the atan() function of the standard library of C+...
Definition angle.hpp:252

◆ cartesian_2d_to_polar_theta() [2/2]

angle scifir::cartesian_2d_to_polar_theta ( float  x,
float  y 
)
inline

Definition at line 381 of file coordinates_2d.hpp.

382 {
384 }

◆ cartesian_3d_to_cylindrical_p() [1/2]

scalar_unit scifir::cartesian_3d_to_cylindrical_p ( const scalar_unit x,
scalar_unit  y,
const scalar_unit z 
)
inline

Returns the p coordinate of the cylindrical coordinates given the x, y and z of cartesian coordinates in 3D.

Definition at line 726 of file coordinates_3d.hpp.

727 {
729 return scalar_unit(std::sqrt(std::pow(float(x),2) + std::pow(float(y),2)),x.get_dimensions());
730 }

◆ cartesian_3d_to_cylindrical_p() [2/2]

float scifir::cartesian_3d_to_cylindrical_p ( float  x,
float  y,
float  z 
)
inline

Returns the p coordinate of the cylindrical coordinates given the x, y and z of cartesian coordinates in 3D.

Definition at line 825 of file coordinates_3d.hpp.

826 {
827 return float(std::sqrt(std::pow(x,2) + std::pow(y,2)));
828 }

◆ cartesian_3d_to_cylindrical_theta() [1/2]

angle scifir::cartesian_3d_to_cylindrical_theta ( const scalar_unit x,
scalar_unit  y,
const scalar_unit z 
)
inline

Returns the theta coordinate of the cylindrical coordinates given the x, y and z of cartesian coordinates in 3D.

Definition at line 732 of file coordinates_3d.hpp.

733 {
735 return angle(scifir::atan_degree(float(y) / float(x)));
736 }

◆ cartesian_3d_to_cylindrical_theta() [2/2]

angle scifir::cartesian_3d_to_cylindrical_theta ( float  x,
float  y,
float  z 
)
inline

Returns the theta coordinate of the cylindrical coordinates given the x, y and z of cartesian coordinates in 3D.

Definition at line 830 of file coordinates_3d.hpp.

831 {
832 return angle(scifir::atan_degree(y / x));
833 }

◆ cartesian_3d_to_cylindrical_z() [1/2]

scalar_unit scifir::cartesian_3d_to_cylindrical_z ( const scalar_unit x,
const scalar_unit y,
const scalar_unit z 
)
inline

Returns the z coordinate of the cylindrical coordinates given the x, y and z of cartesian coordinates in 3D.

Definition at line 738 of file coordinates_3d.hpp.

739 {
740 return z;
741 }

◆ cartesian_3d_to_cylindrical_z() [2/2]

float scifir::cartesian_3d_to_cylindrical_z ( float  x,
float  y,
float  z 
)
inline

Returns the z coordinate of the cylindrical coordinates given the x, y and z of cartesian coordinates in 3D.

Definition at line 835 of file coordinates_3d.hpp.

836 {
837 return z;
838 }

◆ cartesian_3d_to_spherical_phi() [1/2]

angle scifir::cartesian_3d_to_spherical_phi ( const scalar_unit x,
scalar_unit  y,
scalar_unit  z 
)
inline

Returns the phi coordinate of the spherical coordinates given the x, y and z of cartesian coordinates in 3D.

Definition at line 756 of file coordinates_3d.hpp.

757 {
760 return angle(scifir::acos_degree(float(z) / float(std::sqrt(std::pow(float(x),2) + std::pow(float(y),2) + std::pow(float(z),2)))));
761 }
float acos_degree(float x)
Calculates the acos receiving x in degrees. It uses the acos() function of the standard library of C+...
Definition angle.hpp:247

◆ cartesian_3d_to_spherical_phi() [2/2]

angle scifir::cartesian_3d_to_spherical_phi ( float  x,
float  y,
float  z 
)
inline

Returns the phi coordinate of the spherical coordinates given the x, y and z of cartesian coordinates in 3D.

Definition at line 850 of file coordinates_3d.hpp.

851 {
852 return angle(scifir::acos_degree(z / float(std::sqrt(std::pow(x,2) + std::pow(y,2) + std::pow(z,2)))));
853 }

◆ cartesian_3d_to_spherical_r() [1/2]

scalar_unit scifir::cartesian_3d_to_spherical_r ( const scalar_unit x,
scalar_unit  y,
scalar_unit  z 
)
inline

Returns the r coordinate of the spherical coordinates given the x, y and z of cartesian coordinates in 3D.

Definition at line 743 of file coordinates_3d.hpp.

744 {
747 return scalar_unit(std::sqrt(std::pow(float(x),2) + std::pow(float(y),2) + std::pow(float(z),2)),x.get_dimensions());
748 }

◆ cartesian_3d_to_spherical_r() [2/2]

float scifir::cartesian_3d_to_spherical_r ( float  x,
float  y,
float  z 
)
inline

Returns the r coordinate of the spherical coordinates given the x, y and z of cartesian coordinates in 3D.

Definition at line 840 of file coordinates_3d.hpp.

841 {
842 return float(std::sqrt(std::pow(x,2) + std::pow(y,2) + std::pow(z,2)));
843 }

◆ cartesian_3d_to_spherical_theta() [1/2]

angle scifir::cartesian_3d_to_spherical_theta ( const scalar_unit x,
scalar_unit  y,
const scalar_unit z 
)
inline

Returns the theta coordinate of the spherical coordinates given the x, y and z of cartesian coordinates in 3D.

Definition at line 750 of file coordinates_3d.hpp.

751 {
753 return angle(scifir::atan_degree(float(y) / float(x)));
754 }

◆ cartesian_3d_to_spherical_theta() [2/2]

angle scifir::cartesian_3d_to_spherical_theta ( float  x,
float  y,
float  z 
)
inline

Returns the theta coordinate of the spherical coordinates given the x, y and z of cartesian coordinates in 3D.

Definition at line 845 of file coordinates_3d.hpp.

846 {
847 return angle(scifir::atan_degree(y / x));
848 }

◆ closest_prefix()

prefix scifir::closest_prefix ( const prefix actual_prefix,
int  actual_scale 
)

Returns the closes prefix related to the scale of the current value. It is used when displaying a scalar_unit to the most close prefix available.

Definition at line 323 of file prefix.cpp.

324 {
325 int factor_difference = actual_scale + actual_prefix.get_conversion_factor();
327
328 }
prefix create_prefix_by_factor(int factor)
Creates the prefix of the factor given, which is always between a range.
Definition prefix.cpp:330

◆ common_dimension()

bool scifir::common_dimension ( const dimension x,
const dimension y 
)

Checks if there's an equal basic dimension between the basic dimensions of those two dimensions.

Definition at line 2340 of file dimension.cpp.

2341 {
2342 for (const dimension& x_dimension : x.get_base_dimensions())
2343 {
2344 for (const dimension& y_dimension : y.get_base_dimensions())
2345 {
2346 if (x_dimension.dimension_type == y_dimension.dimension_type and x_dimension.dimension_position == y_dimension.dimension_position)
2347 {
2348 return true;
2349 }
2350 }
2351 }
2352 return false;
2353 }
Class that represents dimensions of the SI system of units. Each dimension sizes 6 bytes,...
Definition dimension.hpp:31

◆ cos()

float scifir::cos ( const angle x)

Calculates the cos of angle x. It uses the cos() function of the standard library of C++, the difference is that angle is in degrees, not in radians.

Definition at line 431 of file angle.cpp.

432 {
433 return std::cos(x.get_radian());
434 }
float get_radian() const
Gets the value of the angle in radians.
Definition angle.hpp:206

◆ cosh()

float scifir::cosh ( const angle x)

Calculates the cosh of angle x. It uses the cosh() function of the standard library of C++, the difference is that angle is in degrees, not in radians.

Definition at line 466 of file angle.cpp.

467 {
468 return std::cosh(x.get_radian());
469 }

◆ create_astronomical_type()

aid::type scifir::create_astronomical_type ( const string astronomical_type_abbreviation)

Creates an instance of an aid::type with the given string, which is the reverse as the to_string() function of aid::type.

Definition at line 613 of file aid.cpp.

614 {
616 {
617 return aid::UNIVERSE;
618 }
619 else if (astronomical_type_abbreviation == "G")
620 {
621 return aid::GALAXY;
622 }
623 else if (astronomical_type_abbreviation == "SS")
624 {
625 return aid::SOLAR_SYSTEM;
626 }
627 else if (astronomical_type_abbreviation == "P")
628 {
629 return aid::PLANET;
630 }
631 else if (astronomical_type_abbreviation == "ST")
632 {
633 return aid::STAR;
634 }
635 else if (astronomical_type_abbreviation == "A")
636 {
637 return aid::ASTEROID;
638 }
639 else if (astronomical_type_abbreviation == "MN")
640 {
641 return aid::MOON;
642 }
643 else if (astronomical_type_abbreviation == "MT")
644 {
645 return aid::METEOR;
646 }
647 else
648 {
649 return aid::NONE;
650 }
651 }

◆ create_base_dimensions() [1/3]

vector< dimension > scifir::create_base_dimensions ( const string init_dimensions)

Creates the base dimensions from an initialization string of dimensions.

Definition at line 2033 of file dimension.cpp.

2034 {
2037 }
vector< dimension > create_base_dimensions(const string &init_dimensions)
Creates the base dimensions from an initialization string of dimensions.
vector< dimension > create_dimensions(string init_dimensions)
Creates the dimensions from an initialization string of dimensions.

◆ create_base_dimensions() [2/3]

vector< dimension > scifir::create_base_dimensions ( const vector< dimension > &  x)

Creates all the base dimensions from a vector of dimensions.

Definition at line 2039 of file dimension.cpp.

2040 {
2042 for(unsigned int i = 0; i < x.size(); i++)
2043 {
2044 vector<dimension> x_subdimensions = x[i].get_base_dimensions();
2046 {
2047 if (x[i].dimension_position == dimension::DENOMINATOR)
2048 {
2049 x_subdimension.invert();
2050 }
2051 new_x.push_back(x_subdimension);
2052 }
2053 }
2054 return new_x;
2055 }

◆ create_base_dimensions() [3/3]

vector< dimension > scifir::create_base_dimensions ( const vector< dimension > &  x,
long double value 
)

Creates all the base dimensions from a vector of dimensions, updating also the associated value related to those dimensions based on the prefix math and the conversion factor of the dimension, if that conversion factor is different than one.

Definition at line 2057 of file dimension.cpp.

2058 {
2060 for(unsigned int i = 0; i < x.size(); i++)
2061 {
2062 if (x[i].dimension_position == dimension::NUMERATOR)
2063 {
2064 value *= x[i].get_conversion_factor();
2065 value *= x[i].prefix_math();
2066 }
2067 else if (x[i].dimension_position == dimension::DENOMINATOR)
2068 {
2069 value /= x[i].get_conversion_factor();
2070 value /= x[i].prefix_math();
2071 }
2072 vector<dimension> x_subdimensions = x[i].get_base_dimensions();
2073 for (dimension& x_subdimension : x_subdimensions)
2074 {
2075 if (x[i].dimension_position == dimension::DENOMINATOR)
2076 {
2077 x_subdimension.invert();
2078 }
2079 new_x.push_back(x_subdimension);
2080 }
2081 }
2082 if (x.size() == 1 and x[0].dimension_type == dimension::CELSIUS and x[0].dimension_position == dimension::NUMERATOR)
2083 {
2084 value += 273.15l;
2085 }
2086 return new_x;
2087 }

◆ create_cardinale_point()

cardinale_point scifir::create_cardinale_point ( const string x)

Definition at line 28 of file coordinates_3d.cpp.

29 {
30 if (x == "NORTH")
31 {
32 return cardinale_point::NORTH;
33 }
34 else if (x == "SOUTH")
35 {
36 return cardinale_point::SOUTH;
37 }
38 else if (x == "EAST")
39 {
40 return cardinale_point::EAST;
41 }
42 else if (x == "WEST")
43 {
44 return cardinale_point::WEST;
45 }
46 return cardinale_point::NORTH;
47 }

◆ create_dimensions()

vector< dimension > scifir::create_dimensions ( string  init_dimensions)

Creates the dimensions from an initialization string of dimensions.

Definition at line 1921 of file dimension.cpp.

1922 {
1923 boost::algorithm::erase_all(init_dimensions, " ");
1924 dimension::position new_sign = dimension::NUMERATOR;
1925 int new_scale = 1;
1926 int new_size = 1;
1927 int new_start = 0;
1928 icu::UnicodeString new_dimension_str;
1929 vector<dimension> dimensions = vector<dimension>();
1930 icu::UnicodeString x_unicode = icu::UnicodeString(init_dimensions.c_str());
1931 int total_chars = x_unicode.countChar32();
1932 for(unsigned int j = 0; j < total_chars; j++)
1933 {
1934 if(x_unicode[j] == UChar32(U'1') and x_unicode[j + 1] == UChar32(U'/'))
1935 {
1936 new_sign = dimension::DENOMINATOR;
1937 }
1938 if(is_dimension_char(x_unicode[j]) and (!is_dimension_char(x_unicode[j + 1]) or (j + 1) == total_chars))
1939 {
1940 new_dimension_str = x_unicode.tempSubString(new_start,new_size);
1941 if(u_isdigit(x_unicode[j + 1]))
1942 {
1943 new_scale = u_charDigitValue(x_unicode[j + 1]);
1944 }
1945 }
1946 if(x_unicode[j] == UChar32(U'*'))
1947 {
1948 new_size = 0;
1949 new_start = j + 1;
1950 }
1951 else if(x_unicode[j] == UChar32(U'/'))
1952 {
1953 new_sign = dimension::DENOMINATOR;
1954 new_size = 0;
1955 new_start = j + 1;
1956 }
1957 if(!new_dimension_str.countChar32() == 0)
1958 {
1959 dimension new_dimension;
1960 string new_dimension_str_stl2 = "";
1961 new_dimension_str.toUTF8String(new_dimension_str_stl2);
1962 if(new_dimension_str.countChar32() == 1)
1963 {
1964 if(new_dimension_str[0] == 0x03A9)
1965 {
1966 new_dimension = dimension(dimension::OHM,prefix::NONE,new_sign);
1967 }
1968 else if(new_dimension_str[0] == 0x00C5)
1969 {
1970 new_dimension = dimension(dimension::ANGSTROM,prefix::NONE,new_sign);
1971 }
1972 else if(new_dimension_str[0] == 0x03B8)
1973 {
1974 new_dimension = dimension(dimension::DEGREE,prefix::NONE,new_sign);
1975 }
1976 else
1977 {
1978 string new_dimension_str_stl = "";
1979 new_dimension_str.toUTF8String(new_dimension_str_stl);
1980 new_dimension = dimension(new_dimension_str_stl,new_sign);
1981 }
1982 }
1983 else
1984 {
1985 if(new_dimension_str[new_dimension_str.countChar32() - 1] == 0x03A9)
1986 {
1987 string new_prefix_str = "";
1988 new_dimension_str.tempSubString(0,new_dimension_str.countChar32() - 1).toUTF8String(new_prefix_str);
1989 prefix new_prefix(new_prefix_str);
1990 new_dimension = dimension(dimension::OHM,new_prefix,new_sign);
1991 }
1992 else if(new_dimension_str[new_dimension_str.countChar32() - 1] == 0x00C5)
1993 {
1994 string new_prefix_str = "";
1995 new_dimension_str.tempSubString(0,new_dimension_str.countChar32() - 1).toUTF8String(new_prefix_str);
1996 prefix new_prefix(new_prefix_str);
1997 new_dimension = dimension(dimension::ANGSTROM,new_prefix,new_sign);
1998 }
1999 else if(new_dimension_str[new_dimension_str.countChar32() - 1] == 0x03B8)
2000 {
2001 string new_prefix_str = "";
2002 new_dimension_str.tempSubString(0,new_dimension_str.countChar32() - 1).toUTF8String(new_prefix_str);
2003 prefix new_prefix(new_prefix_str);
2004 new_dimension = dimension(dimension::DEGREE,new_prefix,new_sign);
2005 }
2006 else if(new_dimension_str[new_dimension_str.countChar32() - 2] == 0x00B0 && new_dimension_str[new_dimension_str.countChar32() - 1] == 0x0043)
2007 {
2008 string new_prefix_str = "";
2009 new_dimension_str.tempSubString(0,new_dimension_str.countChar32() - 2).toUTF8String(new_prefix_str);
2010 prefix new_prefix(new_prefix_str);
2011 new_dimension = dimension(dimension::CELSIUS,new_prefix,new_sign);
2012 }
2013 else
2014 {
2015 string new_dimension_str_stl = "";
2016 new_dimension_str.toUTF8String(new_dimension_str_stl);
2017 new_dimension = dimension(new_dimension_str_stl,new_sign);
2018 }
2019 }
2020 for (int k = 0; k < new_scale; k++)
2021 {
2022 dimensions.push_back(new_dimension);
2023 }
2024 new_dimension_str.remove();
2025 new_scale = 1;
2026 new_size = 0;
2027 }
2028 new_size++;
2029 }
2030 return dimensions;
2031 }
position
Represents the position of the dimension, which can be at the numerator or at the denominator....
Definition dimension.hpp:38

◆ create_direction()

direction::name scifir::create_direction ( const string x)

Definition at line 55 of file direction.cpp.

56 {
57 if (x == "left")
58 {
59 return direction::LEFT;
60 }
61 else if (x == "right")
62 {
63 return direction::RIGHT;
64 }
65 else if (x == "top")
66 {
67 return direction::TOP;
68 }
69 else if (x == "bottom")
70 {
71 return direction::BOTTOM;
72 }
73 else if (x == "front")
74 {
75 return direction::FRONT;
76 }
77 else if (x == "back")
78 {
79 return direction::BACK;
80 }
81 else if (x == "left-top")
82 {
83 return direction::LEFT_TOP;
84 }
85 else if (x == "left-bottom")
86 {
87 return direction::LEFT_BOTTOM;
88 }
89 else if (x == "right-top")
90 {
91 return direction::RIGHT_TOP;
92 }
93 else if (x == "right-bottom")
94 {
95 return direction::RIGHT_BOTTOM;
96 }
97 else if (x == "left-front")
98 {
99 return direction::LEFT_FRONT;
100 }
101 else if (x == "left-back")
102 {
103 return direction::LEFT_BACK;
104 }
105 else if (x == "right-front")
106 {
107 return direction::RIGHT_FRONT;
108 }
109 else if (x == "right-back")
110 {
111 return direction::RIGHT_BACK;
112 }
113 else if (x == "top-front")
114 {
115 return direction::TOP_FRONT;
116 }
117 else if (x == "top-back")
118 {
119 return direction::TOP_BACK;
120 }
121 else if (x == "bottom-front")
122 {
123 return direction::BOTTOM_FRONT;
124 }
125 else if (x == "bottom-back")
126 {
127 return direction::BOTTOM_BACK;
128 }
129 else if (x == "left-top-front")
130 {
131 return direction::LEFT_TOP_FRONT;
132 }
133 else if (x == "left-top-back")
134 {
135 return direction::LEFT_TOP_BACK;
136 }
137 else if (x == "left-bottom-front")
138 {
139 return direction::LEFT_BOTTOM_FRONT;
140 }
141 else if (x == "left-bottom-back")
142 {
143 return direction::LEFT_BOTTOM_BACK;
144 }
145 else if (x == "right-top-front")
146 {
147 return direction::RIGHT_TOP_FRONT;
148 }
149 else if (x == "right-top-back")
150 {
151 return direction::RIGHT_TOP_BACK;
152 }
153 else if (x == "right-bottom-front")
154 {
155 return direction::RIGHT_BOTTOM_FRONT;
156 }
157 else if (x == "right-bottom-back")
158 {
159 return direction::RIGHT_BOTTOM_BACK;
160 }
161 else
162 {
163 return direction::NONE;
164 }
165 }

◆ create_prefix_by_factor()

prefix scifir::create_prefix_by_factor ( int  factor)

Creates the prefix of the factor given, which is always between a range.

Definition at line 330 of file prefix.cpp.

331 {
332 if (factor == 0)
333 {
334 return prefix(prefix::NONE);
335 }
336 else if (factor == 1)
337 {
338 return prefix(prefix::DECA);
339 }
340 else if (factor == 2)
341 {
342 return prefix(prefix::HECTO);
343 }
344 else if (factor == -1)
345 {
346 return prefix(prefix::DECI);
347 }
348 else if (factor == -2)
349 {
350 return prefix(prefix::CENTI);
351 }
352 else if (factor >= 3 and factor < 6)
353 {
354 return prefix(prefix::KILO);
355 }
356 else if (factor >= 6 and factor < 9)
357 {
358 return prefix(prefix::MEGA);
359 }
360 else if (factor >= 9 and factor < 12)
361 {
362 return prefix(prefix::GIGA);
363 }
364 else if (factor >= 12 and factor < 15)
365 {
366 return prefix(prefix::TERA);
367 }
368 else if (factor >= 15 and factor < 18)
369 {
370 return prefix(prefix::PETA);
371 }
372 else if (factor >= 18 and factor < 21)
373 {
374 return prefix(prefix::EXA);
375 }
376 else if (factor >= 21 and factor < 24)
377 {
378 return prefix(prefix::ZETTA);
379 }
380 else if (factor >= 24 and factor < 27)
381 {
382 return prefix(prefix::YOTTA);
383 }
384 else if (factor >= 27 and factor < 30)
385 {
386 return prefix(prefix::RONNA);
387 }
388 else if (factor >= 30)
389 {
390 return prefix(prefix::QUETTA);
391 }
392 else if (factor <= -3 and factor > -6)
393 {
394 return prefix(prefix::MILLI);
395 }
396 else if (factor <= -6 and factor > -9)
397 {
398 return prefix(prefix::MICRO);
399 }
400 else if (factor <= -9 and factor > -12)
401 {
402 return prefix(prefix::NANO);
403 }
404 else if (factor <= -12 and factor > -15)
405 {
406 return prefix(prefix::PICO);
407 }
408 else if (factor <= -15 and factor > -18)
409 {
410 return prefix(prefix::FEMTO);
411 }
412 else if (factor <= -18 and factor > -21)
413 {
414 return prefix(prefix::ATTO);
415 }
416 else if (factor <= -21 and factor > -24)
417 {
418 return prefix(prefix::ZEPTO);
419 }
420 else if (factor <= -24 and factor > -27)
421 {
422 return prefix(prefix::YOCTO);
423 }
424 else if (factor <= -27 and factor > -30)
425 {
426 return prefix(prefix::RONTO);
427 }
428 else if (factor <= -30)
429 {
430 return prefix(prefix::QUECTO);
431 }
432 return prefix();
433 }
Class that represents prefixes of the SI system of units. Each prefix sizes 1 byte....
Definition prefix.hpp:14

◆ create_zone_type()

zid::type scifir::create_zone_type ( const string zone_type_abbreviation)

Creates an instance of a zid::type with the given string, which is the reverse as the to_string() function of zid::type.

Definition at line 311 of file zid.cpp.

312 {
313 if (zone_type_abbreviation == "C")
314 {
315 return zid::COUNTRY;
316 }
317 else if (zone_type_abbreviation == "R")
318 {
319 return zid::REGION;
320 }
321 else if (zone_type_abbreviation == "S")
322 {
323 return zid::SETTLEMENT;
324 }
325 else if (zone_type_abbreviation == "Z")
326 {
327 return zid::ZONE;
328 }
329 else
330 {
331 return zid::NONE;
332 }
333 }

◆ cross_product() [1/2]

vector_unit_3d scifir::cross_product ( const vector_unit_3d x,
const vector_unit_3d y 
)

Creates a vector_unit_3d as the cross product of the two vectors x and y.

Definition at line 474 of file vector_unit_3d.cpp.

475 {
476 long double new_value;
479 if(y.theta == x.theta and y.phi == x.phi)
480 {
481 new_value = 0.0l;
482 }
483 else
484 {
485 float new_x = float(x.y_projection() * y.z_projection() - x.z_projection() * y.y_projection());
486 float new_y = float(x.z_projection() * y.x_projection() - x.x_projection() * y.z_projection());
487 float new_z = float(x.x_projection() * y.y_projection() - x.y_projection() * y.x_projection());
488 new_value = cartesian_3d_to_spherical_r(new_x, new_y, new_z);
489 new_theta = cartesian_3d_to_spherical_theta(new_x, new_y, new_z);
490 new_phi = cartesian_3d_to_spherical_phi(new_x, new_y, new_z);
491 }
492 vector<dimension> new_dimensions = multiply_dimensions(x.get_dimensions(), y.get_dimensions(),new_value);
493 return vector_unit_3d(float(new_value), new_dimensions, new_theta, new_phi);
494 }
scalar_unit y_projection() const
It creates the y projection of the vector, returning it as a scalar_unit of the same dimensions,...
scalar_unit z_projection() const
It creates the z projection of the vector, returning it as a scalar_unit of the same dimensions,...
scalar_unit x_projection() const
It creates the x projection of the vector, returning it as a scalar_unit of the same dimensions,...
angle theta
Angle theta of the vector in 3D space, in spherical coordinates. As all angles of scifir-units,...
angle phi
Angle phi of the vector in 3D space, in spherical coordinates. As all angles of scifir-units,...
vector< dimension > multiply_dimensions(const vector< dimension > &x, const vector< dimension > &y)
Multiplies two vectors of dimensions. The result is normalized after, which means that equal dimensio...

◆ cross_product() [2/2]

vector_unit_nd scifir::cross_product ( const vector_unit_nd x,
const vector_unit_nd y 
)

Creates a vector_unit_nd as the cross product of the two vectors x and y. If both vectors aren't in 3D, it returns an empty vector_unit_nd, because the cross product doesn't exists outside 3D.

Definition at line 810 of file vector_unit_nd.cpp.

811 {
812 if(x.is_nd(3) and y.is_nd(3))
813 {
814 long double new_value;
817 if(y.angles[0] == x.angles[0] and y.angles[1] == x.angles[1])
818 {
819 new_value = 0.0l;
820 }
821 else
822 {
823 float new_x = float(x.y_projection() * y.z_projection() - x.z_projection() * y.y_projection());
824 float new_y = float(x.z_projection() * y.x_projection() - x.x_projection() * y.z_projection());
825 float new_z = float(x.x_projection() * y.y_projection() - x.y_projection() * y.x_projection());
826 new_value = cartesian_3d_to_spherical_r(new_x, new_y, new_z);
827 new_theta = cartesian_3d_to_spherical_theta(new_x, new_y, new_z);
828 new_phi = cartesian_3d_to_spherical_phi(new_x, new_y, new_z);
829 }
830 vector<dimension> new_dimensions = multiply_dimensions(x.get_dimensions(), y.get_dimensions(),new_value);
831 scalar_unit new_unit = scalar_unit(float(new_value), new_dimensions);
832 vector<angle> angles;
833 angles.push_back(new_theta);
834 angles.push_back(new_phi);
835 return vector_unit_nd(new_unit, angles);
836 }
837 else
838 {
839 return vector_unit_nd();
840 }
841 }
bool is_nd(unsigned int i) const
Returns true if the vector is at the same number of dimensions as i.
vector< angle > angles
The angles. A total of one angle means the vector is in 2D in polar coordinates, two angles means it'...
scalar_unit x_projection() const
It creates the x projection of the vector, returning it as a scalar_unit of the same dimensions,...
scalar_unit y_projection() const
It creates the y projection of the vector, returning it as a scalar_unit of the same dimensions,...
scalar_unit z_projection() const
It creates the z projection of the vector, returning it as a scalar_unit of the same dimensions,...

◆ cylindrical_to_cartesian_3d_x() [1/2]

scalar_unit scifir::cylindrical_to_cartesian_3d_x ( const scalar_unit p,
const angle theta,
const scalar_unit z 
)
inline

Returns the x coordinate of the cartesian coordinates in 3D given the p, theta and z of cylindrical coordinates.

Definition at line 793 of file coordinates_3d.hpp.

794 {
795 return p * scifir::cos(theta);
796 }
float cos(const angle &x)
Calculates the cos of angle x. It uses the cos() function of the standard library of C++,...
Definition angle.cpp:431

◆ cylindrical_to_cartesian_3d_x() [2/2]

float scifir::cylindrical_to_cartesian_3d_x ( float  p,
const angle theta,
float  z 
)
inline

Returns the x coordinate of the cartesian coordinates in 3D given the p, theta and z of cylindrical coordinates.

Definition at line 885 of file coordinates_3d.hpp.

886 {
887 return p * scifir::cos(theta);
888 }

◆ cylindrical_to_cartesian_3d_y() [1/2]

scalar_unit scifir::cylindrical_to_cartesian_3d_y ( const scalar_unit p,
const angle theta,
const scalar_unit z 
)
inline

Returns the y coordinate of the cartesian coordinates in 3D given the p, theta and z of cylindrical coordinates.

Definition at line 798 of file coordinates_3d.hpp.

799 {
800 return p * scifir::sin(theta);
801 }
float sin(const angle &x)
Calculates the sin of angle x. It uses the sin() function of the standard library of C++,...
Definition angle.cpp:426

◆ cylindrical_to_cartesian_3d_y() [2/2]

float scifir::cylindrical_to_cartesian_3d_y ( float  p,
const angle theta,
float  z 
)
inline

Returns the y coordinate of the cartesian coordinates in 3D given the p, theta and z of cylindrical coordinates.

Definition at line 890 of file coordinates_3d.hpp.

891 {
892 return p * scifir::sin(theta);
893 }

◆ cylindrical_to_cartesian_3d_z() [1/2]

scalar_unit scifir::cylindrical_to_cartesian_3d_z ( const scalar_unit p,
const angle theta,
const scalar_unit z 
)
inline

Returns the z coordinate of the cartesian coordinates in 3D given the p, theta and z of cylindrical coordinates.

Definition at line 803 of file coordinates_3d.hpp.

804 {
805 return z;
806 }

◆ cylindrical_to_cartesian_3d_z() [2/2]

float scifir::cylindrical_to_cartesian_3d_z ( float  p,
const angle theta,
float  z 
)
inline

Returns the z coordinate of the cartesian coordinates in 3D given the p, theta and z of cylindrical coordinates.

Definition at line 895 of file coordinates_3d.hpp.

896 {
897 return z;
898 }

◆ cylindrical_to_spherical_phi() [1/2]

angle scifir::cylindrical_to_spherical_phi ( const scalar_unit p,
const angle theta,
scalar_unit  z 
)
inline

Returns the phi coordinate of the spherical coordinates given the p, theta and z of cylindrical coordinates.

Definition at line 819 of file coordinates_3d.hpp.

820 {
822 return angle(scifir::atan_degree(float(p) / float(z)));
823 }

◆ cylindrical_to_spherical_phi() [2/2]

angle scifir::cylindrical_to_spherical_phi ( float  p,
const angle theta,
float  z 
)
inline

Returns the phi coordinate of the spherical coordinates given the p, theta and z of cylindrical coordinates.

Definition at line 910 of file coordinates_3d.hpp.

911 {
912 return angle(scifir::atan_degree(p / z));
913 }

◆ cylindrical_to_spherical_r() [1/2]

scalar_unit scifir::cylindrical_to_spherical_r ( const scalar_unit p,
const angle theta,
scalar_unit  z 
)
inline

Returns the r coordinate of the spherical coordinates given the p, theta and z of cylindrical coordinates.

Definition at line 808 of file coordinates_3d.hpp.

809 {
811 return scalar_unit(std::sqrt(std::pow(float(p),2) + std::pow(float(z),2)),p.get_dimensions());
812 }

◆ cylindrical_to_spherical_r() [2/2]

float scifir::cylindrical_to_spherical_r ( float  p,
const angle theta,
float  z 
)
inline

Returns the r coordinate of the spherical coordinates given the p, theta and z of cylindrical coordinates.

Definition at line 900 of file coordinates_3d.hpp.

901 {
902 return float(std::sqrt(std::pow(p,2) + std::pow(z,2)));
903 }

◆ cylindrical_to_spherical_theta() [1/2]

angle scifir::cylindrical_to_spherical_theta ( const scalar_unit p,
const angle theta,
const scalar_unit z 
)
inline

Returns the theta coordinate of the spherical coordinates given the p, theta and z of cylindrical coordinates.

Definition at line 814 of file coordinates_3d.hpp.

815 {
816 return theta;
817 }

◆ cylindrical_to_spherical_theta() [2/2]

angle scifir::cylindrical_to_spherical_theta ( float  p,
const angle theta,
float  z 
)
inline

Returns the theta coordinate of the spherical coordinates given the p, theta and z of cylindrical coordinates.

Definition at line 905 of file coordinates_3d.hpp.

906 {
907 return theta;
908 }

◆ degree_to_gradian()

float scifir::degree_to_gradian ( float  x)
inline

Definition at line 46 of file angle.hpp.

47 {
48 return x / 0.9f;
49 }

◆ degree_to_radian()

float scifir::degree_to_radian ( float  x)
inline

Converts a degree to a radian.

Definition at line 31 of file angle.hpp.

32 {
33 return x * std::numbers::pi_v<float> / 180.0f;
34 }

◆ degree_to_turn()

float scifir::degree_to_turn ( float  x)
inline

Definition at line 61 of file angle.hpp.

62 {
63 return x / 360.0f;
64 }

◆ display_double()

string scifir::display_double ( const double value,
int  number_of_decimals 
)

Definition at line 57 of file types.cpp.

58 {
60 if (number_of_decimals > 0)
61 {
62 output << (value*std::pow(10,number_of_decimals) / std::pow(10,number_of_decimals));
63 }
64 else
65 {
66 output << value;
67 }
68 if (output.str() == "-0")
69 {
70 return "0";
71 }
72 else
73 {
74 return output.str();
75 }
76 }

◆ display_float()

string scifir::display_float ( const float value,
int  number_of_decimals 
)

Definition at line 36 of file types.cpp.

37 {
39 if (number_of_decimals > 0)
40 {
41 output << (std::trunc(value*std::pow(10,number_of_decimals)) / std::pow(10,number_of_decimals));
42 }
43 else
44 {
45 output << value;
46 }
47 if (output.str() == "-0")
48 {
49 return "0";
50 }
51 else
52 {
53 return output.str();
54 }
55 }

◆ display_long_double()

string scifir::display_long_double ( const long double value,
int  number_of_decimals 
)

Definition at line 78 of file types.cpp.

79 {
81 if (number_of_decimals > 0)
82 {
83 output << (std::trunc(value*std::pow(10.0l,number_of_decimals)) / std::pow(10.0l,number_of_decimals));
84 }
85 else
86 {
87 output << value;
88 }
89 if (output.str() == "-0")
90 {
91 return "0";
92 }
93 else
94 {
95 return output.str();
96 }
97 }

◆ distance() [1/26]

float scifir::distance ( const coordinates_1d< float > &  x,
const coordinates_1d< float > &  y 
)

Definition at line 13 of file coordinates_1d.cpp.

14 {
15 return float(std::sqrt(std::pow(x.x - y.x,2)));
16 }

◆ distance() [2/26]

template<typename T , typename U >
T scifir::distance ( const coordinates_1d< T > &  x,
const coordinates_1d< U > &  y 
)

Definition at line 191 of file coordinates_1d.hpp.

192 {
193 return T(scifir::sqrt(scifir::pow(x.x - y.x,2)));
194 }

◆ distance() [3/26]

float scifir::distance ( const coordinates_2d< float > &  x,
const coordinates_2d< float > &  y 
)

Definition at line 14 of file coordinates_2d.cpp.

15 {
16 return float(std::sqrt(std::pow(x.x - y.x,2) + std::pow(x.y - y.y,2)));
17 }

◆ distance() [4/26]

float scifir::distance ( const coordinates_2d< float > &  x,
const coordinates_2dr< float > &  y 
)

Definition at line 22 of file coordinates_2dr.cpp.

23 {
24 return float(std::sqrt(std::pow(x.x - y.x,2) + std::pow(x.y - y.y,2)));
25 }

◆ distance() [5/26]

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

Definition at line 347 of file coordinates_2d.hpp.

348 {
349 return T(scifir::sqrt(scifir::pow(x.x - y.x,2) + scifir::pow(x.y - y.y,2)));
350 }

◆ distance() [6/26]

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

Definition at line 480 of file coordinates_2dr.hpp.

481 {
482 return T(scifir::sqrt(scifir::pow(x.x - y.x,2) + scifir::pow(x.y - y.y,2)));
483 }

◆ distance() [7/26]

float scifir::distance ( const coordinates_2dr< float > &  x,
const coordinates_2d< float > &  y 
)

Definition at line 17 of file coordinates_2dr.cpp.

18 {
19 return float(std::sqrt(std::pow(x.x - y.x,2) + std::pow(x.y - y.y,2)));
20 }

◆ distance() [8/26]

float scifir::distance ( const coordinates_2dr< float > &  x,
const coordinates_2dr< float > &  y 
)

Definition at line 12 of file coordinates_2dr.cpp.

13 {
14 return float(std::sqrt(std::pow(x.x - y.x,2) + std::pow(x.y - y.y,2)));
15 }

◆ distance() [9/26]

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

Definition at line 472 of file coordinates_2dr.hpp.

473 {
474 return T(scifir::sqrt(scifir::pow(x.x - y.x,2) + scifir::pow(x.y - y.y,2)));
475 }

◆ distance() [10/26]

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

Definition at line 464 of file coordinates_2dr.hpp.

465 {
466 return T(scifir::sqrt(scifir::pow(x.x - y.x,2) + scifir::pow(x.y - y.y,2)));
467 }

◆ distance() [11/26]

float scifir::distance ( const coordinates_3d< float > &  x,
const coordinates_3d< float > &  y 
)

Calculates the distance between two coordinates_3d<float>.

Definition at line 49 of file coordinates_3d.cpp.

50 {
51 return float(std::sqrt(std::pow(x.x - y.x,2) + std::pow(x.y - y.y,2) + std::pow(x.z - y.z,2)));
52 }
float y
The position in the edge y, with type float.
float x
The position in the edge x, with type float.
float z
The position in the edge z, with type float.

◆ distance() [12/26]

float scifir::distance ( const coordinates_3d< float > &  x,
const coordinates_3dr< float > &  y 
)

Definition at line 22 of file coordinates_3dr.cpp.

23 {
24 return float(std::sqrt(std::pow(x.x - y.x,2) + std::pow(x.y - y.y,2) + std::pow(x.z - y.z,2)));
25 }

◆ distance() [13/26]

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.

Definition at line 719 of file coordinates_3d.hpp.

720 {
721 return T(scifir::sqrt(scifir::pow(x.x - y.x,2) + scifir::pow(x.y - y.y,2) + scifir::pow(x.z - y.z,2)));
722 }

◆ distance() [14/26]

template<typename T , typename U >
T scifir::distance ( const coordinates_3d< T > &  x,
const coordinates_3dr< U > &  y 
)

Definition at line 924 of file coordinates_3dr.hpp.

925 {
926 return T(scifir::sqrt(scifir::pow(x.x - y.x,2) + scifir::pow(x.y - y.y,2) + scifir::pow(x.z - y.z,2)));
927 }

◆ distance() [15/26]

float scifir::distance ( const coordinates_3dr< float > &  x,
const coordinates_3d< float > &  y 
)

Definition at line 17 of file coordinates_3dr.cpp.

18 {
19 return float(std::sqrt(std::pow(x.x - y.x,2) + std::pow(x.y - y.y,2) + std::pow(x.z - y.z,2)));
20 }

◆ distance() [16/26]

float scifir::distance ( const coordinates_3dr< float > &  x,
const coordinates_3dr< float > &  y 
)

Definition at line 12 of file coordinates_3dr.cpp.

13 {
14 return float(std::sqrt(std::pow(x.x - y.x,2) + std::pow(x.y - y.y,2) + std::pow(x.z - y.z,2)));
15 }

◆ distance() [17/26]

template<typename T , typename U >
T scifir::distance ( const coordinates_3dr< T > &  x,
const coordinates_3d< U > &  y 
)

Definition at line 916 of file coordinates_3dr.hpp.

917 {
918 return T(scifir::sqrt(scifir::pow(x.x - y.x,2) + scifir::pow(x.y - y.y,2) + scifir::pow(x.z - y.z,2)));
919 }

◆ distance() [18/26]

template<typename T , typename U >
T scifir::distance ( const coordinates_3dr< T > &  x,
const coordinates_3dr< U > &  y 
)

Definition at line 908 of file coordinates_3dr.hpp.

909 {
910 return T(scifir::sqrt(scifir::pow(x.x - y.x,2) + scifir::pow(x.y - y.y,2) + scifir::pow(x.z - y.z,2)));
911 }

◆ distance() [19/26]

float scifir::distance ( const coordinates_nd< float > &  x,
const coordinates_nd< float > &  y 
)

Definition at line 30 of file coordinates_nd.cpp.

31 {
32 if (x.get_nd() == y.get_nd())
33 {
34 float x_length = 0;
35 for (unsigned int i = 0; i < x.values.size(); i++)
36 {
37 x_length += float(std::pow(x.values[i] - y.values[i],2));
38 }
39 return std::sqrt(x_length);
40 }
41 else
42 {
43 return 0.0f;
44 }
45 }

◆ distance() [20/26]

float scifir::distance ( const coordinates_nd< float > &  x,
const coordinates_ndr< float > &  y 
)

Definition at line 82 of file coordinates_ndr.cpp.

83 {
84 if (x.get_nd() == y.get_nd())
85 {
86 float x_length = 0;
87 for (unsigned int i = 0; i < x.values.size(); i++)
88 {
89 x_length += float(std::pow(x.values[i] - y.get_value(i),2));
90 }
91 return std::sqrt(x_length);
92 }
93 else
94 {
95 return 0.0f;
96 }
97 }
const float & get_value(unsigned int i) const

◆ distance() [21/26]

template<typename T , typename U >
T scifir::distance ( const coordinates_nd< T > &  x,
const coordinates_nd< U > &  y 
)

Definition at line 1160 of file coordinates_nd.hpp.

1161 {
1162 if (x.get_nd() == y.get_nd())
1163 {
1164 scalar_unit x_length = scalar_unit(0.0f,"m2");
1165 for (int i = 0; i < x.values.size(); i++)
1166 {
1167 x_length += scifir::pow(x.values[i] - y.values[i],2);
1168 }
1169 return T(scifir::sqrt(x_length));
1170 }
1171 else
1172 {
1173 return T();
1174 }
1175 }

◆ distance() [22/26]

template<typename T , typename U >
T scifir::distance ( const coordinates_nd< T > &  x,
const coordinates_ndr< U > &  y 
)

Definition at line 2231 of file coordinates_ndr.hpp.

2232 {
2233 if (x.get_nd() == y.get_nd())
2234 {
2235 scalar_unit x_length = scalar_unit(0.0f,"m2");
2236 for (int i = 0; i < x.values.size(); i++)
2237 {
2238 x_length += scifir::pow(x.values[i] - y.get_value(i),2);
2239 }
2240 return T(scifir::sqrt(x_length));
2241 }
2242 else
2243 {
2244 return T();
2245 }
2246 }

◆ distance() [23/26]

float scifir::distance ( const coordinates_ndr< float > &  x,
const coordinates_nd< float > &  y 
)

Definition at line 65 of file coordinates_ndr.cpp.

66 {
67 if (x.get_nd() == y.get_nd())
68 {
69 float x_length = 0;
70 for (unsigned int i = 0; i < x.get_values().size(); i++)
71 {
72 x_length += float(std::pow(x.get_value(i) - y.values[i],2));
73 }
74 return std::sqrt(x_length);
75 }
76 else
77 {
78 return 0.0f;
79 }
80 }
const vector< float > & get_values() const

◆ distance() [24/26]

float scifir::distance ( const coordinates_ndr< float > &  x,
const coordinates_ndr< float > &  y 
)

Definition at line 48 of file coordinates_ndr.cpp.

49 {
50 if (x.get_nd() == y.get_nd())
51 {
52 float x_length = 0;
53 for (unsigned int i = 0; i < x.get_values().size(); i++)
54 {
55 x_length += float(std::pow(x.get_value(i) - y.get_value(i),2));
56 }
57 return std::sqrt(x_length);
58 }
59 else
60 {
61 return 0.0f;
62 }
63 }

◆ distance() [25/26]

template<typename T , typename U >
T scifir::distance ( const coordinates_ndr< T > &  x,
const coordinates_nd< U > &  y 
)

Definition at line 2211 of file coordinates_ndr.hpp.

2212 {
2213 if (x.get_nd() == y.get_nd())
2214 {
2215 scalar_unit x_length = scalar_unit(0.0f,"m2");
2216 for (int i = 0; i < x.get_values().size(); i++)
2217 {
2218 x_length += scifir::pow(x.get_value(i) - y.values[i],2);
2219 }
2220 return T(scifir::sqrt(x_length));
2221 }
2222 else
2223 {
2224 return T();
2225 }
2226 }

◆ distance() [26/26]

template<typename T , typename U >
T scifir::distance ( const coordinates_ndr< T > &  x,
const coordinates_ndr< U > &  y 
)

Definition at line 2191 of file coordinates_ndr.hpp.

2192 {
2193 if (x.get_nd() == y.get_nd())
2194 {
2195 scalar_unit x_length = scalar_unit(0.0f,"m2");
2196 for (int i = 0; i < x.get_values().size(); i++)
2197 {
2198 x_length += scifir::pow(x.get_value(i) - y.get_value(i),2);
2199 }
2200 return T(scifir::sqrt(x_length));
2201 }
2202 else
2203 {
2204 return T();
2205 }
2206 }

◆ divide_dimensions()

vector< dimension > scifir::divide_dimensions ( vector< dimension x,
const vector< dimension > &  y,
long double value 
)

Divides the first vector of dimensions with the other. The result is normalized after, which means that equal dimensions at the numerator and at the denominator are cancelled. It also updates the value associated with those two vectors of dimensions with the prefix m ath and the conversion factor of those dimensions.

Definition at line 2108 of file dimension.cpp.

2109 {
2110 for(dimension y_dimension : y)
2111 {
2112 y_dimension.invert();
2113 x.push_back(y_dimension);
2114 }
2115 return normalize_dimensions(x,value);
2116 }

◆ dot_product() [1/3]

scalar_unit scifir::dot_product ( const vector_unit_2d x,
const vector_unit_2d y 
)

Creates a scalar_unit as the dot product of the two vectors x and y.

Definition at line 362 of file vector_unit_2d.cpp.

◆ dot_product() [2/3]

scalar_unit scifir::dot_product ( const vector_unit_3d x,
const vector_unit_3d y 
)

Creates a scalar_unit as the dot product of the two vectors x and y.

Definition at line 467 of file vector_unit_3d.cpp.

◆ dot_product() [3/3]

scalar_unit scifir::dot_product ( const vector_unit_nd x,
const vector_unit_nd y 
)

Creates a scalar_unit as the dot product of the two vectors x and y.

Definition at line 803 of file vector_unit_nd.cpp.

◆ ECEF_to_LLA_altitude() [1/2]

scalar_unit scifir::ECEF_to_LLA_altitude ( const scalar_unit x,
scalar_unit  y,
const scalar_unit z 
)
inline

Definition at line 45 of file coordinates_3d.hpp.

46 {
47 scalar_unit e_square = (scifir::pow(WGS84_EARTH_SEMIAXIS_A,2) - scifir::pow(WGS84_EARTH_SEMIAXIS_B,2))/scifir::pow(WGS84_EARTH_SEMIAXIS_A,2);
48 scalar_unit e_prim_square = (scifir::pow(WGS84_EARTH_SEMIAXIS_A,2) - scifir::pow(WGS84_EARTH_SEMIAXIS_B,2))/scifir::pow(WGS84_EARTH_SEMIAXIS_B,2);
50 scalar_unit F = 54.0f * scifir::pow(WGS84_EARTH_SEMIAXIS_B,2) * scifir::pow(z,2);
51 long double G = std::pow(p.get_value(),2) + (1.0f - e_square.get_value()) * std::pow(z.get_value(),2) - e_square.get_value() * (std::pow(WGS84_EARTH_SEMIAXIS_A.get_value(),2) - std::pow(WGS84_EARTH_SEMIAXIS_B.get_value(),2));
52 long double c = (scifir::pow(e_square,2) * F * scifir::pow(p,2)).get_value() / std::pow(G,3);
53 long double s = std::cbrt(1.0f + c + std::sqrt(std::pow(c,2) + 2.0f * c));
54 long double k = s + 1.0f + (1.0f/s);
55 scalar_unit P = F/(3.0f * std::pow(k,2) * scalar_unit(std::pow(G,2),{ dimension(dimension::METRE,prefix::NONE,dimension::NUMERATOR),dimension(dimension::METRE,prefix::NONE,dimension::NUMERATOR),dimension(dimension::METRE,prefix::NONE,dimension::NUMERATOR),dimension(dimension::METRE,prefix::NONE,dimension::NUMERATOR) }));
56 scalar_unit Q = scifir::sqrt(1.0f + 2.0f * scifir::pow(e_square,2) * P);
57 scalar_unit r0 = -1.0f * ((P * e_square * p)/(1.0f + Q)) + scifir::sqrt((1.0f/2.0f) * scifir::pow(WGS84_EARTH_SEMIAXIS_A,2) * (1.0f + (1.0f / Q)) - (P * (1.0f - e_square) * scifir::pow(z,2))/(Q * (1.0f + Q)) - (1.0f/2.0f) * P * scifir::pow(p,2));
58 scalar_unit U = scifir::sqrt(scifir::pow(p - e_square * r0,2) + scifir::pow(z,2));
59 scalar_unit V = scifir::sqrt(scifir::pow(p - e_square * r0,2) + (1.0f - e_square) * scifir::pow(z,2));
60 return scalar_unit(U.get_value() * (1.0f - std::pow(WGS84_EARTH_SEMIAXIS_B.get_value(),2) / (WGS84_EARTH_SEMIAXIS_A.get_value() * V.get_value())),{ dimension(dimension::METRE,prefix::NONE,dimension::NUMERATOR) });
61 }
const scalar_unit WGS84_EARTH_SEMIAXIS_B
Definition constants.cpp:10
const scalar_unit WGS84_EARTH_SEMIAXIS_A
Definition constants.cpp:9

◆ ECEF_to_LLA_altitude() [2/2]

float scifir::ECEF_to_LLA_altitude ( float  x,
float  y,
float  z 
)
inline

Definition at line 110 of file coordinates_3d.hpp.

111 {
112 long double e_square = (std::pow(WGS84_EARTH_SEMIAXIS_A.get_value(),2) - std::pow(WGS84_EARTH_SEMIAXIS_B.get_value(),2))/std::pow(WGS84_EARTH_SEMIAXIS_A.get_value(),2);
113 long double e_prim_square = (std::pow(WGS84_EARTH_SEMIAXIS_A.get_value(),2) - std::pow(WGS84_EARTH_SEMIAXIS_B.get_value(),2))/std::pow(WGS84_EARTH_SEMIAXIS_B.get_value(),2);
114 long double p = std::sqrt(std::pow(x,2) + std::pow(y,2));
115 long double F = 54.0f * std::pow(WGS84_EARTH_SEMIAXIS_B.get_value(),2) * std::pow(z,2);
116 long double G = std::pow(p,2) + (1.0f - e_square) * std::pow(z,2) - e_square * (std::pow(WGS84_EARTH_SEMIAXIS_A.get_value(),2) - std::pow(WGS84_EARTH_SEMIAXIS_B.get_value(),2));
117 long double c = std::pow(e_square,2) * F * std::pow(p,2) / std::pow(G,3);
118 long double s = std::cbrt(1.0f + c + std::sqrt(std::pow(c,2) + 2.0f * c));
119 long double k = s + 1.0f + (1.0f/s);
120 long double P = F/(3.0f * std::pow(k,2) * std::pow(G,2));
121 long double Q = std::sqrt(1.0f + 2.0f * std::pow(e_square,2) * P);
122 long double r0 = -1.0f * ((P * e_square * p)/(1.0f + Q)) + std::sqrt((1.0f/2.0f) * std::pow(WGS84_EARTH_SEMIAXIS_A.get_value(),2) * (1.0f + (1.0f / Q)) - (P * (1.0f - e_square) * std::pow(z,2))/(Q * (1.0f + Q)) - (1.0f/2.0f) * P * std::pow(p,2));
123 long double U = std::sqrt(std::pow(p - e_square * r0,2) + std::pow(z,2));
124 long double V = std::sqrt(std::pow(p - e_square * r0,2) + (1.0f - e_square) * std::pow(z,2));
125 return U * (1.0f - std::pow(WGS84_EARTH_SEMIAXIS_B.get_value(),2) / (WGS84_EARTH_SEMIAXIS_A.get_value() * V));
126 }

◆ ECEF_to_LLA_latitude() [1/2]

latitude scifir::ECEF_to_LLA_latitude ( const scalar_unit x,
scalar_unit  y,
const scalar_unit z 
)
inline

Definition at line 22 of file coordinates_3d.hpp.

23 {
24 scalar_unit e_square = (scifir::pow(WGS84_EARTH_SEMIAXIS_A,2) - scifir::pow(WGS84_EARTH_SEMIAXIS_B,2))/scifir::pow(WGS84_EARTH_SEMIAXIS_A,2);
25 scalar_unit e_prim_square = (scifir::pow(WGS84_EARTH_SEMIAXIS_A,2) - scifir::pow(WGS84_EARTH_SEMIAXIS_B,2))/scifir::pow(WGS84_EARTH_SEMIAXIS_B,2);
27 scalar_unit F = 54.0f * scifir::pow(WGS84_EARTH_SEMIAXIS_B,2) * scifir::pow(z,2);
28 long double G = std::pow(p.get_value(),2) + (1.0f - e_square.get_value()) * std::pow(z.get_value(),2) - e_square.get_value() * (std::pow(WGS84_EARTH_SEMIAXIS_A.get_value(),2) - std::pow(WGS84_EARTH_SEMIAXIS_B.get_value(),2));
29 long double c = (scifir::pow(e_square,2) * F * scifir::pow(p,2)).get_value() / std::pow(G,3);
30 long double s = std::cbrt(1.0f + c + std::sqrt(std::pow(c,2) + 2.0f * c));
31 long double k = s + 1.0f + (1.0f/s);
32 scalar_unit P = F/(3.0f * std::pow(k,2) * scalar_unit(std::pow(G,2),{ dimension(dimension::METRE,prefix::NONE,dimension::NUMERATOR),dimension(dimension::METRE,prefix::NONE,dimension::NUMERATOR),dimension(dimension::METRE,prefix::NONE,dimension::NUMERATOR),dimension(dimension::METRE,prefix::NONE,dimension::NUMERATOR) }));
33 scalar_unit Q = scifir::sqrt(1.0f + 2.0f * scifir::pow(e_square,2) * P);
34 scalar_unit r0 = -1.0f * ((P * e_square * p)/(1.0f + Q)) + scifir::sqrt((1.0f/2.0f) * scifir::pow(WGS84_EARTH_SEMIAXIS_A,2) * (1.0f + (1.0f / Q)) - (P * (1.0f - e_square) * scifir::pow(z,2))/(Q * (1.0f + Q)) - (1.0f/2.0f) * P * scifir::pow(p,2));
35 scalar_unit V = scifir::sqrt(scifir::pow(p - e_square * r0,2) + (1.0f - e_square) * scifir::pow(z,2));
36 scalar_unit z0 = scifir::pow(WGS84_EARTH_SEMIAXIS_B,2)*z/(WGS84_EARTH_SEMIAXIS_A * V);
37 return latitude(scifir::atan(float((z + e_prim_square * z0)/p)));
38 }
angle atan(float x)
Calculates the atan of some value x and returns the result as angle in degrees.
Definition angle.cpp:451

◆ ECEF_to_LLA_latitude() [2/2]

latitude scifir::ECEF_to_LLA_latitude ( float  x,
float  y,
float  z 
)
inline

Definition at line 87 of file coordinates_3d.hpp.

88 {
89 long double e_square = (std::pow(WGS84_EARTH_SEMIAXIS_A.get_value(),2) - std::pow(WGS84_EARTH_SEMIAXIS_B.get_value(),2))/std::pow(WGS84_EARTH_SEMIAXIS_A.get_value(),2);
90 long double e_prim_square = (std::pow(WGS84_EARTH_SEMIAXIS_A.get_value(),2) - std::pow(WGS84_EARTH_SEMIAXIS_B.get_value(),2))/std::pow(WGS84_EARTH_SEMIAXIS_B.get_value(),2);
91 long double p = std::sqrt(std::pow(x,2) + std::pow(y,2));
92 long double F = 54.0f * std::pow(WGS84_EARTH_SEMIAXIS_B.get_value(),2) * std::pow(z,2);
93 long double G = std::pow(p,2) + (1.0f - e_square) * std::pow(z,2) - e_square * (std::pow(WGS84_EARTH_SEMIAXIS_A.get_value(),2) - std::pow(WGS84_EARTH_SEMIAXIS_B.get_value(),2));
94 long double c = std::pow(e_square,2) * F * std::pow(p,2) / std::pow(G,3);
95 long double s = std::cbrt(1.0f + c + std::sqrt(std::pow(c,2) + 2.0f * c));
96 long double k = s + 1.0f + (1.0f/s);
97 long double P = F/(3.0f * std::pow(k,2) * std::pow(G,2));
98 long double Q = std::sqrt(1.0f + 2.0f * std::pow(e_square,2) * P);
99 long double r0 = -1.0f * ((P * e_square * p)/(1.0f + Q)) + std::sqrt((1.0f/2.0f) * std::pow(WGS84_EARTH_SEMIAXIS_A.get_value(),2) * (1.0f + (1.0f / Q)) - (P * (1.0f - e_square) * std::pow(z,2))/(Q * (1.0f + Q)) - (1.0f/2.0f) * P * std::pow(p,2));
100 long double V = std::sqrt(std::pow(p - e_square * r0,2) + (1.0f - e_square) * std::pow(z,2));
101 long double z0 = std::pow(WGS84_EARTH_SEMIAXIS_B.get_value(),2)*z/(WGS84_EARTH_SEMIAXIS_A.get_value() * V);
102 return latitude(scifir::atan(float((z + e_prim_square * z0)/p)));
103 }

◆ ECEF_to_LLA_longitude() [1/2]

longitude scifir::ECEF_to_LLA_longitude ( const scalar_unit x,
scalar_unit  y,
const scalar_unit z 
)
inline

Definition at line 40 of file coordinates_3d.hpp.

41 {
42 return longitude(scifir::atan2(float(y),float(x)));
43 }

◆ ECEF_to_LLA_longitude() [2/2]

longitude scifir::ECEF_to_LLA_longitude ( float  x,
float  y,
float  z 
)
inline

Definition at line 105 of file coordinates_3d.hpp.

106 {
107 return longitude(scifir::atan2(y,x));
108 }

◆ equal_dimensions() [1/2]

bool scifir::equal_dimensions ( const string init_dimensions_x,
const string init_dimensions_y 
)

Checks if two initialization strings of dimensions initialize the same basic dimensions.

Definition at line 2355 of file dimension.cpp.

2356 {
2360 }
bool equal_dimensions(const string &init_dimensions_x, const string &init_dimensions_y)
Checks if two initialization strings of dimensions initialize the same basic dimensions.

◆ equal_dimensions() [2/2]

bool scifir::equal_dimensions ( const vector< dimension > &  x,
const vector< dimension > &  y 
)

brief Checks if the base dimensions of two vectors of dimensions are equal.

Definition at line 2362 of file dimension.cpp.

2363 {
2366 if (x_base_dimensions.size() == y_base_dimensions.size())
2367 {
2368 if (x_base_dimensions.size() == 0)
2369 {
2370 return true;
2371 }
2372 vector<unsigned int> skip = vector<unsigned int>();
2373 for (const dimension& x_dimension: x_base_dimensions)
2374 {
2375 bool is_equal = false;
2376 for (unsigned int j = 0; j < y_base_dimensions.size(); j++)
2377 {
2378 bool skip_j = false;
2379 if (skip.size() > 0)
2380 {
2381 for (unsigned int k = 0; k < skip.size(); k++)
2382 {
2383 if (j == skip[k])
2384 {
2385 skip_j = true;
2386 }
2387 }
2388 }
2389 if (skip_j)
2390 {
2391 continue;
2392 }
2393 if (x_dimension.dimension_type == y_base_dimensions[j].dimension_type and x_dimension.dimension_position == y_base_dimensions[j].dimension_position)
2394 {
2395 skip.push_back(j);
2396 is_equal = true;
2397 break;
2398 }
2399 }
2400 if (!is_equal)
2401 {
2402 return false;
2403 }
2404 }
2405 return true;
2406 }
2407 else
2408 {
2409 return false;
2410 }
2411 }

◆ equal_dimensions_and_prefixes()

bool scifir::equal_dimensions_and_prefixes ( const vector< dimension > &  x,
const vector< dimension > &  y 
)

Checks if the base dimensions of two vectors of dimensions are equal, and if they have also the same prefixes.

Definition at line 2413 of file dimension.cpp.

2414 {
2416 if (x.size() == y.size())
2417 {
2418 for (const dimension& x_dimension: x)
2419 {
2420 bool is_equal = false;
2421 for (unsigned int j = 0; j < y.size(); j++)
2422 {
2423 bool skip_j = false;
2424 if (skip.size() > 0)
2425 {
2426 for (unsigned int k = 0; k < skip.size(); k++)
2427 {
2428 if (j == skip[k])
2429 {
2430 skip_j = true;
2431 }
2432 }
2433 }
2434 if (skip_j)
2435 {
2436 continue;
2437 }
2438 if (x_dimension == y[j])
2439 {
2440 skip.push_back(j);
2441 is_equal = true;
2442 break;
2443 }
2444 }
2445 if (!is_equal)
2446 {
2447 return false;
2448 }
2449 }
2450 return true;
2451 }
2452 else
2453 {
2454 return false;
2455 }
2456 }

◆ fahrenheit_to_kelvin()

float scifir::fahrenheit_to_kelvin ( float  x)
inline

Definition at line 37 of file conversion.hpp.

38 {
39 return (x - 32.0f) * (5.0f / 9.0f) + 273.15f;
40 }

◆ get_number_of_particles()

int scifir::mole::get_number_of_particles ( ) const

Definition at line 399 of file base_units.cpp.

400 {
401 return 1;
402 /*if (scalar_unit::actual_dimensions.count(particles))
403 {
404 return scalar_unit::value;
405 }
406 else
407 {
408 return scalar_unit::value * scifir::AVOGADRO_CONSTANT;
409 }*/
410 }

◆ gradian_to_degree()

float scifir::gradian_to_degree ( float  x)
inline

Definition at line 21 of file angle.hpp.

22 {
23 return x * 0.9f;
24 }

◆ gradian_to_radian()

float scifir::gradian_to_radian ( float  x)
inline

Definition at line 36 of file angle.hpp.

37 {
38 return x * 0.015708f;
39 }

◆ gradian_to_turn()

float scifir::gradian_to_turn ( float  x)
inline

Definition at line 71 of file angle.hpp.

72 {
73 return x / 400.0f;
74 }

◆ invert()

direction::name scifir::invert ( direction::name  x)

Definition at line 167 of file direction.cpp.

168 {
169 if (x == direction::LEFT)
170 {
171 return direction::RIGHT;
172 }
173 else if (x == direction::RIGHT)
174 {
175 return direction::LEFT;
176 }
177 else if (x == direction::TOP)
178 {
179 return direction::BOTTOM;
180 }
181 else if (x == direction::BOTTOM)
182 {
183 return direction::TOP;
184 }
185 else if (x == direction::FRONT)
186 {
187 return direction::BACK;
188 }
189 else if (x == direction::BACK)
190 {
191 return direction::FRONT;
192 }
193 else if (x == direction::LEFT_TOP)
194 {
195 return direction::RIGHT_BOTTOM;
196 }
197 else if (x == direction::LEFT_BOTTOM)
198 {
199 return direction::RIGHT_TOP;
200 }
201 else if (x == direction::RIGHT_TOP)
202 {
203 return direction::LEFT_BOTTOM;
204 }
205 else if (x == direction::RIGHT_BOTTOM)
206 {
207 return direction::LEFT_TOP;
208 }
209 else if (x == direction::LEFT_FRONT)
210 {
211 return direction::RIGHT_BACK;
212 }
213 else if (x == direction::LEFT_BACK)
214 {
215 return direction::RIGHT_FRONT;
216 }
217 else if (x == direction::RIGHT_FRONT)
218 {
219 return direction::LEFT_BACK;
220 }
221 else if (x == direction::RIGHT_BACK)
222 {
223 return direction::LEFT_FRONT;
224 }
225 else if (x == direction::TOP_FRONT)
226 {
227 return direction::BOTTOM_BACK;
228 }
229 else if (x == direction::TOP_BACK)
230 {
231 return direction::BOTTOM_FRONT;
232 }
233 else if (x == direction::BOTTOM_FRONT)
234 {
235 return direction::TOP_BACK;
236 }
237 else if (x == direction::BOTTOM_BACK)
238 {
239 return direction::TOP_FRONT;
240 }
241 else if (x == direction::LEFT_TOP_FRONT)
242 {
243 return direction::RIGHT_BOTTOM_BACK;
244 }
245 else if (x == direction::LEFT_TOP_BACK)
246 {
247 return direction::RIGHT_BOTTOM_FRONT;
248 }
249 else if (x == direction::LEFT_BOTTOM_FRONT)
250 {
251 return direction::RIGHT_TOP_BACK;
252 }
253 else if (x == direction::LEFT_BOTTOM_BACK)
254 {
255 return direction::RIGHT_TOP_FRONT;
256 }
257 else if (x == direction::RIGHT_TOP_FRONT)
258 {
259 return direction::LEFT_BOTTOM_BACK;
260 }
261 else if (x == direction::RIGHT_TOP_BACK)
262 {
263 return direction::LEFT_BOTTOM_FRONT;
264 }
265 else if (x == direction::RIGHT_BOTTOM_FRONT)
266 {
267 return direction::LEFT_TOP_BACK;
268 }
269 else if (x == direction::RIGHT_BOTTOM_BACK)
270 {
271 return direction::LEFT_TOP_FRONT;
272 }
273 else
274 {
275 return direction::NONE;
276 }
277 }

◆ is_angle()

bool scifir::is_angle ( const string init_angle)

Checks if some string is an initialization string of an angle.

Definition at line 336 of file angle.cpp.

337 {
338 icu::UnicodeString x_unicode = icu::UnicodeString(init_angle.c_str());
339 int total_chars = x_unicode.countChar32();
340 bool loop = false;
341 if (x_unicode[total_chars - 1] == 0x00B0 || x_unicode[total_chars - 1] == 0x00BA)
342 {
343 loop = true;
344 }
345 else if (total_chars >= 5 and init_angle.substr(init_angle.length() - 4) == " deg")
346 {
347 loop = true;
348 total_chars -= 4;
349 }
350 else if (total_chars >= 5 and init_angle.substr(init_angle.length() - 4) == " rad")
351 {
352 loop = true;
353 total_chars -= 4;
354 }
355 else if (total_chars>= 6 and init_angle.substr(init_angle.length() - 5) == " grad")
356 {
357 loop = true;
358 total_chars -= 5;
359 }
360 else if (total_chars >= 4 and init_angle.substr(init_angle.length() - 3) == " tr")
361 {
362 loop = true;
363 total_chars -= 3;
364 }
365 if (loop == false)
366 {
367 return false;
368 }
369 bool dot_present = false;
370 for (int i = 0; i < (total_chars - 1); i++)
371 {
372 if (x_unicode[i] == '.')
373 {
374 if (dot_present)
375 {
376 return false;
377 }
378 else
379 {
380 dot_present = true;
381 }
382 }
383 else if (!u_isdigit(x_unicode[i]))
384 {
385 return false;
386 }
387 }
388 return true;
389 }

◆ is_complex()

bool scifir::is_complex ( const string init_complex_number)

Definition at line 7 of file complex_number.cpp.

8 {
9 if ((init_complex_number.find("+") != string::npos or init_complex_number.find("-") != string::npos) and init_complex_number.length() > 1)
10 {
12 boost::split(numbers,init_complex_number,boost::is_any_of("+-"));
13 if (numbers.size() != 2)
14 {
15 return false;
16 }
17 if ((int(numbers[1].length()) - 3) <= 0)
18 {
19 return false;
20 }
21 unsigned int imaginary_length = int(numbers[1].length()) - 3;
22 if (numbers[1].substr(imaginary_length) == "(i)")
23 {
24 bool dot_present = false;
25 bool after_whitespace = false;
26 bool after_alpha = false;
27 boost::trim(numbers[0]);
28 boost::trim(numbers[1]);
29 for (unsigned int i = 0; i < numbers[0].length(); i++)
30 {
31 if (numbers[0][i] == '.')
32 {
33 if (dot_present)
34 {
35 return false;
36 }
37 else
38 {
39 dot_present = true;
40 continue;
41 }
42 }
43 else if (numbers[0][i] == ' ')
44 {
45 after_whitespace = true;
46 continue;
47 }
48 else if (!std::isdigit(numbers[0][i]) and after_whitespace == false)
49 {
50 return false;
51 }
52 else if (after_whitespace == true)
53 {
54 if (after_alpha == true and std::isalpha(numbers[0][i]))
55 {
56 return false;
57 }
58 else if (std::isalpha(numbers[0][i]))
59 {
60 continue;
61 }
62 else if (std::isdigit(numbers[0][i]))
63 {
64 after_alpha = true;
65 }
66 }
67 }
68 dot_present = false;
69 after_whitespace = false;
70 after_alpha = false;
71 for (unsigned int i = 0; i < imaginary_length; i++)
72 {
73 if (numbers[1][i] == '.')
74 {
75 if (dot_present)
76 {
77 return false;
78 }
79 else
80 {
81 dot_present = true;
82 continue;
83 }
84 }
85 else if (numbers[1][i] == ' ')
86 {
87 after_whitespace = true;
88 continue;
89 }
90 else if (!std::isdigit(numbers[1][i]) and after_whitespace == false)
91 {
92 return false;
93 }
94 else if (after_whitespace == true)
95 {
96 if (after_alpha == true and std::isalpha(numbers[1][i]))
97 {
98 return false;
99 }
100 else if (std::isalpha(numbers[1][i]))
101 {
102 continue;
103 }
104 else if (std::isdigit(numbers[1][i]))
105 {
106 after_alpha = true;
107 }
108 }
109 }
110 return true;
111 }
112 else
113 {
114 return false;
115 }
116 }
117 else
118 {
119 return false;
120 }
121 }

◆ is_dimension_char()

bool scifir::is_dimension_char ( const UChar32 x)

Definition at line 2335 of file dimension.cpp.

2336 {
2337 return u_isalpha(x) || x == UChar32(U'Ω') || x == UChar32(U'Å') || x == UChar32(U'θ') || x == UChar32(U'°');
2338 }

◆ is_lab_number()

bool scifir::is_lab_number ( const string init_lab_number)

Definition at line 7 of file lab_number.cpp.

8 {
9 if ((init_lab_number.find("\u00B1") != string::npos or init_lab_number.find("+") != string::npos or init_lab_number.find("-") != string::npos) and init_lab_number.length() > 1)
10 {
12 boost::split(numbers,init_lab_number,boost::is_any_of("+-,\u00B1"));
13 if (numbers.size() != 3)
14 {
15 return false;
16 }
17 if (numbers[2].length() < 1)
18 {
19 return false;
20 }
21 bool dot_present = false;
22 bool after_whitespace = false;
23 bool after_alpha = false;
24 boost::trim(numbers[0]);
25 boost::trim(numbers[2]);
26 for (unsigned int i = 0; i < numbers[0].length(); i++)
27 {
28 if (numbers[0][i] == '.')
29 {
30 if (dot_present)
31 {
32 return false;
33 }
34 else
35 {
36 dot_present = true;
37 continue;
38 }
39 }
40 else if (numbers[0][i] == ' ')
41 {
42 after_whitespace = true;
43 continue;
44 }
45 else if (!std::isdigit(numbers[0][i]) and after_whitespace == false)
46 {
47 return false;
48 }
49 else if (after_whitespace == true)
50 {
51 if (after_alpha == true and std::isalpha(numbers[0][i]))
52 {
53 return false;
54 }
55 else if (std::isalpha(numbers[0][i]))
56 {
57 continue;
58 }
59 else if (std::isdigit(numbers[0][i]))
60 {
61 after_alpha = true;
62 }
63 }
64 }
65 dot_present = false;
66 after_whitespace = false;
67 after_alpha = false;
68 for (unsigned int i = 0; i < numbers[2].length(); i++)
69 {
70 if (numbers[2][i] == '.')
71 {
72 if (dot_present)
73 {
74 return false;
75 }
76 else
77 {
78 dot_present = true;
79 continue;
80 }
81 }
82 else if (numbers[2][i] == ' ')
83 {
84 after_whitespace = true;
85 continue;
86 }
87 else if (!std::isdigit(numbers[2][i]) and after_whitespace == false)
88 {
89 return false;
90 }
91 else if (after_whitespace == true)
92 {
93 if (after_alpha == true and std::isalpha(numbers[2][i]))
94 {
95 return false;
96 }
97 else if (std::isalpha(numbers[2][i]))
98 {
99 continue;
100 }
101 else if (std::isdigit(numbers[2][i]))
102 {
103 after_alpha = true;
104 }
105 }
106 }
107 return true;
108 }
109 else
110 {
111 return false;
112 }
113 }

◆ is_latitude()

bool scifir::is_latitude ( const string init_latitude)

Definition at line 199 of file latitude.cpp.

200 {
201 if (init_latitude.length() == 0)
202 {
203 return false;
204 }
205 bool cardinale_point_present = false;
206 if (init_latitude.substr(init_latitude.length() - 1) == "N")
207 {
208 cardinale_point_present = true;
209 }
210 else if (init_latitude.substr(init_latitude.length() - 1) == "S")
211 {
212 cardinale_point_present = true;
213 }
214 int start_point = 0;
215 if (cardinale_point_present == false && init_latitude[0] == '-')
216 {
217 start_point++;
218 }
219 icu::UnicodeString x_unicode = icu::UnicodeString(init_latitude.c_str());
220 int total_chars = x_unicode.countChar32();
221 if (cardinale_point_present)
222 {
223 total_chars--;
224 }
225 bool loop = false;
226 if (x_unicode[total_chars - 1] == 0x00B0 || x_unicode[total_chars - 1] == 0x00BA)
227 {
228 loop = true;
229 }
230 if (loop == false)
231 {
232 return false;
233 }
234 bool dot_present = false;
235 for (int i = start_point; i < (total_chars - 1); i++)
236 {
237 if (x_unicode[i] == '.')
238 {
239 if (dot_present)
240 {
241 return false;
242 }
243 else
244 {
245 dot_present = true;
246 }
247 }
248 else if (!u_isdigit(x_unicode[i]))
249 {
250 return false;
251 }
252 }
253 return true;
254 }

◆ is_longitude()

bool scifir::is_longitude ( const string init_longitude)

Definition at line 195 of file longitude.cpp.

196 {
197 if (init_longitude.length() == 0)
198 {
199 return false;
200 }
201 bool cardinale_point_present = false;
202 if (init_longitude.substr(init_longitude.length() - 1) == "E")
203 {
204 cardinale_point_present = true;
205 }
206 else if (init_longitude.substr(init_longitude.length() - 1) == "W")
207 {
208 cardinale_point_present = true;
209 }
210 int start_point = 0;
211 if (cardinale_point_present == false && init_longitude[0] == '-')
212 {
213 start_point++;
214 }
215 icu::UnicodeString x_unicode = icu::UnicodeString(init_longitude.c_str());
216 int total_chars = x_unicode.countChar32();
217 if (cardinale_point_present)
218 {
219 total_chars--;
220 }
221 bool loop = false;
222 if (x_unicode[total_chars - 1] == 0x00B0 || x_unicode[total_chars - 1] == 0x00BA)
223 {
224 loop = true;
225 }
226 if (loop == false)
227 {
228 return false;
229 }
230 bool dot_present = false;
231 for (int i = start_point; i < (total_chars - 1); i++)
232 {
233 if (x_unicode[i] == '.')
234 {
235 if (dot_present)
236 {
237 return false;
238 }
239 else
240 {
241 dot_present = true;
242 }
243 }
244 else if (!u_isdigit(x_unicode[i]))
245 {
246 return false;
247 }
248 }
249 return true;
250 }

◆ is_percentage()

bool scifir::is_percentage ( const string init_percentage)

Checks if a string is an initialization string of percentage.

Definition at line 488 of file percentage.cpp.

489 {
490 int iteration_limit;
491 if (init_percentage.back() == '%')
492 {
493 iteration_limit = int(init_percentage.length()) - 1;
494 }
495 else
496 {
497 string percentage_unit = init_percentage.substr(init_percentage.length() - 4,4);
498 if (percentage_unit == " ppm"/* or percentage_unit == " ppb" or percentage_unit == " ppt" or percentage_unit == " ppq"*/)
499 {
500 iteration_limit = int(init_percentage.length()) - 4;
501 }
502 else
503 {
504 percentage_unit = init_percentage.substr(init_percentage.length() - 3,3);
505 if (percentage_unit == "ppm"/* or percentage_unit == "ppb" or percentage_unit == "ppt" or percentage_unit == "ppq"*/)
506 {
507 iteration_limit = int(init_percentage.length()) - 3;
508 }
509 else
510 {
511 return false;
512 }
513 }
514 }
515 bool dot_present = false;
516 for (int i = 0; i < iteration_limit; i++)
517 {
518 if (init_percentage[i] == '.')
519 {
520 if (dot_present)
521 {
522 return false;
523 }
524 else
525 {
526 dot_present = true;
527 }
528 }
529 else if (!std::isdigit(init_percentage[i]))
530 {
531 return false;
532 }
533 }
534 return true;
535 }

◆ is_pixel()

bool scifir::is_pixel ( const string init_pixel)

Definition at line 201 of file pixel.cpp.

202 {
203 int iteration_limit;
204 if (init_pixel.substr(init_pixel.length() - 3,3) == " px")
205 {
206 iteration_limit = int(init_pixel.length()) - 3;
207 }
208 else if (init_pixel.substr(init_pixel.length() - 2,2) == "px")
209 {
210 iteration_limit = int(init_pixel.length()) - 2;
211 }
212 else
213 {
214 iteration_limit = int(init_pixel.length());
215 }
216 bool dot_present = false;
217 for (int i = 0; i < iteration_limit; i++)
218 {
219 if (init_pixel[i] == '.')
220 {
221 if (dot_present)
222 {
223 return false;
224 }
225 else
226 {
227 dot_present = true;
228 }
229 }
230 else if (!std::isdigit(init_pixel[i]))
231 {
232 return false;
233 }
234 }
235 return true;
236 }

◆ is_scalar_unit()

bool scifir::is_scalar_unit ( const string init_scalar)

Checks if an string is an initialization string of a scalar_unit.

Parameters
init_scalarstring to check. It must be an initialization string of a scalar_unit to return true.

Definition at line 745 of file scalar_unit.cpp.

746 {
747 bool dot_present = false;
748 bool e_present = false;
749 unsigned int current_pos = 0;
750 int e_present_pos = 0;
751 for (unsigned int i = 0; i < init_scalar.length(); i++)
752 {
753 if (init_scalar[i] == ' ')
754 {
755 if (e_present and ((unsigned int)(e_present_pos + 1) == i))
756 {
757 return false;
758 }
759 current_pos = i;
760 break;
761 }
762 if (e_present == false)
763 {
764 if (init_scalar[i] == '.')
765 {
766 if (dot_present)
767 {
768 return false;
769 }
770 else
771 {
772 dot_present = true;
773 }
774 }
775 else if (init_scalar[i] == 'e' or init_scalar[i] == 'E')
776 {
777 e_present = true;
778 e_present_pos = i;
779 continue;
780 }
781 else if (init_scalar[i] == '*')
782 {
783 if (!(init_scalar.substr(i + 1,3) == "10^"))
784 {
785 return false;
786 }
787 else
788 {
789 e_present = true;
790 i += 3;
791 e_present_pos = i;
792 continue;
793 }
794 }
795 else if (!isdigit(init_scalar[i]))
796 {
797 return false;
798 }
799 else if (i == (init_scalar.length() - 1))
800 {
801 return false;
802 }
803 }
804 else
805 {
806 if (!isdigit(init_scalar[i]))
807 {
808 return false;
809 }
810 }
811 }
812 if (current_pos == (init_scalar.length() - 1))
813 {
814 return false;
815 }
816 if (current_pos == 0)
817 {
818 return false;
819 }
820 bool brackets_present = false;
821 if (init_scalar.at(current_pos + 1) == '[')
822 {
823 if (init_scalar.at(init_scalar.size() - 1) != ']')
824 {
825 return false;
826 }
827 current_pos++;
828 brackets_present = true;
829 }
830 vector<string> values;
831 boost::split(values,init_scalar.substr(current_pos + 1,init_scalar.size() - 1),boost::is_any_of("/"));
832 if (brackets_present)
833 {
834 values[values.size() - 1] = values[values.size() - 1].substr(0,values[values.size() - 1].size() - 1);
835 }
836 if (values.size() == 1)
837 {
838 vector<string> subvalues;
839 boost::split(subvalues,values[0],boost::is_any_of("*"));
840 for (string& x_subvalue : subvalues)
841 {
842 boost::trim(x_subvalue);
843 bool number_present = false;
844 for (unsigned int i = 0; i < x_subvalue.length(); i++)
845 {
846 if (number_present == false)
847 {
848 if (isdigit(x_subvalue[i]))
849 {
850 number_present = true;
851 continue;
852 }
853 else if (!isalpha(x_subvalue[i]))
854 {
855 return false;
856 }
857 }
858 else
859 {
860 if (!isdigit(x_subvalue[i]))
861 {
862 return false;
863 }
864 }
865 }
866 }
867 return true;
868 }
869 else if (values.size() == 2)
870 {
871 if (values[0] != "1")
872 {
873 vector<string> subvalues;
874 boost::split(subvalues,values[0],boost::is_any_of("*"));
875 for (string& x_subvalue : subvalues)
876 {
877 boost::trim(x_subvalue);
878 bool number_present = false;
879 for (unsigned int i = 0; i < x_subvalue.length(); i++)
880 {
881 if (number_present == false)
882 {
883 if (isdigit(x_subvalue[i]))
884 {
885 number_present = true;
886 continue;
887 }
888 else if (!isalpha(x_subvalue[i]))
889 {
890 return false;
891 }
892 }
893 else
894 {
895 if (!isdigit(x_subvalue[i]))
896 {
897 return false;
898 }
899 }
900 }
901 }
902 }
903 vector<string> subvalues_denominator;
904 boost::split(subvalues_denominator,values[1],boost::is_any_of("*"));
905 for (string& x_subvalue : subvalues_denominator)
906 {
907 boost::trim(x_subvalue);
908 bool number_present = false;
909 for (unsigned int i = 0; i < x_subvalue.length(); i++)
910 {
911 if (number_present == false)
912 {
913 if (isdigit(x_subvalue[i]))
914 {
915 number_present = true;
916 continue;
917 }
918 else if (!isalpha(x_subvalue[i]))
919 {
920 return false;
921 }
922 }
923 else
924 {
925 if (!isdigit(x_subvalue[i]))
926 {
927 return false;
928 }
929 }
930 }
931 }
932 return true;
933 }
934 return false;
935 }

◆ kelvin_to_fahrenheit()

float scifir::kelvin_to_fahrenheit ( float  x)
inline

Definition at line 42 of file conversion.hpp.

43 {
44 return (x - 273.15f) * 1.8f + 32.0f;
45 }

◆ LLA_to_ECEF_x()

scalar_unit scifir::LLA_to_ECEF_x ( const latitude latitude,
const longitude longitude,
scalar_unit  altitude 
)
inline

Definition at line 63 of file coordinates_3d.hpp.

64 {
65 long double e_square = 0.00669437999014l;
66 long double n = WGS84_EARTH_SEMIAXIS_A.get_value() / std::sqrt(1 - e_square * scifir::sin(latitude) * scifir::sin(latitude));
67 altitude.change_dimensions("m");
69 }

◆ LLA_to_ECEF_y()

scalar_unit scifir::LLA_to_ECEF_y ( const latitude latitude,
const longitude longitude,
scalar_unit  altitude 
)
inline

Definition at line 71 of file coordinates_3d.hpp.

72 {
73 long double e_square = 0.00669437999014l;
74 long double n = WGS84_EARTH_SEMIAXIS_A.get_value() / std::sqrt(1 - e_square * scifir::sin(latitude) * scifir::sin(latitude));
75 altitude.change_dimensions("m");
77 }

◆ LLA_to_ECEF_z()

scalar_unit scifir::LLA_to_ECEF_z ( const latitude latitude,
const longitude longitude,
scalar_unit  altitude 
)
inline

Definition at line 79 of file coordinates_3d.hpp.

80 {
81 long double e_square = 0.00669437999014l;
82 long double n = WGS84_EARTH_SEMIAXIS_A.get_value() / std::sqrt(1 - e_square * scifir::sin(latitude) * scifir::sin(latitude));
83 altitude.change_dimensions("m");
84 return ((1 - e_square) * n + altitude) * scifir::sin(latitude);
85 }

◆ mass() [1/2]

scifir::mass::mass ( const percentage new_percentage,
const mass &  new_mass 
)

Definition at line 369 of file base_units.cpp.

369 : scalar_unit()
370 {
371 dimensions = new_mass.get_dimensions();
372 value = new_percentage * new_mass.get_value();
373 }

◆ mass() [2/2]

scifir::mass::mass ( const string init_percentage,
const string init_mass 
)

Definition at line 375 of file base_units.cpp.

375 : scalar_unit()
376 {
377 initialize_from_string(init_mass,mass::real_dimensions);
379 value = new_percentage * value;
380 }
Class that allows to handle percentages and do calculations with it easy. It supports normal percenta...

◆ mole() [1/2]

scifir::mole::mole ( const percentage new_percentage,
const mole &  new_mole 
)

Definition at line 386 of file base_units.cpp.

386 : scalar_unit()
387 {
388 dimensions = new_mole.get_dimensions();
389 value = new_percentage * new_mole.get_value();
390 }

◆ mole() [2/2]

scifir::mole::mole ( const string init_percentage,
const string init_mole 
)

Definition at line 392 of file base_units.cpp.

392 : scalar_unit()
393 {
394 initialize_from_string(init_mole,mole::real_dimensions);
396 value = new_percentage * value;
397 }

◆ multiply_dimensions() [1/2]

vector< dimension > scifir::multiply_dimensions ( const vector< dimension > &  x,
const vector< dimension > &  y 
)

Multiplies two vectors of dimensions. The result is normalized after, which means that equal dimensions at the numerator and at the denominator are cancelled.

Definition at line 2089 of file dimension.cpp.

2090 {
2092 for(const dimension& y_dimension : y)
2093 {
2094 new_dimensions.push_back(y_dimension);
2095 }
2096 return new_dimensions;
2097 }

◆ multiply_dimensions() [2/2]

vector< dimension > scifir::multiply_dimensions ( vector< dimension x,
const vector< dimension > &  y,
long double value 
)

Multiplies two vectors of dimensions. The result is normalized after, which means that equal dimensions at the numerator and at the denominator are cancelled. It also updates the value associated with those two vectors of dimensions with the prefix m ath and the conversion factor of those dimensions.

Definition at line 2099 of file dimension.cpp.

2100 {
2101 for(const dimension& y_dimension : y)
2102 {
2103 x.push_back(y_dimension);
2104 }
2105 return normalize_dimensions(x,value);
2106 }

◆ norm() [1/3]

scalar_unit scifir::norm ( const vector_unit_2d x)

It returns the value of the vector in polar coordinates, p.

Definition at line 345 of file vector_unit_2d.cpp.

346 {
347 return scalar_unit(std::abs(x.get_value()),x.get_dimensions());
348 }

◆ norm() [2/3]

scalar_unit scifir::norm ( const vector_unit_3d x)

It returns the value of the vector in spherical coordinates, r.

Definition at line 450 of file vector_unit_3d.cpp.

451 {
452 return scalar_unit(std::abs(x.get_value()),x.get_dimensions());
453 }

◆ norm() [3/3]

scalar_unit scifir::norm ( const vector_unit_nd x)

It returns the value of the vector, which is the value in 1D, p in 2D (polar coordinates), or r in 3D (spherical coordinates).

Definition at line 786 of file vector_unit_nd.cpp.

787 {
788 return scalar_unit(std::abs(x.get_value()),x.get_dimensions());
789 }

◆ normalize_dimensions() [1/2]

vector< dimension > scifir::normalize_dimensions ( const vector< dimension > &  x)

Normalizes the dimensions, which means that repited dimensions at the numerator and at the denominator are cancelled.

Definition at line 2203 of file dimension.cpp.

2204 {
2206 if (new_x.size() == 1)
2207 {
2208 return x;
2209 }
2210 vector<unsigned int> skip_dimensions = vector<unsigned int>();
2211 for(unsigned int i = 0; i < new_x.size(); i++)
2212 {
2213 for(unsigned int j = i + 1; j < new_x.size(); j++)
2214 {
2215 if (skip_dimensions.size() > 0)
2216 {
2217 bool skip = false;
2218 for(unsigned int k = 0; k < skip_dimensions.size(); k++)
2219 {
2220 if (j == skip_dimensions[k])
2221 {
2222 skip = true;
2223 break;
2224 }
2225 }
2226 if (skip)
2227 {
2228 continue;
2229 }
2230 }
2231 if (new_x[i].dimension_type == new_x[j].dimension_type and new_x[i].dimension_position != new_x[j].dimension_position)
2232 {
2233 skip_dimensions.push_back(i);
2234 skip_dimensions.push_back(j);
2235 break;
2236 }
2237 }
2238 }
2239 vector<dimension> new_dimensions = vector<dimension>();
2240 for(unsigned int i = 0; i < new_x.size(); i++)
2241 {
2242 bool skip = false;
2243 for(unsigned int j = 0; j < skip_dimensions.size(); j++)
2244 {
2245 if (i == skip_dimensions[j])
2246 {
2247 skip = true;
2248 break;
2249 }
2250 }
2251 if (!skip)
2252 {
2253 new_dimensions.push_back(new_x[i]);
2254 }
2255 }
2256 return new_dimensions;
2257 }

◆ normalize_dimensions() [2/2]

vector< dimension > scifir::normalize_dimensions ( const vector< dimension > &  x,
long double value 
)

Normalizes the dimensions, which means that repited dimensions at the numerator and at the denominator are cancelled. The value is updated if there are dimensions cancelled.

Definition at line 2259 of file dimension.cpp.

2260 {
2262 if (new_x.size() == 1)
2263 {
2264 return x;
2265 }
2266 vector<unsigned int> skip_dimensions = vector<unsigned int>();
2267 for(unsigned int i = 0; i < new_x.size(); i++)
2268 {
2269 for(unsigned int j = i + 1; j < new_x.size(); j++)
2270 {
2271 if (skip_dimensions.size() > 0)
2272 {
2273 bool skip = false;
2274 for(unsigned int k = 0; k < skip_dimensions.size(); k++)
2275 {
2276 if (j == skip_dimensions[k])
2277 {
2278 skip = true;
2279 break;
2280 }
2281 }
2282 if (skip)
2283 {
2284 continue;
2285 }
2286 }
2287 if (new_x[i].dimension_type == new_x[j].dimension_type and new_x[i].dimension_position != new_x[j].dimension_position)
2288 {
2289 if (new_x[i].dimension_position == dimension::NUMERATOR)
2290 {
2291 value *= float(new_x[i].get_conversion_factor());
2292 value *= float(new_x[i].prefix_math());
2293 }
2294 else if (new_x[i].dimension_position == dimension::DENOMINATOR)
2295 {
2296 value /= float(new_x[i].get_conversion_factor());
2297 value /= float(new_x[i].prefix_math());
2298 }
2299 if (new_x[j].dimension_position == dimension::NUMERATOR)
2300 {
2301 value *= float(new_x[j].get_conversion_factor());
2302 value *= float(new_x[j].prefix_math());
2303 }
2304 else if (new_x[j].dimension_position == dimension::DENOMINATOR)
2305 {
2306 value /= float(new_x[j].get_conversion_factor());
2307 value /= float(new_x[j].prefix_math());
2308 }
2309 skip_dimensions.push_back(i);
2310 skip_dimensions.push_back(j);
2311 break;
2312 }
2313 }
2314 }
2315 vector<dimension> new_dimensions = vector<dimension>();
2316 for(unsigned int i = 0; i < new_x.size(); i++)
2317 {
2318 bool skip = false;
2319 for(unsigned int j = 0; j < skip_dimensions.size(); j++)
2320 {
2321 if (i == skip_dimensions[j])
2322 {
2323 skip = true;
2324 break;
2325 }
2326 }
2327 if (!skip)
2328 {
2329 new_dimensions.push_back(new_x[i]);
2330 }
2331 }
2332 return new_dimensions;
2333 }

◆ orthogonal() [1/4]

bool scifir::orthogonal ( const angle x,
const angle y 
)

Checks if two angles in a 2D correspond to orthogonal lines (or orthogonal vectors).

Definition at line 403 of file angle.cpp.

404 {
405 float difference = std::abs((x - y).get_value());
406 if (difference == 90.0f or difference == 270.0f)
407 {
408 return true;
409 }
410 else
411 {
412 return false;
413 }
414 }

◆ orthogonal() [2/4]

bool scifir::orthogonal ( const vector_unit_2d x,
const vector_unit_2d y 
)

Checks if two vectors x and y are orthogonal, that's, if they have 90 degrees of difference.

Definition at line 384 of file vector_unit_2d.cpp.

385 {
386 return scifir::orthogonal(x.theta,y.theta);
387 }
angle theta
Angle of the vector in 2D space, in polar coordinates. As all angles of scifir-units,...
bool orthogonal(const angle &x, const angle &y)
Checks if two angles in a 2D correspond to orthogonal lines (or orthogonal vectors).
Definition angle.cpp:403

◆ orthogonal() [3/4]

bool scifir::orthogonal ( const vector_unit_3d x,
const vector_unit_3d y 
)

Checks if two vectors x and y are orthogonal, that's, if they have 90 degrees between them.

Definition at line 525 of file vector_unit_3d.cpp.

526 {
528 return (x_angle == 90.0f);
529 }
angle angle_between(const vector_unit_2d &x, const vector_unit_2d &y)
Returns the angle between two vectors x and y inside a 2D space.

◆ orthogonal() [4/4]

bool scifir::orthogonal ( const vector_unit_nd x,
const vector_unit_nd y 
)

Checks if two vectors x and y are orthogonal, that's, if they have 90 degrees between them. Both vectors must have the same ND, otherwise it returns an empty vector_unit_nd instead.

Definition at line 903 of file vector_unit_nd.cpp.

904 {
905 if (same_nd(x,y))
906 {
907 if (x.get_nd() == 1)
908 {
909 return false;
910 }
911 else if (x.get_nd() == 2)
912 {
913 return scifir::orthogonal(x.angles[0],y.angles[0]);
914 }
915 else if (x.get_nd() == 3)
916 {
917 scifir::angle x_angle = angle_between(x,y);
918 return (x_angle == 90.0f);
919 }
920 }
921 return false;
922 }
int get_nd() const
Returns the number of dimensions.
bool same_nd(const vector_unit_nd &x, const vector_unit_nd &y)
Checks if two vectors have the same number of dimensions.

◆ parallel() [1/4]

bool scifir::parallel ( const angle x,
const angle y 
)

Checks if two angles in a 2D correspond to parallel lines (or parallel vectors).

Definition at line 391 of file angle.cpp.

392 {
393 if(x == y or (x + 180.0f) == y)
394 {
395 return true;
396 }
397 else
398 {
399 return false;
400 }
401 }

◆ parallel() [2/4]

bool scifir::parallel ( const vector_unit_2d x,
const vector_unit_2d y 
)

Checks if two vectors x and y are parallel, which means that their direction is the same or the exact opposite.

Definition at line 379 of file vector_unit_2d.cpp.

380 {
381 return scifir::parallel(x.theta,y.theta);
382 }
bool parallel(const angle &x, const angle &y)
Checks if two angles in a 2D correspond to parallel lines (or parallel vectors).
Definition angle.cpp:391

◆ parallel() [3/4]

bool scifir::parallel ( const vector_unit_3d x,
const vector_unit_3d y 
)

Checks if two vectors x and y are parallel, which means that their direction is the same or the exact opposite.

Definition at line 513 of file vector_unit_3d.cpp.

514 {
515 if ((x.theta == y.theta and x.phi == y.phi) or (x.theta == (180.0f + y.theta) and x.phi == (180.0f - y.phi)))
516 {
517 return true;
518 }
519 else
520 {
521 return false;
522 }
523 }

◆ parallel() [4/4]

bool scifir::parallel ( const vector_unit_nd x,
const vector_unit_nd y 
)

Checks if two vectors x and y are parallel, which means that their direction is the same or the exact opposite. Both vectors must have the same ND, otherwise it returns an empty vector_unit_nd instead.

Definition at line 876 of file vector_unit_nd.cpp.

877 {
878 if (same_nd(x,y))
879 {
880 if (x.get_nd() == 1)
881 {
882 return true;
883 }
884 else if (x.get_nd() == 2)
885 {
886 return scifir::parallel(x.angles[0],y.angles[0]);
887 }
888 else if (x.get_nd() == 3)
889 {
890 if ((x.angles[0] == y.angles[0] and x.angles[1] == y.angles[1]) or (x.angles[0] == (180.0f + y.angles[0]) and x.angles[1] == (180.0f - y.angles[1])))
891 {
892 return true;
893 }
894 else
895 {
896 return false;
897 }
898 }
899 }
900 return false;
901 }

◆ parse_float()

float scifir::parse_float ( const string x)

Definition at line 10 of file types.cpp.

11 {
12 try
13 {
14 float value = stof(x);
15 return value;
16 }
17 catch (const exception& e)
18 {
19 return 0;
20 }
21 }

◆ parse_int()

int scifir::parse_int ( const string x)

Definition at line 23 of file types.cpp.

24 {
25 try
26 {
27 int value = stoi(x);
28 return value;
29 }
30 catch (const exception& e)
31 {
32 return 0;
33 }
34 }

◆ polar_to_cartesian_2d_x() [1/2]

scalar_unit scifir::polar_to_cartesian_2d_x ( const scalar_unit p,
const angle theta 
)
inline

Definition at line 366 of file coordinates_2d.hpp.

367 {
368 return p * scifir::cos(theta);
369 }

◆ polar_to_cartesian_2d_x() [2/2]

float scifir::polar_to_cartesian_2d_x ( float  p,
const angle theta 
)
inline

Definition at line 386 of file coordinates_2d.hpp.

387 {
388 return p * scifir::cos(theta);
389 }

◆ polar_to_cartesian_2d_y() [1/2]

scalar_unit scifir::polar_to_cartesian_2d_y ( const scalar_unit p,
const angle theta 
)
inline

Definition at line 371 of file coordinates_2d.hpp.

372 {
373 return p * scifir::sin(theta);
374 }

◆ polar_to_cartesian_2d_y() [2/2]

float scifir::polar_to_cartesian_2d_y ( float  p,
const angle theta 
)
inline

Definition at line 391 of file coordinates_2d.hpp.

392 {
393 return p * scifir::sin(theta);
394 }

◆ pow()

scalar_unit scifir::pow ( const scalar_unit x,
int  exponent 
)

Exponentiates a scalar_unit to some numeric type, the dimensions are also exponentiated.

Definition at line 942 of file scalar_unit.cpp.

943 {
944 return x ^ exponent;
945 }

◆ power_dimensions()

vector< dimension > scifir::power_dimensions ( const vector< dimension > &  x,
int  exponent 
)

Powers the dimensions by an exponent.

Definition at line 2190 of file dimension.cpp.

2191 {
2193 for (const dimension& x_dimension: x)
2194 {
2195 for (unsigned int j = 1; j <= exponent; j++)
2196 {
2197 new_dimensions.push_back(x_dimension);
2198 }
2199 }
2200 return new_dimensions;
2201 }

◆ prefix_string()

prefix::type scifir::prefix_string ( const string x)

Returns the value of the enum prefix::type associated with the string x given.

Definition at line 215 of file prefix.cpp.

216 {
217 if (x == "Q")
218 {
219 return prefix::QUETTA;
220 }
221 else if (x == "R")
222 {
223 return prefix::RONNA;
224 }
225 else if (x == "Y")
226 {
227 return prefix::YOTTA;
228 }
229 else if (x == "Z")
230 {
231 return prefix::ZETTA;
232 }
233 else if (x == "E")
234 {
235 return prefix::EXA;
236 }
237 else if (x == "P")
238 {
239 return prefix::PETA;
240 }
241 else if (x == "T")
242 {
243 return prefix::TERA;
244 }
245 else if(x == "G")
246 {
247 return prefix::GIGA;
248 }
249 else if(x == "M")
250 {
251 return prefix::MEGA;
252 }
253 else if(x == "k")
254 {
255 return prefix::KILO;
256 }
257 else if(x == "h")
258 {
259 return prefix::HECTO;
260 }
261 else if(x == "da")
262 {
263 return prefix::DECA;
264 }
265 else if(x == "d")
266 {
267 return prefix::DECI;
268 }
269 else if(x == "c")
270 {
271 return prefix::CENTI;
272 }
273 else if(x == "m")
274 {
275 return prefix::MILLI;
276 }
277 else if(x == "u" or x == "µ")
278 {
279 return prefix::MICRO;
280 }
281 else if(x == "n")
282 {
283 return prefix::NANO;
284 }
285 else if(x == "p")
286 {
287 return prefix::PICO;
288 }
289 else if(x == "f")
290 {
291 return prefix::FEMTO;
292 }
293 else if(x == "a")
294 {
295 return prefix::ATTO;
296 }
297 else if(x == "z")
298 {
299 return prefix::ZEPTO;
300 }
301 else if(x == "y")
302 {
303 return prefix::YOCTO;
304 }
305 else if(x == "r")
306 {
307 return prefix::RONTO;
308 }
309 else if(x == "q")
310 {
311 return prefix::QUECTO;
312 }
313 else if (x == "")
314 {
315 return prefix::NONE;
316 }
317 else
318 {
319 return prefix::NONE;
320 }
321 }

◆ radian_to_degree()

float scifir::radian_to_degree ( float  x)
inline

Converts a radian to degree.

Definition at line 16 of file angle.hpp.

17 {
18 return x * 180.0f / std::numbers::pi_v<float>;
19 }

◆ radian_to_gradian()

float scifir::radian_to_gradian ( float  x)
inline

Definition at line 51 of file angle.hpp.

52 {
53 return x * 200.0f / std::numbers::pi_v<float>;
54 }

◆ radian_to_turn()

float scifir::radian_to_turn ( float  x)
inline

Definition at line 66 of file angle.hpp.

67 {
68 return x / (2.0f * std::numbers::pi_v<float>);
69 }

◆ same_direction() [1/3]

bool scifir::same_direction ( const vector_unit_2d x,
const vector_unit_2d y 
)

Checks if two vectors x and y have the same direction.

Definition at line 374 of file vector_unit_2d.cpp.

375 {
376 return x.theta == y.theta;
377 }

◆ same_direction() [2/3]

bool scifir::same_direction ( const vector_unit_3d x,
const vector_unit_3d y 
)

Checks if two vectors x and y have the same direction.

Definition at line 501 of file vector_unit_3d.cpp.

502 {
503 if (x.theta == y.theta and x.phi == y.phi)
504 {
505 return true;
506 }
507 else
508 {
509 return false;
510 }
511 }

◆ same_direction() [3/3]

bool scifir::same_direction ( const vector_unit_nd x,
const vector_unit_nd y 
)

Checks if two vectors x and y have the same direction. Both vectors must have the same ND, otherwise it returns an empty vector_unit_nd instead.

Definition at line 860 of file vector_unit_nd.cpp.

861 {
862 if (same_nd(x,y))
863 {
864 for(unsigned int i = 0; i < x.angles.size(); i++)
865 {
866 if(x.angles[i] != y.angles[i])
867 {
868 return false;
869 }
870 }
871 return true;
872 }
873 return false;
874 }

◆ same_nd()

bool scifir::same_nd ( const vector_unit_nd x,
const vector_unit_nd y 
)

Checks if two vectors have the same number of dimensions.

Definition at line 848 of file vector_unit_nd.cpp.

849 {
850 if(x.angles.size() == y.angles.size())
851 {
852 return true;
853 }
854 else
855 {
856 return false;
857 }
858 }

◆ SCALAR_UNIT_CPP() [1/92]

scifir::SCALAR_UNIT_CPP ( absorbed_dose  ,
"Gy/s"   
)

◆ SCALAR_UNIT_CPP() [2/92]

scifir::SCALAR_UNIT_CPP ( action  ,
"kg*m2/s"   
)

◆ SCALAR_UNIT_CPP() [3/92]

scifir::SCALAR_UNIT_CPP ( amount_of_effect  ,
"IU"   
)

◆ SCALAR_UNIT_CPP() [4/92]

scifir::SCALAR_UNIT_CPP ( area  ,
"m2"   
)

◆ SCALAR_UNIT_CPP() [5/92]

scifir::SCALAR_UNIT_CPP ( area_density  ,
"g/m2"   
)

◆ SCALAR_UNIT_CPP() [6/92]

scifir::SCALAR_UNIT_CPP ( brain_memory  ,
"memo"   
)

◆ SCALAR_UNIT_CPP() [7/92]

scifir::SCALAR_UNIT_CPP ( capacitance  ,
"F"   
)

◆ SCALAR_UNIT_CPP() [8/92]

scifir::SCALAR_UNIT_CPP ( catalytic_activity  ,
"kat"   
)

◆ SCALAR_UNIT_CPP() [9/92]

scifir::SCALAR_UNIT_CPP ( catalytic_efficiency  ,
"m3/s*mol"   
)

◆ SCALAR_UNIT_CPP() [10/92]

scifir::SCALAR_UNIT_CPP ( charge  ,
"C"   
)

◆ SCALAR_UNIT_CPP() [11/92]

scifir::SCALAR_UNIT_CPP ( compressibility  ,
"m*s2/kg"   
)

◆ SCALAR_UNIT_CPP() [12/92]

scifir::SCALAR_UNIT_CPP ( curvature  ,
"1/m"   
)

◆ SCALAR_UNIT_CPP() [13/92]

scifir::SCALAR_UNIT_CPP ( density  ,
"g/m3"   
)

◆ SCALAR_UNIT_CPP() [14/92]

scifir::SCALAR_UNIT_CPP ( diffusion_coefficient  ,
"m2/s"   
)

◆ SCALAR_UNIT_CPP() [15/92]

scifir::SCALAR_UNIT_CPP ( dynamic_viscosity  ,
"g/m*s"   
)

◆ SCALAR_UNIT_CPP() [16/92]

scifir::SCALAR_UNIT_CPP ( electric_charge_density  ,
"C/m3"   
)

◆ SCALAR_UNIT_CPP() [17/92]

scifir::SCALAR_UNIT_CPP ( electric_conductance  ,
"S"   
)

◆ SCALAR_UNIT_CPP() [18/92]

scifir::SCALAR_UNIT_CPP ( electric_current  ,
"A"   
)

◆ SCALAR_UNIT_CPP() [19/92]

scifir::SCALAR_UNIT_CPP ( electric_current_density  ,
"A/m2"   
)

◆ SCALAR_UNIT_CPP() [20/92]

scifir::SCALAR_UNIT_CPP ( electrical_conductivity  ,
"S/m"   
)

◆ SCALAR_UNIT_CPP() [21/92]

scifir::SCALAR_UNIT_CPP ( electron_mobility  ,
"m2/V*s"   
)

◆ SCALAR_UNIT_CPP() [22/92]

scifir::SCALAR_UNIT_CPP ( energy  ,
"J"   
)

◆ SCALAR_UNIT_CPP() [23/92]

scifir::SCALAR_UNIT_CPP ( energy_density  ,
"g/m*s2"   
)

◆ SCALAR_UNIT_CPP() [24/92]

scifir::SCALAR_UNIT_CPP ( energy_flux_density  ,
"kg/s3"   
)

◆ SCALAR_UNIT_CPP() [25/92]

scifir::SCALAR_UNIT_CPP ( entropy  ,
"kg*m2/K*s2"   
)

◆ SCALAR_UNIT_CPP() [26/92]

scifir::SCALAR_UNIT_CPP ( frequency  ,
"Hz"   
)

◆ SCALAR_UNIT_CPP() [27/92]

scifir::SCALAR_UNIT_CPP ( frequency_drift  ,
"1/s2"   
)

◆ SCALAR_UNIT_CPP() [28/92]

scifir::SCALAR_UNIT_CPP ( fuel_efficiency  ,
"1/m2"   
)

◆ SCALAR_UNIT_CPP() [29/92]

scifir::SCALAR_UNIT_CPP ( heat_capacity  ,
"J/K"   
)

◆ SCALAR_UNIT_CPP() [30/92]

scifir::SCALAR_UNIT_CPP ( heat_flux_density  ,
"kg/s3"   
)

◆ SCALAR_UNIT_CPP() [31/92]

scifir::SCALAR_UNIT_CPP ( illuminance  ,
"lx"   
)

◆ SCALAR_UNIT_CPP() [32/92]

scifir::SCALAR_UNIT_CPP ( inductance  ,
"H"   
)

◆ SCALAR_UNIT_CPP() [33/92]

scifir::SCALAR_UNIT_CPP ( information_size  ,
"B"   
)

◆ SCALAR_UNIT_CPP() [34/92]

scifir::SCALAR_UNIT_CPP ( ionizing_radiation  ,
"Gy"   
)

◆ SCALAR_UNIT_CPP() [35/92]

scifir::SCALAR_UNIT_CPP ( length  ,
"m"   
)

◆ SCALAR_UNIT_CPP() [36/92]

scifir::SCALAR_UNIT_CPP ( light_intensity  ,
"cd"   
)

◆ SCALAR_UNIT_CPP() [37/92]

scifir::SCALAR_UNIT_CPP ( linear_charge_density  ,
"C/m"   
)

◆ SCALAR_UNIT_CPP() [38/92]

scifir::SCALAR_UNIT_CPP ( linear_mass_density  ,
"g/m"   
)

◆ SCALAR_UNIT_CPP() [39/92]

scifir::SCALAR_UNIT_CPP ( luminous_efficacy  ,
"lm/W"   
)

◆ SCALAR_UNIT_CPP() [40/92]

scifir::SCALAR_UNIT_CPP ( luminous_energy  ,
"lm*s"   
)

◆ SCALAR_UNIT_CPP() [41/92]

scifir::SCALAR_UNIT_CPP ( luminous_exposure  ,
"lx*s"   
)

◆ SCALAR_UNIT_CPP() [42/92]

scifir::SCALAR_UNIT_CPP ( luminous_flux  ,
"lm"   
)

◆ SCALAR_UNIT_CPP() [43/92]

scifir::SCALAR_UNIT_CPP ( magnetic_flux  ,
"Wb"   
)

◆ SCALAR_UNIT_CPP() [44/92]

scifir::SCALAR_UNIT_CPP ( magnetic_permeability  ,
"H/m"   
)

◆ SCALAR_UNIT_CPP() [45/92]

scifir::SCALAR_UNIT_CPP ( magnetic_reluctance  ,
"1/H"   
)

◆ SCALAR_UNIT_CPP() [46/92]

scifir::SCALAR_UNIT_CPP ( magnetic_rigidity  ,
"T*m"   
)

◆ SCALAR_UNIT_CPP() [47/92]

scifir::SCALAR_UNIT_CPP ( magnetic_susceptibility  ,
"m/H"   
)

◆ SCALAR_UNIT_CPP() [48/92]

scifir::SCALAR_UNIT_CPP ( magnetization  ,
"A/m"   
)

◆ SCALAR_UNIT_CPP() [49/92]

scifir::SCALAR_UNIT_CPP ( mass  ,
"g"   
)

◆ SCALAR_UNIT_CPP() [50/92]

scifir::SCALAR_UNIT_CPP ( mass_flow_rate  ,
"g/s"   
)

◆ SCALAR_UNIT_CPP() [51/92]

scifir::SCALAR_UNIT_CPP ( molality  ,
"mol/g"   
)

◆ SCALAR_UNIT_CPP() [52/92]

scifir::SCALAR_UNIT_CPP ( molar_conductivity  ,
"s3*A2/g*mol"   
)

◆ SCALAR_UNIT_CPP() [53/92]

scifir::SCALAR_UNIT_CPP ( molar_energy  ,
"m2*g/s2*mol"   
)

◆ SCALAR_UNIT_CPP() [54/92]

scifir::SCALAR_UNIT_CPP ( molar_enthalpy  ,
"m2*g/s2*mol"   
)

◆ SCALAR_UNIT_CPP() [55/92]

scifir::SCALAR_UNIT_CPP ( molar_entropy  ,
"m2*g/s2*K*mol"   
)

◆ SCALAR_UNIT_CPP() [56/92]

scifir::SCALAR_UNIT_CPP ( molar_heat_capacity  ,
"m2*g/s2*K*mol"   
)

◆ SCALAR_UNIT_CPP() [57/92]

scifir::SCALAR_UNIT_CPP ( molar_mass  ,
"g/mol"   
)

◆ SCALAR_UNIT_CPP() [58/92]

scifir::SCALAR_UNIT_CPP ( molar_volume  ,
"m3/mol"   
)

◆ SCALAR_UNIT_CPP() [59/92]

scifir::SCALAR_UNIT_CPP ( molarity  ,
"M"   
)

◆ SCALAR_UNIT_CPP() [60/92]

scifir::SCALAR_UNIT_CPP ( mole  ,
"mol"   
)

◆ SCALAR_UNIT_CPP() [61/92]

scifir::SCALAR_UNIT_CPP ( moment_of_inertia  ,
"m2*kg"   
)

◆ SCALAR_UNIT_CPP() [62/92]

scifir::SCALAR_UNIT_CPP ( optical_power  ,
"1/m"   
)

◆ SCALAR_UNIT_CPP() [63/92]

scifir::SCALAR_UNIT_CPP ( permittivity  ,
"F/m"   
)

◆ SCALAR_UNIT_CPP() [64/92]

scifir::SCALAR_UNIT_CPP ( polarization_density  ,
"C/m2"   
)

◆ SCALAR_UNIT_CPP() [65/92]

scifir::SCALAR_UNIT_CPP ( power  ,
"W"   
)

◆ SCALAR_UNIT_CPP() [66/92]

scifir::SCALAR_UNIT_CPP ( power_density  ,
"kg/m*s3"   
)

◆ SCALAR_UNIT_CPP() [67/92]

scifir::SCALAR_UNIT_CPP ( radiance  ,
"kg/s3"   
)

◆ SCALAR_UNIT_CPP() [68/92]

scifir::SCALAR_UNIT_CPP ( radiant_intensity  ,
"kg*m2/s3"   
)

◆ SCALAR_UNIT_CPP() [69/92]

scifir::SCALAR_UNIT_CPP ( radioactivity  ,
"Bq"   
)

◆ SCALAR_UNIT_CPP() [70/92]

scifir::SCALAR_UNIT_CPP ( resistance  ,
"Ω"   
)

◆ SCALAR_UNIT_CPP() [71/92]

scifir::SCALAR_UNIT_CPP ( resistivity  ,
"Ω*m"   
)

◆ SCALAR_UNIT_CPP() [72/92]

scifir::SCALAR_UNIT_CPP ( sound_power  ,
"dB"   
)

◆ SCALAR_UNIT_CPP() [73/92]

scifir::SCALAR_UNIT_CPP ( specific_energy  ,
"m2/s2"   
)

◆ SCALAR_UNIT_CPP() [74/92]

scifir::SCALAR_UNIT_CPP ( specific_entropy  ,
"m2/s2*K"   
)

◆ SCALAR_UNIT_CPP() [75/92]

scifir::SCALAR_UNIT_CPP ( specific_heat_capacity  ,
"J/K*kg"   
)

◆ SCALAR_UNIT_CPP() [76/92]

scifir::SCALAR_UNIT_CPP ( specific_volume  ,
"m3/g"   
)

◆ SCALAR_UNIT_CPP() [77/92]

scifir::SCALAR_UNIT_CPP ( spectral_radiance  ,
"kg/m*s3"   
)

◆ SCALAR_UNIT_CPP() [78/92]

scifir::SCALAR_UNIT_CPP ( stiffness  ,
"kg/s2"   
)

◆ SCALAR_UNIT_CPP() [79/92]

scifir::SCALAR_UNIT_CPP ( surface_charge_density  ,
"C/m2"   
)

◆ SCALAR_UNIT_CPP() [80/92]

scifir::SCALAR_UNIT_CPP ( temperature  ,
"K"   
)

◆ SCALAR_UNIT_CPP() [81/92]

scifir::SCALAR_UNIT_CPP ( thermal_conductivity  ,
"W/m*K"   
)

◆ SCALAR_UNIT_CPP() [82/92]

scifir::SCALAR_UNIT_CPP ( thermal_diffusivity  ,
"m2/s"   
)

◆ SCALAR_UNIT_CPP() [83/92]

scifir::SCALAR_UNIT_CPP ( thermal_expansion_coefficient  ,
"1/K"   
)

◆ SCALAR_UNIT_CPP() [84/92]

scifir::SCALAR_UNIT_CPP ( thermal_resistance  ,
"K/W"   
)

◆ SCALAR_UNIT_CPP() [85/92]

scifir::SCALAR_UNIT_CPP ( transfer_speed  ,
"B/s"   
)

◆ SCALAR_UNIT_CPP() [86/92]

scifir::SCALAR_UNIT_CPP ( viscosity  ,
"m2/s"   
)

◆ SCALAR_UNIT_CPP() [87/92]

scifir::SCALAR_UNIT_CPP ( voltage  ,
"V"   
)

◆ SCALAR_UNIT_CPP() [88/92]

scifir::SCALAR_UNIT_CPP ( volume  ,
"m3"   
)

◆ SCALAR_UNIT_CPP() [89/92]

scifir::SCALAR_UNIT_CPP ( volume_4d  ,
"m4"   
)

◆ SCALAR_UNIT_CPP() [90/92]

scifir::SCALAR_UNIT_CPP ( volume_charge_density  ,
"C/m3"   
)

◆ SCALAR_UNIT_CPP() [91/92]

scifir::SCALAR_UNIT_CPP ( volumetric_flow  ,
"m3/s"   
)

◆ SCALAR_UNIT_CPP() [92/92]

scifir::SCALAR_UNIT_CPP ( wavenumber  ,
"1/m"   
)

◆ SCALAR_UNIT_HPP() [1/88]

scifir::SCALAR_UNIT_HPP ( absorbed_dose  )

◆ SCALAR_UNIT_HPP() [2/88]

scifir::SCALAR_UNIT_HPP ( action  )

◆ SCALAR_UNIT_HPP() [3/88]

scifir::SCALAR_UNIT_HPP ( amount_of_effect  )

◆ SCALAR_UNIT_HPP() [4/88]

scifir::SCALAR_UNIT_HPP ( area_density  )

◆ SCALAR_UNIT_HPP() [5/88]

scifir::SCALAR_UNIT_HPP ( brain_memory  )

◆ SCALAR_UNIT_HPP() [6/88]

scifir::SCALAR_UNIT_HPP ( capacitance  )

◆ SCALAR_UNIT_HPP() [7/88]

scifir::SCALAR_UNIT_HPP ( catalytic_activity  )

◆ SCALAR_UNIT_HPP() [8/88]

scifir::SCALAR_UNIT_HPP ( catalytic_efficiency  )

◆ SCALAR_UNIT_HPP() [9/88]

scifir::SCALAR_UNIT_HPP ( charge  )

◆ SCALAR_UNIT_HPP() [10/88]

scifir::SCALAR_UNIT_HPP ( compressibility  )

◆ SCALAR_UNIT_HPP() [11/88]

scifir::SCALAR_UNIT_HPP ( curvature  )

◆ SCALAR_UNIT_HPP() [12/88]

scifir::SCALAR_UNIT_HPP ( density  )

◆ SCALAR_UNIT_HPP() [13/88]

scifir::SCALAR_UNIT_HPP ( diffusion_coefficient  )

◆ SCALAR_UNIT_HPP() [14/88]

scifir::SCALAR_UNIT_HPP ( dynamic_viscosity  )

◆ SCALAR_UNIT_HPP() [15/88]

scifir::SCALAR_UNIT_HPP ( electric_charge_density  )

◆ SCALAR_UNIT_HPP() [16/88]

scifir::SCALAR_UNIT_HPP ( electric_conductance  )

◆ SCALAR_UNIT_HPP() [17/88]

scifir::SCALAR_UNIT_HPP ( electric_current  )

◆ SCALAR_UNIT_HPP() [18/88]

scifir::SCALAR_UNIT_HPP ( electric_current_density  )

◆ SCALAR_UNIT_HPP() [19/88]

scifir::SCALAR_UNIT_HPP ( electrical_conductivity  )

◆ SCALAR_UNIT_HPP() [20/88]

scifir::SCALAR_UNIT_HPP ( electron_mobility  )

◆ SCALAR_UNIT_HPP() [21/88]

scifir::SCALAR_UNIT_HPP ( energy  )

◆ SCALAR_UNIT_HPP() [22/88]

scifir::SCALAR_UNIT_HPP ( energy_density  )

◆ SCALAR_UNIT_HPP() [23/88]

scifir::SCALAR_UNIT_HPP ( energy_flux_density  )

◆ SCALAR_UNIT_HPP() [24/88]

scifir::SCALAR_UNIT_HPP ( entropy  )

◆ SCALAR_UNIT_HPP() [25/88]

scifir::SCALAR_UNIT_HPP ( frequency  )

◆ SCALAR_UNIT_HPP() [26/88]

scifir::SCALAR_UNIT_HPP ( frequency_drift  )

◆ SCALAR_UNIT_HPP() [27/88]

scifir::SCALAR_UNIT_HPP ( fuel_efficiency  )

◆ SCALAR_UNIT_HPP() [28/88]

scifir::SCALAR_UNIT_HPP ( heat_capacity  )

◆ SCALAR_UNIT_HPP() [29/88]

scifir::SCALAR_UNIT_HPP ( heat_flux_density  )

◆ SCALAR_UNIT_HPP() [30/88]

scifir::SCALAR_UNIT_HPP ( illuminance  )

◆ SCALAR_UNIT_HPP() [31/88]

scifir::SCALAR_UNIT_HPP ( inductance  )

◆ SCALAR_UNIT_HPP() [32/88]

scifir::SCALAR_UNIT_HPP ( information_size  )

◆ SCALAR_UNIT_HPP() [33/88]

scifir::SCALAR_UNIT_HPP ( ionizing_radiation  )

◆ SCALAR_UNIT_HPP() [34/88]

scifir::SCALAR_UNIT_HPP ( length  )

◆ SCALAR_UNIT_HPP() [35/88]

scifir::SCALAR_UNIT_HPP ( light_intensity  )

◆ SCALAR_UNIT_HPP() [36/88]

scifir::SCALAR_UNIT_HPP ( linear_charge_density  )

◆ SCALAR_UNIT_HPP() [37/88]

scifir::SCALAR_UNIT_HPP ( linear_mass_density  )

◆ SCALAR_UNIT_HPP() [38/88]

scifir::SCALAR_UNIT_HPP ( luminous_efficacy  )

◆ SCALAR_UNIT_HPP() [39/88]

scifir::SCALAR_UNIT_HPP ( luminous_energy  )

◆ SCALAR_UNIT_HPP() [40/88]

scifir::SCALAR_UNIT_HPP ( luminous_exposure  )

◆ SCALAR_UNIT_HPP() [41/88]

scifir::SCALAR_UNIT_HPP ( luminous_flux  )

◆ SCALAR_UNIT_HPP() [42/88]

scifir::SCALAR_UNIT_HPP ( magnetic_flux  )

◆ SCALAR_UNIT_HPP() [43/88]

scifir::SCALAR_UNIT_HPP ( magnetic_permeability  )

◆ SCALAR_UNIT_HPP() [44/88]

scifir::SCALAR_UNIT_HPP ( magnetic_reluctance  )

◆ SCALAR_UNIT_HPP() [45/88]

scifir::SCALAR_UNIT_HPP ( magnetic_rigidity  )

◆ SCALAR_UNIT_HPP() [46/88]

scifir::SCALAR_UNIT_HPP ( magnetic_susceptibility  )

◆ SCALAR_UNIT_HPP() [47/88]

scifir::SCALAR_UNIT_HPP ( magnetization  )

◆ SCALAR_UNIT_HPP() [48/88]

scifir::SCALAR_UNIT_HPP ( mass_flow_rate  )

◆ SCALAR_UNIT_HPP() [49/88]

scifir::SCALAR_UNIT_HPP ( molality  )

◆ SCALAR_UNIT_HPP() [50/88]

scifir::SCALAR_UNIT_HPP ( molar_conductivity  )

◆ SCALAR_UNIT_HPP() [51/88]

scifir::SCALAR_UNIT_HPP ( molar_energy  )

◆ SCALAR_UNIT_HPP() [52/88]

scifir::SCALAR_UNIT_HPP ( molar_enthalpy  )

◆ SCALAR_UNIT_HPP() [53/88]

scifir::SCALAR_UNIT_HPP ( molar_entropy  )

◆ SCALAR_UNIT_HPP() [54/88]

scifir::SCALAR_UNIT_HPP ( molar_heat_capacity  )

◆ SCALAR_UNIT_HPP() [55/88]

scifir::SCALAR_UNIT_HPP ( molar_mass  )

◆ SCALAR_UNIT_HPP() [56/88]

scifir::SCALAR_UNIT_HPP ( molar_volume  )

◆ SCALAR_UNIT_HPP() [57/88]

scifir::SCALAR_UNIT_HPP ( molarity  )

◆ SCALAR_UNIT_HPP() [58/88]

scifir::SCALAR_UNIT_HPP ( moment_of_inertia  )

◆ SCALAR_UNIT_HPP() [59/88]

scifir::SCALAR_UNIT_HPP ( optical_power  )

◆ SCALAR_UNIT_HPP() [60/88]

scifir::SCALAR_UNIT_HPP ( permittivity  )

◆ SCALAR_UNIT_HPP() [61/88]

scifir::SCALAR_UNIT_HPP ( polarization_density  )

◆ SCALAR_UNIT_HPP() [62/88]

scifir::SCALAR_UNIT_HPP ( power  )

◆ SCALAR_UNIT_HPP() [63/88]

scifir::SCALAR_UNIT_HPP ( power_density  )

◆ SCALAR_UNIT_HPP() [64/88]

scifir::SCALAR_UNIT_HPP ( radiance  )

◆ SCALAR_UNIT_HPP() [65/88]

scifir::SCALAR_UNIT_HPP ( radiant_intensity  )

◆ SCALAR_UNIT_HPP() [66/88]

scifir::SCALAR_UNIT_HPP ( radioactivity  )

◆ SCALAR_UNIT_HPP() [67/88]

scifir::SCALAR_UNIT_HPP ( resistance  )

◆ SCALAR_UNIT_HPP() [68/88]

scifir::SCALAR_UNIT_HPP ( resistivity  )

◆ SCALAR_UNIT_HPP() [69/88]

scifir::SCALAR_UNIT_HPP ( sound_power  )

◆ SCALAR_UNIT_HPP() [70/88]

scifir::SCALAR_UNIT_HPP ( specific_energy  )

◆ SCALAR_UNIT_HPP() [71/88]

scifir::SCALAR_UNIT_HPP ( specific_entropy  )

◆ SCALAR_UNIT_HPP() [72/88]

scifir::SCALAR_UNIT_HPP ( specific_heat_capacity  )

◆ SCALAR_UNIT_HPP() [73/88]

scifir::SCALAR_UNIT_HPP ( specific_volume  )

◆ SCALAR_UNIT_HPP() [74/88]

scifir::SCALAR_UNIT_HPP ( spectral_radiance  )

◆ SCALAR_UNIT_HPP() [75/88]

scifir::SCALAR_UNIT_HPP ( stiffness  )

◆ SCALAR_UNIT_HPP() [76/88]

scifir::SCALAR_UNIT_HPP ( surface_charge_density  )

◆ SCALAR_UNIT_HPP() [77/88]

scifir::SCALAR_UNIT_HPP ( temperature  )

◆ SCALAR_UNIT_HPP() [78/88]

scifir::SCALAR_UNIT_HPP ( thermal_conductivity  )

◆ SCALAR_UNIT_HPP() [79/88]

scifir::SCALAR_UNIT_HPP ( thermal_diffusivity  )

◆ SCALAR_UNIT_HPP() [80/88]

scifir::SCALAR_UNIT_HPP ( thermal_expansion_coefficient  )

◆ SCALAR_UNIT_HPP() [81/88]

scifir::SCALAR_UNIT_HPP ( thermal_resistance  )

◆ SCALAR_UNIT_HPP() [82/88]

scifir::SCALAR_UNIT_HPP ( transfer_speed  )

◆ SCALAR_UNIT_HPP() [83/88]

scifir::SCALAR_UNIT_HPP ( viscosity  )

◆ SCALAR_UNIT_HPP() [84/88]

scifir::SCALAR_UNIT_HPP ( voltage  )

◆ SCALAR_UNIT_HPP() [85/88]

scifir::SCALAR_UNIT_HPP ( volume_4d  )

◆ SCALAR_UNIT_HPP() [86/88]

scifir::SCALAR_UNIT_HPP ( volume_charge_density  )

◆ SCALAR_UNIT_HPP() [87/88]

scifir::SCALAR_UNIT_HPP ( volumetric_flow  )

◆ SCALAR_UNIT_HPP() [88/88]

scifir::SCALAR_UNIT_HPP ( wavenumber  )

◆ SCALAR_UNIT_HPP_BEGIN() [1/4]

scifir::SCALAR_UNIT_HPP_BEGIN ( area  )

◆ SCALAR_UNIT_HPP_BEGIN() [2/4]

scifir::SCALAR_UNIT_HPP_BEGIN ( mass  )

◆ SCALAR_UNIT_HPP_BEGIN() [3/4]

scifir::SCALAR_UNIT_HPP_BEGIN ( mole  )

◆ SCALAR_UNIT_HPP_BEGIN() [4/4]

scifir::SCALAR_UNIT_HPP_BEGIN ( volume  )

◆ SCALAR_UNIT_HPP_END()

scifir::SCALAR_UNIT_HPP_END ( )

◆ sin()

float scifir::sin ( const angle x)

Calculates the sin of angle x. It uses the sin() function of the standard library of C++, the difference is that angle is in degrees, not in radians.

Definition at line 426 of file angle.cpp.

427 {
428 return std::sin(x.get_radian());
429 }

◆ sinh()

float scifir::sinh ( const angle x)

Calculates the sinh of angle x. It uses the sinh() function of the standard library of C++, the difference is that angle is in degrees, not in radians.

Definition at line 461 of file angle.cpp.

462 {
463 return std::sinh(x.get_radian());
464 }

◆ spherical_to_cartesian_3d_x() [1/2]

scalar_unit scifir::spherical_to_cartesian_3d_x ( const scalar_unit r,
const angle theta,
const angle phi 
)
inline

Returns the x coordinate of the cartesian coordinates in 3D given the r, theta and phi of spherical coordinates.

Definition at line 763 of file coordinates_3d.hpp.

764 {
765 return r * scifir::cos(theta) * scifir::sin(phi);
766 }

◆ spherical_to_cartesian_3d_x() [2/2]

float scifir::spherical_to_cartesian_3d_x ( float  r,
const angle theta,
const angle phi 
)
inline

Returns the x coordinate of the cartesian coordinates in 3D given the r, theta and phi of spherical coordinates.

Definition at line 855 of file coordinates_3d.hpp.

856 {
857 return r * scifir::cos(theta) * scifir::sin(phi);
858 }

◆ spherical_to_cartesian_3d_y() [1/2]

scalar_unit scifir::spherical_to_cartesian_3d_y ( const scalar_unit r,
const angle theta,
const angle phi 
)
inline

Returns the y coordinate of the cartesian coordinates in 3D given the r, theta and phi of spherical coordinates.

Definition at line 768 of file coordinates_3d.hpp.

769 {
770 return r * scifir::sin(theta) * scifir::sin(phi);
771 }

◆ spherical_to_cartesian_3d_y() [2/2]

float scifir::spherical_to_cartesian_3d_y ( float  r,
const angle theta,
const angle phi 
)
inline

Returns the y coordinate of the cartesian coordinates in 3D given the r, theta and phi of spherical coordinates.

Definition at line 860 of file coordinates_3d.hpp.

861 {
862 return r * scifir::sin(theta) * scifir::sin(phi);
863 }

◆ spherical_to_cartesian_3d_z() [1/2]

scalar_unit scifir::spherical_to_cartesian_3d_z ( const scalar_unit r,
const angle theta,
const angle phi 
)
inline

Returns the z coordinate of the cartesian coordinates in 3D given the r, theta and phi of spherical coordinates.

Definition at line 773 of file coordinates_3d.hpp.

774 {
775 return r * scifir::cos(phi);
776 }

◆ spherical_to_cartesian_3d_z() [2/2]

float scifir::spherical_to_cartesian_3d_z ( float  r,
const angle theta,
const angle phi 
)
inline

Returns the z coordinate of the cartesian coordinates in 3D given the r, theta and phi of spherical coordinates.

Definition at line 865 of file coordinates_3d.hpp.

866 {
867 return r * scifir::cos(phi);
868 }

◆ spherical_to_cylindrical_p() [1/2]

scalar_unit scifir::spherical_to_cylindrical_p ( const scalar_unit r,
const angle theta,
const angle phi 
)
inline

Returns the p coordinate of the cylindrical coordinates given the r, theta and phi of spherical coordinates.

Definition at line 778 of file coordinates_3d.hpp.

779 {
780 return r * scifir::sin(phi);
781 }

◆ spherical_to_cylindrical_p() [2/2]

float scifir::spherical_to_cylindrical_p ( float  r,
const angle theta,
const angle phi 
)
inline

Returns the p coordinate of the cylindrical coordinates given the r, theta and phi of spherical coordinates.

Definition at line 870 of file coordinates_3d.hpp.

871 {
872 return r * scifir::sin(phi);
873 }

◆ spherical_to_cylindrical_theta() [1/2]

angle scifir::spherical_to_cylindrical_theta ( const scalar_unit r,
const angle theta,
const angle phi 
)
inline

Returns the theta coordinate of the cylindrical coordinates given the r, theta and phi of spherical coordinates.

Definition at line 783 of file coordinates_3d.hpp.

784 {
785 return theta;
786 }

◆ spherical_to_cylindrical_theta() [2/2]

angle scifir::spherical_to_cylindrical_theta ( float  r,
const angle theta,
const angle phi 
)
inline

Returns the theta coordinate of the cylindrical coordinates given the r, theta and phi of spherical coordinates.

Definition at line 875 of file coordinates_3d.hpp.

876 {
877 return theta;
878 }

◆ spherical_to_cylindrical_z() [1/2]

scalar_unit scifir::spherical_to_cylindrical_z ( const scalar_unit r,
const angle theta,
const angle phi 
)
inline

Returns the z coordinate of the cylindrical coordinates given the r, theta and phi of spherical coordinates.

Definition at line 788 of file coordinates_3d.hpp.

789 {
790 return r * scifir::cos(phi);
791 }

◆ spherical_to_cylindrical_z() [2/2]

float scifir::spherical_to_cylindrical_z ( float  r,
const angle theta,
const angle phi 
)
inline

Returns the z coordinate of the cylindrical coordinates given the r, theta and phi of spherical coordinates.

Definition at line 880 of file coordinates_3d.hpp.

881 {
882 return r * scifir::cos(phi);
883 }

◆ sqrt() [1/7]

angle scifir::sqrt ( const angle x)

Calculates the square root of the angle x and returns that new angle.

Definition at line 416 of file angle.cpp.

417 {
418 return angle(std::sqrt(x.get_value()));
419 }
const float & get_value() const
Gets the value of the angle, in degrees.
Definition angle.hpp:102

◆ sqrt() [2/7]

template<typename T >
complex_number< scalar_unit > scifir::sqrt ( const complex_number< T > &  x)

Definition at line 192 of file complex_number.hpp.

193 {
194 int sgn_value;
195 if (x.imaginary > 0)
196 {
197 sgn_value = 1;
198 }
199 else if (x.imaginary < 0)
200 {
201 sgn_value = -1;
202 }
203 else
204 {
205 sgn_value = 0;
206 }
207 scalar_unit new_real = scifir::sqrt(x.real + scifir::sqrt((x.real^2) + (x.imaginary^2)));
208 scalar_unit new_imaginary = sgn_value * scifir::sqrt(((-1) * x.real + scifir::sqrt((x.real^2) + (x.imaginary^2))) / 2);
209 return complex_number<scalar_unit>(new_real,new_imaginary);
210 }

◆ sqrt() [3/7]

pixel scifir::sqrt ( const pixel x)

Definition at line 238 of file pixel.cpp.

239 {
240 return pixel(std::sqrt(x.get_value()));
241 }
const float & get_value() const
Definition pixel.hpp:41

◆ sqrt() [4/7]

scalar_unit scifir::sqrt ( const scalar_unit x)

Square root of a scalar_unit, it squares the dimensions too.

Definition at line 947 of file scalar_unit.cpp.

948 {
949 long double new_value = x.get_value();
951 new_value = std::sqrt(new_value);
953 }
vector< dimension > square_dimensions(vector< dimension > x, int index, long double &value)
Squares a vector of dimensions by an index. The value is updated too related to the prefix math and t...

◆ sqrt() [5/7]

vector_unit_2d scifir::sqrt ( const vector_unit_2d x)

It squares the vector, creating a vector_unit_2d with the value squared and always the same theta. The dimensions are squared with the same rules for the square of dimensions than scalar_unit classes.

Definition at line 350 of file vector_unit_2d.cpp.

351 {
353 return vector_unit_2d(new_value, x.theta);
354 }
Class that creates a vector unit in 2D. The vector is in polar coordinates with a value and dimension...

◆ sqrt() [6/7]

vector_unit_3d scifir::sqrt ( const vector_unit_3d x)

It squares the vector, creating a vector_unit_3d with the value squared and always the same theta and the same phi. The dimensions are squared with the same rules for the square of dimensions than scalar_unit classes.

Definition at line 455 of file vector_unit_3d.cpp.

456 {
458 return vector_unit_3d(new_value, x.theta, x.phi);
459 }
Class that creates a vector unit in 3D. The vector is in spherical coordinates with a value and dimen...

◆ sqrt() [7/7]

vector_unit_nd scifir::sqrt ( const vector_unit_nd x)

It squares the vector, creating a vector_unit_nd with the value squared and always the same angles. The dimensions are squared with the same rules for the square of dimensions than scalar_unit classes.

Definition at line 791 of file vector_unit_nd.cpp.

792 {
795 }
Class that creates a vector in ND, which means a variable number of dimensions. A vector_unit_nd can ...

◆ sqrt_nth() [1/6]

angle scifir::sqrt_nth ( const angle x,
int  index 
)

Calculates the nth root of the angle x and returns that new angle.

Definition at line 421 of file angle.cpp.

422 {
423 return angle(std::pow(x.get_value(), float(1.0f / index)));
424 }

◆ sqrt_nth() [2/6]

pixel scifir::sqrt_nth ( const pixel x,
int  index 
)

Definition at line 243 of file pixel.cpp.

244 {
245 return pixel(std::pow(x.get_value(), 1.0f / index));
246 }

◆ sqrt_nth() [3/6]

scalar_unit scifir::sqrt_nth ( const scalar_unit x,
int  index 
)

Nth root of a scalar_unit to any numeric value, it squares the dimensions too.

Definition at line 955 of file scalar_unit.cpp.

956 {
957 long double new_value = x.get_value();
959 new_value = std::pow(new_value, 1.0f / index);
961 }

◆ sqrt_nth() [4/6]

vector_unit_2d scifir::sqrt_nth ( const vector_unit_2d x,
int  index 
)

It takes the root of the vector with the index given, creating a vector_unit_2d with the value rooted to that index and always maintains the same theta. The dimensions are squared with the same rules for the square of dimensions than scalar_unit classes.

Definition at line 356 of file vector_unit_2d.cpp.

357 {
359 return vector_unit_2d(new_value, x.theta);
360 }
angle sqrt_nth(const angle &x, int index)
Calculates the nth root of the angle x and returns that new angle.
Definition angle.cpp:421

◆ sqrt_nth() [5/6]

vector_unit_3d scifir::sqrt_nth ( const vector_unit_3d x,
int  index 
)

It takes the root of the vector with the index given, creating a vector_unit_3d with the value rooted to that index and always maintains the same theta and the same phi. The dimensions are squared with the same rules for the square of dimensions than scalar_unit classes.

Definition at line 461 of file vector_unit_3d.cpp.

462 {
464 return vector_unit_3d(new_value, x.theta, x.phi);
465 }

◆ sqrt_nth() [6/6]

vector_unit_nd scifir::sqrt_nth ( const vector_unit_nd x,
int  index 
)

It takes the root of the vector with the index given, creating a vector_unit_nd with the value rooted to that index and always maintains the same angles. The dimensions are squared with the same rules for the square of dimensions than scalar_unit classes.

Definition at line 797 of file vector_unit_nd.cpp.

798 {
801 }

◆ square_dimensions()

vector< dimension > scifir::square_dimensions ( vector< dimension x,
int  index,
long double value 
)

Squares a vector of dimensions by an index. The value is updated too related to the prefix math and the conversion factor of this operation.

Definition at line 2118 of file dimension.cpp.

2119 {
2121 for (const dimension& x_dimension : x)
2122 {
2123 dimensions_count[x_dimension.dimension_type]++;
2124 }
2125 for (const auto& x_count : dimensions_count)
2126 {
2127 if ((x_count.second % index) != 0)
2128 {
2129 return vector<dimension>();
2130 }
2131 }
2132 vector<dimension> new_dimensions = vector<dimension>();
2133 if (dimensions_count.size() == 1) // If there's only one type of dimension, square it and conserve its type
2134 {
2135 for (int i = 0; i < dimensions_count[x[0].dimension_type]; i++)
2136 {
2137 if (x[i].dimension_position == dimension::NUMERATOR)
2138 {
2139 value *= x[i].get_conversion_factor();
2140 value *= x[i].prefix_math();
2141 }
2142 else if (x[i].dimension_position == dimension::DENOMINATOR)
2143 {
2144 value /= x[i].get_conversion_factor();
2145 value /= x[i].prefix_math();
2146 }
2147 }
2148 int total_dimensions = int(std::pow(dimensions_count[x[0].dimension_type], 1.0f / index));
2149 x[0].prefix.prefix_type = prefix::NONE;
2150 for (int j = 0; j < total_dimensions; j++)
2151 {
2152 new_dimensions.push_back(x[0]);
2153 }
2154 return new_dimensions;
2155 }
2156 else // If there's more than one type of dimension, creates the simple dimensions of them, and squares the total. If there are special names, they are changed by their simple dimensions
2157 {
2158 x = normalize_dimensions(x,value);
2159 vector<dimension::type> counted_dimensions = vector<dimension::type>();
2160 dimensions_count.clear();
2161 for (const dimension& x_dimension : x)
2162 {
2163 dimensions_count[x_dimension.dimension_type]++;
2164 }
2165 for (const dimension& x_dimension : x)
2166 {
2167 bool counted = false;
2168 for (const dimension::type& counted_dimension : counted_dimensions)
2169 {
2170 if (counted_dimension == x_dimension.dimension_type)
2171 {
2172 counted = true;
2173 }
2174 }
2175 if (counted == true)
2176 {
2177 continue;
2178 }
2179 int total_dimensions = int(std::pow(dimensions_count[x_dimension.dimension_type], 1.0f / index));
2180 for (int j = 0; j < total_dimensions; j++)
2181 {
2182 new_dimensions.push_back(x_dimension);
2183 }
2184 counted_dimensions.push_back(x_dimension.dimension_type);
2185 }
2186 }
2187 return new_dimensions;
2188 }
vector< dimension > normalize_dimensions(const vector< dimension > &x)
Normalizes the dimensions, which means that repited dimensions at the numerator and at the denominato...

◆ tan()

float scifir::tan ( const angle x)

Calculates the tan of angle x. It uses the tan() function of the standard library of C++, the difference is that angle is in degrees, not in radians.

Definition at line 436 of file angle.cpp.

437 {
438 return std::tan(x.get_radian());
439 }

◆ tanh()

float scifir::tanh ( const angle x)

Calculates the tanh of angle x. It uses the tanh() function of the standard library of C++, the difference is that angle is in degrees, not in radians.

Definition at line 471 of file angle.cpp.

472 {
473 return std::tanh(x.get_radian());
474 }

◆ to_latex()

string scifir::to_latex ( const vector< dimension > &  x_dimensions,
bool  with_brackets 
)

Definition at line 1782 of file dimension.cpp.

1783 {
1785 bool is_fraction = false;
1786 if (x_dimensions.size() > 0)
1787 {
1790 bool first_print = true;
1791 for (const dimension& x_dimension : x_dimensions)
1792 {
1793 if (x_dimension.dimension_position == dimension::NUMERATOR)
1794 {
1795 bool printed = false;
1797 {
1798 if (print_dimension == x_dimension.dimension_type)
1799 {
1800 printed = true;
1801 }
1802 }
1803 if (printed == true)
1804 {
1805 continue;
1806 }
1807 counted_prefixes = map<prefix,int>();
1808 for (const dimension& y_dimension : x_dimensions)
1809 {
1810 if (x_dimension.dimension_type == y_dimension.dimension_type)
1811 {
1812 counted_prefixes[y_dimension.prefix]++;
1813 }
1814 }
1815 for (const auto& x_prefix : counted_prefixes)
1816 {
1817 if (!first_print)
1818 {
1819 out << "*";
1820 }
1821 out << x_prefix.first << x_dimension.get_symbol();
1822 if (x_prefix.second > 1)
1823 {
1824 out << "^" << x_prefix.second;
1825 }
1826 first_print = false;
1827 }
1828 printed_dimensions.push_back(x_dimension.dimension_type);
1829 }
1830 }
1831 printed_dimensions.clear();
1832 bool first_negative_iteration = true;
1833 bool first_negative_prefix = true;
1834 for (const dimension& x_dimension : x_dimensions)
1835 {
1836 if (x_dimension.dimension_position == dimension::DENOMINATOR)
1837 {
1838 is_fraction = true;
1839 if (first_negative_iteration == true)
1840 {
1841 if (first_print)
1842 {
1843 out << "1";
1844 }
1845 out << "}{";
1846 first_negative_iteration = false;
1847 }
1848 bool printed = false;
1849 for (const dimension::type& print_dimension : printed_dimensions)
1850 {
1851 if (print_dimension == x_dimension.dimension_type)
1852 {
1853 printed = true;
1854 }
1855 }
1856 if (printed == true)
1857 {
1858 continue;
1859 }
1860 counted_prefixes = map<prefix,int>();
1861 for (const dimension& y_dimension : x_dimensions)
1862 {
1863 if (x_dimension.dimension_type == y_dimension.dimension_type)
1864 {
1865 counted_prefixes[y_dimension.prefix]++;
1866 }
1867 }
1868 for (const auto& x_prefix : counted_prefixes)
1869 {
1870 if (first_negative_prefix == false)
1871 {
1872 out << "*";
1873 }
1874 out << x_prefix.first << x_dimension.get_symbol();
1875 if (x_prefix.second > 1)
1876 {
1877 out << "^" << x_prefix.second;
1878 }
1879 first_negative_prefix = false;
1880 }
1881 printed_dimensions.push_back(x_dimension.dimension_type);
1882 }
1883 }
1884 if (is_fraction)
1885 {
1886 out << "}";
1887 }
1888 if (with_brackets)
1889 {
1890 out << "]";
1891 }
1892 }
1893 else
1894 {
1895 out << "[empty]";
1896 }
1897 if (is_fraction)
1898 {
1899 if (with_brackets)
1900 {
1901 return "[\frac{" + out.str();
1902 }
1903 else
1904 {
1905 return "\frac{" + out.str();
1906 }
1907 }
1908 else
1909 {
1910 if (with_brackets)
1911 {
1912 return "[" + out.str();
1913 }
1914 else
1915 {
1916 return out.str();
1917 }
1918 }
1919 }
type
Represents a dimension of the SI system of units. All the dimensions of the SI system of units are su...
Definition dimension.hpp:34

◆ to_string() [1/38]

string scifir::to_string ( cardinale_point  x)

Definition at line 7 of file coordinates_3d.cpp.

8 {
9 switch(x)
10 {
11 case cardinale_point::NORTH:
12 return "NORTH";
13 case cardinale_point::SOUTH:
14 return "SOUTH";
15 case cardinale_point::EAST:
16 return "EAST";
17 case cardinale_point::WEST:
18 return "WEST";
19 }
20 return "";
21 }

◆ to_string() [2/38]

string scifir::to_string ( const aid x)

Creates a string representation of aid, it's for aid equivalent to the display() function of aid.

Definition at line 582 of file aid.cpp.

583 {
584 return x.display();
585 }
string display() const
Returns a string representation of aid.
Definition aid.cpp:540

◆ to_string() [3/38]

string scifir::to_string ( const aid::type x)

Converts a value of the enum aid::type to its string representation, which can be a single or a pair of letters. The value UNIVERSE returns U. The value GALAXY returns G. The value SOLAR_SYSTEM returns SS. The value PLANET returns P. The value STAR returns ST. The value ASTEROID returns A. The value MOON returns MN. The value METEOR returns MT. The value NONE returns an empty string.

Definition at line 587 of file aid.cpp.

588 {
589 switch (x)
590 {
591 case aid::UNIVERSE:
592 return "U";
593 case aid::GALAXY:
594 return "G";
595 case aid::SOLAR_SYSTEM:
596 return "SS";
597 case aid::PLANET:
598 return "P";
599 case aid::STAR:
600 return "ST";
601 case aid::ASTEROID:
602 return "A";
603 case aid::MOON:
604 return "MN";
605 case aid::METEOR:
606 return "MT";
607 case aid::NONE:
608 return "";
609 }
610 return "";
611 }

◆ to_string() [4/38]

string scifir::to_string ( const angle x)

Converts an angle to their string representation.

Definition at line 331 of file angle.cpp.

332 {
333 return x.display(2);
334 }
string display(int number_of_decimals=2) const
Creates an string from the angle, with the value and the degrees symbol.
Definition angle.cpp:261

◆ to_string() [5/38]

template<typename T >
string scifir::to_string ( const complex_number< T > &  x)

Definition at line 178 of file complex_number.hpp.

179 {
180 return x.display(2);
181 }

◆ to_string() [6/38]

string scifir::to_string ( const coordinates_1d< float > &  x)

Definition at line 8 of file coordinates_1d.cpp.

9 {
10 return x.display_cartesian();
11 }

◆ to_string() [7/38]

template<typename T >
string scifir::to_string ( const coordinates_1d< T > &  x)

Definition at line 183 of file coordinates_1d.hpp.

184 {
185 return x.display_cartesian();
186 }
string display_cartesian() const

◆ to_string() [8/38]

string scifir::to_string ( const coordinates_2d< float > &  x)

Definition at line 9 of file coordinates_2d.cpp.

10 {
11 return x.display_cartesian();
12 }

◆ to_string() [9/38]

template<typename T >
string scifir::to_string ( const coordinates_2d< T > &  x)

Definition at line 339 of file coordinates_2d.hpp.

340 {
341 return x.display_cartesian();
342 }

◆ to_string() [10/38]

string scifir::to_string ( const coordinates_2dr< float > &  x)

Definition at line 7 of file coordinates_2dr.cpp.

8 {
9 return x.display_cartesian();
10 }

◆ to_string() [11/38]

template<typename T >
string scifir::to_string ( const coordinates_2dr< T > &  x)

Definition at line 456 of file coordinates_2dr.hpp.

457 {
458 return x.display_cartesian();
459 }

◆ to_string() [12/38]

string scifir::to_string ( const coordinates_3d< float > &  x)

Returns the string representation of coordinates_3d<float>.

Definition at line 23 of file coordinates_3d.cpp.

24 {
25 return x.display_cartesian();
26 }
string display_cartesian() const
Displays the coordinates in cartesian coordinates.

◆ to_string() [13/38]

template<typename T >
string scifir::to_string ( const coordinates_3d< T > &  x)

Returns the string representation of coordinates_3d.

Definition at line 709 of file coordinates_3d.hpp.

710 {
711 return x.display_cartesian();
712 }

◆ to_string() [14/38]

string scifir::to_string ( const coordinates_3dr< float > &  x)

Definition at line 7 of file coordinates_3dr.cpp.

8 {
9 return x.display_cartesian();
10 }

◆ to_string() [15/38]

template<typename T >
string scifir::to_string ( const coordinates_3dr< T > &  x)

Definition at line 900 of file coordinates_3dr.hpp.

901 {
902 return x.display_cartesian();
903 }

◆ to_string() [16/38]

string scifir::to_string ( const coordinates_nd< float > &  x)

Definition at line 7 of file coordinates_nd.cpp.

8 {
9 if (x.values.size() > 0)
10 {
12 out << "(";
13 for (int i = 0; i < x.values.size(); i++)
14 {
16 if ((i + 1) != x.values.size())
17 {
18 out << ",";
19 }
20 }
21 out << ")";
22 return out.str();
23 }
24 else
25 {
26 return "[empty]";
27 }
28 }
string display_float(const float &value, int number_of_decimals)
Definition types.cpp:36

◆ to_string() [17/38]

template<typename T >
string scifir::to_string ( const coordinates_nd< T > &  x)

Definition at line 1134 of file coordinates_nd.hpp.

1135 {
1136 if (x.values.size() > 0)
1137 {
1139 out << "(";
1140 for (int i = 0; i < x.values.size(); i++)
1141 {
1142 out << x.values[i];
1143 if ((i + 1) != x.values.size())
1144 {
1145 out << ",";
1146 }
1147 }
1148 out << ")";
1149 return out.str();
1150 }
1151 else
1152 {
1153 return "[empty]";
1154 }
1155 }

◆ to_string() [18/38]

string scifir::to_string ( const coordinates_ndr< float > &  x)

Definition at line 10 of file coordinates_ndr.cpp.

11 {
12 if (x.get_values().size() > 0)
13 {
15 out << "(";
16 if (x.get_values().size() > 0)
17 {
18 for (int i = 0; i < x.get_values().size(); i++)
19 {
21 if ((i + 1) != x.get_values().size())
22 {
23 out << ",";
24 }
25 }
26 }
27 if (x.get_angles().size() > 0)
28 {
29 out << ";";
30 for (int i = 0; i < x.get_angles().size(); i++)
31 {
32 out << x.get_angle(i);
33 if ((i + 1) != x.get_angles().size())
34 {
35 out << ",";
36 }
37 }
38 }
39 out << ")";
40 return out.str();
41 }
42 else
43 {
44 return "[empty]";
45 }
46 }
const angle & get_angle(unsigned int i) const
const vector< angle > & get_angles() const

◆ to_string() [19/38]

template<typename T >
string scifir::to_string ( const coordinates_ndr< T > &  x)

Definition at line 2150 of file coordinates_ndr.hpp.

2151 {
2152 if (x.get_values().size() > 0)
2153 {
2155 out << "(";
2156 if (x.get_values().size() > 0)
2157 {
2158 for (int i = 0; i < x.get_values().size(); i++)
2159 {
2160 out << x.get_value(i);
2161 if ((i + 1) != x.get_values().size())
2162 {
2163 out << ",";
2164 }
2165 }
2166 }
2167 if (x.get_angles().size() > 0)
2168 {
2169 out << ";";
2170 for (int i = 0; i < x.get_angles().size(); i++)
2171 {
2172 out << x.get_angle(i);
2173 if ((i + 1) != x.get_angles().size())
2174 {
2175 out << ",";
2176 }
2177 }
2178 }
2179 out << ")";
2180 return out.str();
2181 }
2182 else
2183 {
2184 return "[empty]";
2185 }
2186 }

◆ to_string() [20/38]

string scifir::to_string ( const dimension x)

Creates the string representation of a dimension.

Definition at line 1659 of file dimension.cpp.

1660 {
1662 out << x.prefix << x.get_symbol();
1663 return out.str();
1664 }
scifir::prefix prefix
The prefix of the dimension. It's used along with the symbol of the dimension when printing it.
Definition dimension.hpp:74
string get_symbol() const
Returns the symbol of the dimension. In the case of a custom dimension, it returns the custom dimensi...

◆ to_string() [21/38]

string scifir::to_string ( const direction x)

Definition at line 341 of file direction.cpp.

342 {
343 return to_string(x.value);
344 }
direction::name value
Definition direction.hpp:32
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

◆ to_string() [22/38]

template<typename T >
string scifir::to_string ( const lab_number< T > &  x)

Definition at line 114 of file lab_number.hpp.

115 {
116 return x.display(2);
117 }

◆ to_string() [23/38]

string scifir::to_string ( const percentage x)

Returns a string representation of percentage x.

Definition at line 483 of file percentage.cpp.

484 {
485 return x.display_percentage();
486 }
string display_percentage(int number_of_decimals=2) const
Displays the percentage as normal percentage, with the % symbol.

◆ to_string() [24/38]

string scifir::to_string ( const pixel x)

Definition at line 196 of file pixel.cpp.

197 {
198 return x.display();
199 }
string display(int number_of_decimals=2) const
Definition pixel.cpp:173

◆ to_string() [25/38]

string scifir::to_string ( const scalar_unit x)

Generates a string representation of the scalar_unit, it uses the display of the scalar_unit with 2 decimals, without brackets and without a close prefix.

Parameters
xscalar_unit to generate the string.

Definition at line 740 of file scalar_unit.cpp.

741 {
742 return x.display(2);
743 }
string display(int number_of_decimals=2, bool with_brackets=false, bool use_close_prefix=false) const
Generates a string representation of the scalar_unit, with the value and the dimensions....

◆ to_string() [26/38]

string scifir::to_string ( const size_2d< float > &  x)

Returns a string representation of size_2d<float>.

Definition at line 7 of file size_2d.cpp.

8 {
9 return x.display();
10 }
string display() const
Returns a string representation of size_2d<float>, with his width and height.
Definition size_2d.hpp:186

◆ to_string() [27/38]

template<typename T >
string scifir::to_string ( const size_2d< T > &  x)

Returns a string representation of size_2d<T>.

Definition at line 212 of file size_2d.hpp.

213 {
214 return x.display();
215 }

◆ to_string() [28/38]

string scifir::to_string ( const size_3d< float > &  x)

Returns a string representation of size_3d<float>.

Definition at line 7 of file size_3d.cpp.

8 {
9 return x.display();
10 }
string display() const
Returns a string representation of size_3d<float>, with his width, height and depth.
Definition size_3d.hpp:197

◆ to_string() [29/38]

template<typename T >
string scifir::to_string ( const size_3d< T > &  x)

Returns a string representation of size_3d<T>.

Definition at line 226 of file size_3d.hpp.

227 {
228 return x.display();
229 }

◆ to_string() [30/38]

string scifir::to_string ( const size_nd< float > &  x)

Definition at line 7 of file size_nd.cpp.

8 {
9 return x.display();
10 }
string display() const
Definition size_nd.hpp:312

◆ to_string() [31/38]

template<typename T >
string scifir::to_string ( const size_nd< T > &  x)

Definition at line 350 of file size_nd.hpp.

351 {
352 return x.display();
353 }

◆ to_string() [32/38]

string scifir::to_string ( const vector< dimension > &  x_dimensions,
bool  with_brackets = false 
)

Creates the string representation of a vector of dimensions. Used to display the dimensions of scalar_unit and all vector_unit classes. The dimensions can be displayed optionally between brackets like '[]' too.

Definition at line 1666 of file dimension.cpp.

1667 {
1669 if (x_dimensions.size() > 0)
1670 {
1671 if (with_brackets)
1672 {
1673 out << "[";
1674 }
1675 vector<dimension::type> printed_dimensions = vector<dimension::type>();
1676 map<prefix,int> counted_prefixes = map<prefix,int>();
1677 bool first_print = true;
1678 for (const dimension& x_dimension : x_dimensions)
1679 {
1680 if (x_dimension.dimension_position == dimension::NUMERATOR)
1681 {
1682 bool printed = false;
1683 for (const dimension::type& print_dimension : printed_dimensions)
1684 {
1685 if (print_dimension == x_dimension.dimension_type)
1686 {
1687 printed = true;
1688 }
1689 }
1690 if (printed == true)
1691 {
1692 continue;
1693 }
1694 counted_prefixes = map<prefix,int>();
1695 for (const dimension& y_dimension : x_dimensions)
1696 {
1697 if (x_dimension.dimension_type == y_dimension.dimension_type)
1698 {
1699 counted_prefixes[y_dimension.prefix]++;
1700 }
1701 }
1702 for (const auto& x_prefix : counted_prefixes)
1703 {
1704 if (!first_print)
1705 {
1706 out << "*";
1707 }
1708 out << x_prefix.first << x_dimension.get_symbol();
1709 if (x_prefix.second > 1)
1710 {
1711 out << x_prefix.second;
1712 }
1713 first_print = false;
1714 }
1715 printed_dimensions.push_back(x_dimension.dimension_type);
1716 }
1717 }
1718 printed_dimensions.clear();
1719 bool first_negative_iteration = true;
1720 bool first_negative_prefix = true;
1721 for (const dimension& x_dimension : x_dimensions)
1722 {
1723 if (x_dimension.dimension_position == dimension::DENOMINATOR)
1724 {
1725 if (first_negative_iteration == true)
1726 {
1727 if (first_print)
1728 {
1729 out << "1";
1730 }
1731 out << "/";
1732 first_negative_iteration = false;
1733 }
1734 bool printed = false;
1735 for (const dimension::type& print_dimension : printed_dimensions)
1736 {
1737 if (print_dimension == x_dimension.dimension_type)
1738 {
1739 printed = true;
1740 }
1741 }
1742 if (printed == true)
1743 {
1744 continue;
1745 }
1746 counted_prefixes = map<prefix,int>();
1747 for (const dimension& y_dimension : x_dimensions)
1748 {
1749 if (x_dimension.dimension_type == y_dimension.dimension_type)
1750 {
1751 counted_prefixes[y_dimension.prefix]++;
1752 }
1753 }
1754 for (const auto& x_prefix : counted_prefixes)
1755 {
1756 if (first_negative_prefix == false)
1757 {
1758 out << "*";
1759 }
1760 out << x_prefix.first << x_dimension.get_symbol();
1761 if (x_prefix.second > 1)
1762 {
1763 out << x_prefix.second;
1764 }
1765 first_negative_prefix = false;
1766 }
1767 printed_dimensions.push_back(x_dimension.dimension_type);
1768 }
1769 }
1770 if (with_brackets)
1771 {
1772 out << "]";
1773 }
1774 }
1775 else
1776 {
1777 out << "[empty]";
1778 }
1779 return out.str();
1780 }

◆ to_string() [33/38]

string scifir::to_string ( const vector_unit_2d x)

It generates a string representation of vector_unit_2d.

◆ to_string() [34/38]

string scifir::to_string ( const vector_unit_3d x)

It generates a string representation of vector_unit_3d.

◆ to_string() [35/38]

string scifir::to_string ( const vector_unit_nd x)

It generates a string representation of vector_unit_nd.

Definition at line 781 of file vector_unit_nd.cpp.

782 {
783 return x.vectorial_display(2);
784 }
string vectorial_display(int number_of_decimals=2) const
Displays the vector as the string representation of the scalar unit adding also all the angles.

◆ to_string() [36/38]

string scifir::to_string ( const zid x)

Returns a string representation of zid, same as display().

Definition at line 288 of file zid.cpp.

289 {
290 return x.display();
291 }
string display() const
Returns a string representation of zid, including the string representation of his aid.
Definition zid.cpp:139

◆ to_string() [37/38]

string scifir::to_string ( const zid::type x)

Converts a value of the enum zid::type to its string representation, which is a single letter. The value COUNTRY returns C. The value REGION returns R. The value SETTLEMENT returns S. The value ZONE returns Z.

Definition at line 293 of file zid.cpp.

294 {
295 switch (x)
296 {
297 case zid::NONE:
298 return "";
299 case zid::COUNTRY:
300 return "C";
301 case zid::REGION:
302 return "R";
303 case zid::SETTLEMENT:
304 return "S";
305 case zid::ZONE:
306 return "Z";
307 }
308 return "";
309 }

◆ to_string() [38/38]

string scifir::to_string ( direction::name  x)

Definition at line 279 of file direction.cpp.

280 {
281 switch (x)
282 {
283 case direction::NONE:
284 return "";
285 case direction::LEFT:
286 return "left";
287 case direction::RIGHT:
288 return "right";
289 case direction::TOP:
290 return "top";
291 case direction::BOTTOM:
292 return "bottom";
293 case direction::FRONT:
294 return "front";
295 case direction::BACK:
296 return "back";
297 case direction::LEFT_TOP:
298 return "left-top";
299 case direction::LEFT_BOTTOM:
300 return "left-bottom";
301 case direction::RIGHT_TOP:
302 return "right-top";
303 case direction::RIGHT_BOTTOM:
304 return "right-bottom";
305 case direction::LEFT_FRONT:
306 return "left-front";
307 case direction::LEFT_BACK:
308 return "left-back";
309 case direction::RIGHT_FRONT:
310 return "right-front";
311 case direction::RIGHT_BACK:
312 return "right-back";
313 case direction::TOP_FRONT:
314 return "top-front";
315 case direction::TOP_BACK:
316 return "top-back";
317 case direction::BOTTOM_FRONT:
318 return "bottom-front";
319 case direction::BOTTOM_BACK:
320 return "bottom-back";
321 case direction::LEFT_TOP_FRONT:
322 return "left-top-front";
323 case direction::LEFT_TOP_BACK:
324 return "left-top-back";
325 case direction::LEFT_BOTTOM_FRONT:
326 return "left-bottom-front";
327 case direction::LEFT_BOTTOM_BACK:
328 return "left-bottom-back";
329 case direction::RIGHT_TOP_FRONT:
330 return "right-top-front";
331 case direction::RIGHT_TOP_BACK:
332 return "right-top-back";
333 case direction::RIGHT_BOTTOM_FRONT:
334 return "right-bottom-front";
335 case direction::RIGHT_BOTTOM_BACK:
336 return "right-bottom-back";
337 }
338 return "";
339 }

◆ turn_to_degree()

float scifir::turn_to_degree ( float  x)
inline

Definition at line 26 of file angle.hpp.

27 {
28 return x * 360.0f;
29 }

◆ turn_to_gradian()

float scifir::turn_to_gradian ( float  x)
inline

Definition at line 56 of file angle.hpp.

57 {
58 return x * 400.f;
59 }

◆ turn_to_radian()

float scifir::turn_to_radian ( float  x)
inline

Definition at line 41 of file angle.hpp.

42 {
43 return x * 2 * std::numbers::pi_v<float>;
44 }

◆ VECTOR_UNIT_2D_CPP()

scifir::VECTOR_UNIT_2D_CPP ( displacement  ,
"m"   
)

◆ VECTOR_UNIT_2D_HPP()

scifir::VECTOR_UNIT_2D_HPP ( displacement  )

◆ VECTOR_UNIT_3D_CPP()

scifir::VECTOR_UNIT_3D_CPP ( displacement  ,
"m"   
)

◆ VECTOR_UNIT_3D_HPP()

scifir::VECTOR_UNIT_3D_HPP ( displacement  )

◆ VECTOR_UNIT_CPP() [1/26]

scifir::VECTOR_UNIT_CPP ( acceleration  ,
"m/s2"   
)

◆ VECTOR_UNIT_CPP() [2/26]

scifir::VECTOR_UNIT_CPP ( angular_acceleration  ,
"rad/s2"   
)

◆ VECTOR_UNIT_CPP() [3/26]

scifir::VECTOR_UNIT_CPP ( angular_momentum  ,
"m2*kg/s"   
)

◆ VECTOR_UNIT_CPP() [4/26]

scifir::VECTOR_UNIT_CPP ( angular_velocity  ,
"rad/s"   
)

◆ VECTOR_UNIT_CPP() [5/26]

scifir::VECTOR_UNIT_CPP ( electric_displacement_field  ,
"C/m2"   
)

◆ VECTOR_UNIT_CPP() [6/26]

scifir::VECTOR_UNIT_CPP ( electric_field_strength  ,
"V/m"   
)

◆ VECTOR_UNIT_CPP() [7/26]

scifir::VECTOR_UNIT_CPP ( force  ,
"N"   
)

◆ VECTOR_UNIT_CPP() [8/26]

scifir::VECTOR_UNIT_CPP ( impulse  ,
"m*kg/s"   
)

◆ VECTOR_UNIT_CPP() [9/26]

scifir::VECTOR_UNIT_CPP ( irradiance  ,
"kg/s3"   
)

◆ VECTOR_UNIT_CPP() [10/26]

scifir::VECTOR_UNIT_CPP ( jerk  ,
"m/s3"   
)

◆ VECTOR_UNIT_CPP() [11/26]

scifir::VECTOR_UNIT_CPP ( magnetic_flux_density  ,
"T"   
)

◆ VECTOR_UNIT_CPP() [12/26]

scifir::VECTOR_UNIT_CPP ( magnetic_moment  ,
"Wb*m"   
)

◆ VECTOR_UNIT_CPP() [13/26]

scifir::VECTOR_UNIT_CPP ( magnetic_vector_potential  ,
"Wb/m"   
)

◆ VECTOR_UNIT_CPP() [14/26]

scifir::VECTOR_UNIT_CPP ( magnetomotive_force  ,
"A*rad"   
)

◆ VECTOR_UNIT_CPP() [15/26]

scifir::VECTOR_UNIT_CPP ( momentum  ,
"kg*m/s"   
)

◆ VECTOR_UNIT_CPP() [16/26]

scifir::VECTOR_UNIT_CPP ( pressure  ,
"Pa"   
)

◆ VECTOR_UNIT_CPP() [17/26]

scifir::VECTOR_UNIT_CPP ( radiant_exposure  ,
"kg/s2"   
)

◆ VECTOR_UNIT_CPP() [18/26]

scifir::VECTOR_UNIT_CPP ( radiant_flux  ,
"kg*m2/s3"   
)

◆ VECTOR_UNIT_CPP() [19/26]

scifir::VECTOR_UNIT_CPP ( snap  ,
"m/s4"   
)

◆ VECTOR_UNIT_CPP() [20/26]

scifir::VECTOR_UNIT_CPP ( specific_angular_momentum  ,
"m2/s"   
)

◆ VECTOR_UNIT_CPP() [21/26]

scifir::VECTOR_UNIT_CPP ( spectral_flux  ,
"kg*m/s3"   
)

◆ VECTOR_UNIT_CPP() [22/26]

scifir::VECTOR_UNIT_CPP ( surface_tension  ,
"kg/s2"   
)

◆ VECTOR_UNIT_CPP() [23/26]

scifir::VECTOR_UNIT_CPP ( temperature_gradient  ,
"K/m"   
)

◆ VECTOR_UNIT_CPP() [24/26]

scifir::VECTOR_UNIT_CPP ( torque  ,
"kg*m2/s2"   
)

◆ VECTOR_UNIT_CPP() [25/26]

scifir::VECTOR_UNIT_CPP ( velocity  ,
"m/s"   
)

◆ VECTOR_UNIT_CPP() [26/26]

scifir::VECTOR_UNIT_CPP ( yank  ,
"N/s"   
)

◆ VECTOR_UNIT_HPP() [1/26]

scifir::VECTOR_UNIT_HPP ( acceleration  )

◆ VECTOR_UNIT_HPP() [2/26]

scifir::VECTOR_UNIT_HPP ( angular_acceleration  )

◆ VECTOR_UNIT_HPP() [3/26]

scifir::VECTOR_UNIT_HPP ( angular_momentum  )

◆ VECTOR_UNIT_HPP() [4/26]

scifir::VECTOR_UNIT_HPP ( angular_velocity  )

◆ VECTOR_UNIT_HPP() [5/26]

scifir::VECTOR_UNIT_HPP ( electric_displacement_field  )

◆ VECTOR_UNIT_HPP() [6/26]

scifir::VECTOR_UNIT_HPP ( electric_field_strength  )

◆ VECTOR_UNIT_HPP() [7/26]

scifir::VECTOR_UNIT_HPP ( force  )

◆ VECTOR_UNIT_HPP() [8/26]

scifir::VECTOR_UNIT_HPP ( impulse  )

◆ VECTOR_UNIT_HPP() [9/26]

scifir::VECTOR_UNIT_HPP ( irradiance  )

◆ VECTOR_UNIT_HPP() [10/26]

scifir::VECTOR_UNIT_HPP ( jerk  )

◆ VECTOR_UNIT_HPP() [11/26]

scifir::VECTOR_UNIT_HPP ( magnetic_flux_density  )

◆ VECTOR_UNIT_HPP() [12/26]

scifir::VECTOR_UNIT_HPP ( magnetic_moment  )

◆ VECTOR_UNIT_HPP() [13/26]

scifir::VECTOR_UNIT_HPP ( magnetic_vector_potential  )

◆ VECTOR_UNIT_HPP() [14/26]

scifir::VECTOR_UNIT_HPP ( magnetomotive_force  )

◆ VECTOR_UNIT_HPP() [15/26]

scifir::VECTOR_UNIT_HPP ( momentum  )

◆ VECTOR_UNIT_HPP() [16/26]

scifir::VECTOR_UNIT_HPP ( pressure  )

◆ VECTOR_UNIT_HPP() [17/26]

scifir::VECTOR_UNIT_HPP ( radiant_exposure  )

◆ VECTOR_UNIT_HPP() [18/26]

scifir::VECTOR_UNIT_HPP ( radiant_flux  )

◆ VECTOR_UNIT_HPP() [19/26]

scifir::VECTOR_UNIT_HPP ( snap  )

◆ VECTOR_UNIT_HPP() [20/26]

scifir::VECTOR_UNIT_HPP ( specific_angular_momentum  )

◆ VECTOR_UNIT_HPP() [21/26]

scifir::VECTOR_UNIT_HPP ( spectral_flux  )

◆ VECTOR_UNIT_HPP() [22/26]

scifir::VECTOR_UNIT_HPP ( surface_tension  )

◆ VECTOR_UNIT_HPP() [23/26]

scifir::VECTOR_UNIT_HPP ( temperature_gradient  )

◆ VECTOR_UNIT_HPP() [24/26]

scifir::VECTOR_UNIT_HPP ( torque  )

◆ VECTOR_UNIT_HPP() [25/26]

scifir::VECTOR_UNIT_HPP ( velocity  )

◆ VECTOR_UNIT_HPP() [26/26]

scifir::VECTOR_UNIT_HPP ( yank  )

◆ VECTOR_UNIT_ND_CPP()

scifir::VECTOR_UNIT_ND_CPP ( displacement  ,
"m"   
)

◆ VECTOR_UNIT_ND_HPP()

scifir::VECTOR_UNIT_ND_HPP ( displacement  )

◆ volume()

scifir::volume::volume ( const size_3d< length > &  x)
explicit

Definition at line 22 of file space_units.cpp.

22 : scalar_unit()
23 {
24 length x_height = x.height;
25 length x_depth = x.depth;
26 x_height.change_dimensions(x.width);
27 x_depth.change_dimensions(x.width);
28 *this = x.width * x_height * x_depth;
29 }

Variable Documentation

◆ ATOMIC_MASS_CONSTANT

const long double scifir::ATOMIC_MASS_CONSTANT = 1.66053906660e-27

Definition at line 20 of file constants.hpp.

◆ AVOGADRO_CONSTANT

const long double scifir::AVOGADRO_CONSTANT = 6.02214076e23

Definition at line 15 of file constants.hpp.

◆ BOLTZMANN_CONSTANT

const long double scifir::BOLTZMANN_CONSTANT = 1.380649e-23

Definition at line 14 of file constants.hpp.

◆ coordinates_ndr_no_angle

angle scifir::coordinates_ndr_no_angle = angle()

Definition at line 7 of file coordinates_ndr.cpp.

◆ COULOMB_CONSTANT

const long double scifir::COULOMB_CONSTANT = 8.9875517873681764e9

Definition at line 21 of file constants.hpp.

◆ ELEMENTARY_CHARGE

const long double scifir::ELEMENTARY_CHARGE = 1.602176634e-19

Definition at line 13 of file constants.hpp.

◆ FARADAY_CONSTANT

const long double scifir::FARADAY_CONSTANT = 9.64853321233100184e4

Definition at line 24 of file constants.hpp.

◆ GRAVITATIONAL_CONSTANT

const long double scifir::GRAVITATIONAL_CONSTANT = 6.6743e-11

Definition at line 18 of file constants.hpp.

◆ HYPERFINE_TRANSITION_FREQUENCY_OF_CS

const long double scifir::HYPERFINE_TRANSITION_FREQUENCY_OF_CS = 9192631770.0l

Definition at line 10 of file constants.hpp.

◆ LUMINOUS_EFFICACY_OF_540_THZ_RADIATION

const long double scifir::LUMINOUS_EFFICACY_OF_540_THZ_RADIATION = 683.0l

Definition at line 16 of file constants.hpp.

◆ MOLAR_GAS_CONSTANT

const long double scifir::MOLAR_GAS_CONSTANT = 8.31446261815324l

Definition at line 19 of file constants.hpp.

◆ PLANCK_CONSTANT

const long double scifir::PLANCK_CONSTANT = 6.62607015e-34

Definition at line 12 of file constants.hpp.

◆ RYDBERG_CONSTANT

const long double scifir::RYDBERG_CONSTANT = 1.0973731568539e7

Definition at line 23 of file constants.hpp.

◆ SPEED_OF_LIGHT

const long double scifir::SPEED_OF_LIGHT = 299792458.0l

Definition at line 11 of file constants.hpp.

◆ VACUUM_PERMITTIVITY

const long double scifir::VACUUM_PERMITTIVITY = 8.8541878188e-12

Definition at line 22 of file constants.hpp.

◆ WGS84_EARTH_SEMIAXIS_A

const scalar_unit scifir::WGS84_EARTH_SEMIAXIS_A = 6378137_m

Definition at line 9 of file constants.cpp.

◆ WGS84_EARTH_SEMIAXIS_B

const scalar_unit scifir::WGS84_EARTH_SEMIAXIS_B = 6356752.314245_m

Definition at line 10 of file constants.cpp.