1#ifndef SCIFIR_UNITS_COORDINATES_COORDINATES_3DR_HPP_INCLUDED
2#define SCIFIR_UNITS_COORDINATES_COORDINATES_3DR_HPP_INCLUDED
4#include "../meca_number/angle.hpp"
6#include "../units/base_units.hpp"
16 template<
typename T = length>
368 out <<
"(" <<
x <<
"," <<
y <<
"," <<
z <<
";" <<
theta <<
"," <<
phi <<
")";
547 return float(std::sqrt(std::pow(
x,2) + std::pow(
y,2)));
557 return float(std::sqrt(std::pow(
x,2) + std::pow(
y,2) + std::pow(
z,2)));
796 return float(std::sqrt(std::pow(
x,2) + std::pow(
y,2) + std::pow(
z,2)));
905 string to_string(
const coordinates_3dr<float>& x);
907 template<
typename T,
typename U>
913 float distance(
const coordinates_3dr<float>& x,
const coordinates_3dr<float>& y);
915 template<
typename T,
typename U>
921 float distance(
const coordinates_3dr<float>& x,
const coordinates_3d<float>& y);
923 template<
typename T,
typename U>
929 float distance(
const coordinates_3d<float>& x,
const coordinates_3dr<float>& y);
932template<
typename T,
typename U>
935 if (x.
x == y.
x and x.y == y.y and x.z == y.z and x.theta == y.theta and x.phi == y.phi)
945template<
typename T,
typename U>
951template<
typename T,
typename U>
954 if (x.
x == y.
x and x.y == y.y and x.z == y.z)
964template<
typename T,
typename U>
970template<
typename T,
typename U>
973 if (x.
x == y.
x and x.y == y.y and x.z == y.z)
983template<
typename T,
typename U>
999 return !(x == init_coordinates_3dr);
1012 return !(init_coordinates_3dr == x);
1024 return x + to_string(y);
1030 return to_string(x) + y;
1036 return os << to_string(x);
Class that allows to work with angles. Each angle sizes 4 bytes. Initialization string example: "20°"...
string display_cartesian() const
void move(const scalar_unit &x_value)
longitude get_longitude() const
void set_position(float new_p, const angle &new_theta, float new_z)
coordinates_3dr(coordinates_3d< float > &&x_coordinates, const angle &new_theta, const angle &new_phi)
void set_position(const angle &new_latitude, const angle &new_longitude, float new_altitude)
angle get_spherical_phi() const
void move(float new_x, float new_y, float new_z)
string display_geographical() const
coordinates_3dr(float new_p, const angle &new_cylindrical_theta, float new_z, const angle &new_theta, const angle &new_phi)
coordinates_3dr(float new_r, const angle &new_spherical_theta, const angle &new_spherical_phi, const angle &new_theta, const angle &new_phi)
angle get_spherical_theta() const
void set_position(float new_r, const angle &new_theta, const angle &new_phi)
latitude get_latitude() const
coordinates_3dr(const angle &new_latitude, const angle &new_longitude, float new_altitude, const angle &new_theta, const angle &new_phi)
string display_cylindrical() const
coordinates_3dr(float new_x, float new_y, float new_z, const angle &new_theta, const angle &new_phi)
coordinates_3dr(const coordinates_3d< float > &x_coordinates, const angle &new_theta, const angle &new_phi)
coordinates_3dr(coordinates_3dr< float > &&x_coordinates)
void rotate_in_z(const angle &x_angle)
void move(const displacement_3d &x_displacement)
string display_spherical() const
void set_position(float new_x, float new_y, float new_z)
string display_cartesian() const
void move(float new_p, const angle &new_theta, float new_z)
void point_to(direction::name x)
void rotate_in_y(const angle &x_angle)
coordinates_3dr(const string &init_coordinates_3dr)
float get_altitude() const
void rotate_in_x(const angle &x_angle)
void move(float new_r, const angle &new_theta, const angle &new_phi)
void initialize_from_string(string init_coordinates_3dr)
float distance_to_origin() const
coordinates_3dr(const coordinates_3dr< float > &x_coordinates)
coordinates_3dr(coordinates_3dr< T > &&x_coordinates)
coordinates_3dr(const coordinates_3dr< T > &x_coordinates)
void rotate_in_x(const angle &x_angle)
static coordinates_3dr< T > origin(const coordinates_3dr< T > &origin, const coordinates_3dr< T > &coordinates)
string display_spherical() const
void move(const scalar_unit &new_x, const scalar_unit &new_y, const scalar_unit &new_z)
coordinates_3dr(const scalar_unit &new_p, const angle &new_cylindrical_theta, scalar_unit new_z, const angle &new_theta, const angle &new_phi)
angle get_spherical_theta() const
scalar_unit get_altitude() const
string display_cylindrical() const
string display_cartesian() const
string display_geographical() const
latitude get_latitude() const
void move(const scalar_unit &new_p, const angle &new_theta, scalar_unit new_z)
coordinates_3dr(coordinates_3d< U > &&x_coordinates, const angle &new_theta, const angle &new_phi)
void set_position(const scalar_unit &new_r, const angle &new_theta, const angle &new_phi)
void set_position(const angle &new_latitude, const angle &new_longitude, const scalar_unit &new_altitude)
coordinates_3dr(const string &init_coordinates_3dr)
void point_to(direction::name x)
void rotate_in_z(const angle &x_angle)
coordinates_3dr< T > & operator=(const coordinates_3dr< T > &x_coordinates)
void set_position(const scalar_unit &new_p, const angle &new_theta, scalar_unit new_z)
coordinates_3dr(const coordinates_3d< U > &x_coordinates, const angle &new_theta, const angle &new_phi)
coordinates_3dr(const scalar_unit &new_r, const angle &new_spherical_theta, const angle &new_spherical_phi, const angle &new_theta, const angle &new_phi)
void move(const displacement_3d &x_displacement)
T distance_to_origin() const
longitude get_longitude() const
coordinates_3dr(const angle &new_latitude, const angle &new_longitude, const scalar_unit &new_altitude, const angle &new_theta, const angle &new_phi)
void set_position(const scalar_unit &new_x, const scalar_unit &new_y, const scalar_unit &new_z)
coordinates_3dr(const scalar_unit &new_x, const scalar_unit &new_y, const scalar_unit &new_z, const angle &new_theta, const angle &new_phi)
angle get_spherical_phi() const
void move(const scalar_unit &new_r, const angle &new_theta, const angle &new_phi)
void initialize_from_string(string init_coordinates_3dr)
void rotate_in_y(const angle &x_angle)
Class that allows to create scalar units, which are composed of a value (as a float) and dimensions....
string operator+(const string &x, const scifir::coordinates_3dr< T > &y)
istream & operator>>(istream &is, scifir::coordinates_3dr< T > &x)
bool operator==(const scifir::coordinates_3dr< T > &x, const scifir::coordinates_3dr< U > &y)
ostream & operator<<(ostream &os, const scifir::coordinates_3dr< T > &x)
void operator+=(string &x, const scifir::coordinates_3dr< T > &y)
bool operator!=(const scifir::coordinates_3dr< T > &x, const scifir::coordinates_3dr< U > &y)
The namespace scifir contains all scifir-units, excepting the string literals, which are outside.
bool is_latitude(const string &init_latitude)
scalar_unit ECEF_to_LLA_altitude(const scalar_unit &x, scalar_unit y, const scalar_unit &z)
float cos(const angle &x)
Calculates the cos of angle x. It uses the cos() function of the standard library of C++,...
scalar_unit pow(const scalar_unit &x, int exponent)
Exponentiates a scalar_unit to some numeric type, the dimensions are also exponentiated.
bool is_longitude(const string &init_longitude)
longitude ECEF_to_LLA_longitude(const scalar_unit &x, scalar_unit y, const scalar_unit &z)
string to_string(const aid &x)
Creates a string representation of aid, it's for aid equivalent to the display() function of aid.
float distance(const coordinates_1d< float > &x, const coordinates_1d< float > &y)
angle atan(float x)
Calculates the atan of some value x and returns the result as angle in degrees.
string display_float(const float &value, int number_of_decimals)
float acos_degree(float x)
Calculates the acos receiving x in degrees. It uses the acos() function of the standard library of C+...
latitude ECEF_to_LLA_latitude(const scalar_unit &x, scalar_unit y, const scalar_unit &z)
float sin(const angle &x)
Calculates the sin of angle x. It uses the sin() function of the standard library of C++,...
angle sqrt(const angle &x)
Calculates the square root of the angle x and returns that new angle.
bool is_angle(const string &init_angle)
Checks if some string is an initialization string of an angle.