1#ifndef SCIFIR_UNITS_COORDINATES_COORDINATES_ND_HPP_INCLUDED
2#define SCIFIR_UNITS_COORDINATES_COORDINATES_ND_HPP_INCLUDED
4#include "../derived_units/physics_units.hpp"
5#include "../units/base_units.hpp"
6#include "../util/types.hpp"
18 template<
typename T = length>
965 for (
unsigned int i = 0;
i <
values.size();
i++)
969 return std::sqrt(
x_T);
1133 template<
typename T>
1136 if (x.values.size() > 0)
1140 for (
int i = 0;
i < x.values.size();
i++)
1143 if ((
i + 1) != x.values.size())
1157 string to_string(
const coordinates_nd<float>& x);
1159 template<
typename T,
typename U>
1162 if (x.get_nd() == y.get_nd())
1165 for (
int i = 0;
i < x.values.size();
i++)
1177 float distance(
const coordinates_nd<float>& x,
const coordinates_nd<float>& y);
1180template<
typename T,
typename U>
1183 if (x.values.size() == y.values.size())
1185 for (
int i = 0; i < x.values.size(); i++)
1187 if (x.values[i] != y.values[i])
1200template<
typename T,
typename U>
1216 return !(x == init_coordinates_nd);
1229 return !(init_coordinates_nd == x);
1241 return x + to_string(y);
1247 return to_string(x) + y;
1253 return os << to_string(x);
Class that allows to work with angles. Each angle sizes 4 bytes. Initialization string example: "20°"...
Class that represents the position in 3D spaces. The space can be a length or, for the case of imagin...
coordinates_nd(float new_r, const angle &new_theta, const angle &new_phi)
latitude get_latitude() const
coordinates_nd(const vector< float > &new_values)
void move(float new_p, const angle &new_theta)
void move(const displacement_3d &x_displacement)
void set_position(const angle &new_latitude, const angle &new_longitude, float new_altitude)
float get_altitude() const
void rotate_in_3d(int axis, const angle &new_theta)
void set_position(float new_x)
void set_position(float new_x, float new_y)
string display_geographical() const
coordinates_nd(float new_x, float new_y, float new_z)
string display_cylindrical() const
void set_position(float new_p, const angle &new_theta)
void initialize_from_string(string init_coordinates_nd)
void set_position(float new_x, float new_y, float new_z)
coordinates_nd(coordinates_nd< float > &&x)
coordinates_nd(float new_p, const angle &new_theta, float new_z)
coordinates_nd(float new_p, const angle &new_theta)
string display_cartesian_3d() const
coordinates_nd(float new_x)
void move(float new_p, const angle &new_theta, float new_z)
void move(const displacement_2d &x_displacement)
void move(float new_x, float new_y, float new_z)
string display_spherical() const
string display_cartesian_2d() const
bool is_nd(unsigned int i) const
void move(float new_r, const angle &new_theta, const angle &new_phi)
void set_position(float new_r, const angle &new_theta, const angle &new_phi)
void set_position(float new_p, const angle &new_theta, float new_z)
void move(float new_r, const vector< angle > &new_angles)
void move(const displacement_nd &x_displacement)
void move(float new_x, float new_y)
float distance_to_origin() const
void rotate_in_2d(const angle &new_theta)
coordinates_nd(const string &init_coordinates_nd)
coordinates_nd(const coordinates_nd< float > &x)
string display_polar() const
longitude get_longitude() const
coordinates_nd(float new_x, float new_y)
coordinates_nd(const angle &new_latitude, const angle &new_longitude, float new_altitude)
void set_position(const vector< float > &new_values)
coordinates_nd(coordinates_2d<>::type coordinates_type, const string &coord1, const string &coord2)
coordinates_nd(const scalar_unit &new_p, const angle &new_theta, scalar_unit new_z)
coordinates_nd(const coordinates_nd< T > &x)
coordinates_nd(const angle &new_latitude, const angle &new_longitude, const scalar_unit &new_altitude)
string display_geographical() const
void set_position(const scalar_unit &new_r, const angle &new_theta, const angle &new_phi)
void set_position(const scalar_unit &new_p, const angle &new_theta)
string display_spherical() const
coordinates_nd(const vector< U > &new_values)
scalar_unit get_altitude() const
void rotate_in_3d(int axis, const angle &new_theta)
latitude get_latitude() const
void move(const displacement_nd &x_displacement)
string display_cylindrical() const
static coordinates_nd< T > origin(const coordinates_nd< T > &origin, const coordinates_nd< T > &coordinates)
void rotate_in_2d(const angle &new_theta)
void move(const scalar_unit &new_x, const scalar_unit &new_y)
string display_cartesian_3d() const
coordinates_nd< T > & operator=(const coordinates_nd< T > &x_coordinates)
coordinates_nd(const scalar_unit &new_x, const scalar_unit &new_y)
void move(const scalar_unit &new_r, const vector< angle > &new_angles)
string display_polar() const
void move(const scalar_unit &new_p, const angle &new_theta)
coordinates_nd(coordinates_nd< T > &&x)
void set_position(const vector< scalar_unit > &new_values)
void set_position(const scalar_unit &new_x, const scalar_unit &new_y)
coordinates_nd(const scalar_unit &new_r, const angle &new_theta, const angle &new_phi)
coordinates_nd(const scalar_unit &new_p, const angle &new_theta)
void set_position(const angle &new_latitude, const angle &new_longitude, const scalar_unit &new_altitude)
void move(const scalar_unit &new_x, const scalar_unit &new_y, const scalar_unit &new_z)
coordinates_nd(const scalar_unit &new_x)
coordinates_nd(const string &init_coordinates_nd)
string display_cartesian_2d() const
void move(const displacement_2d &x_displacement)
void move(const displacement_3d &x_displacement)
void move(const scalar_unit &new_r, const angle &new_theta, const angle &new_phi)
longitude get_longitude() const
void move(const scalar_unit &new_p, const angle &new_theta, scalar_unit new_z)
void initialize_from_string(string init_coordinates_nd)
coordinates_nd(coordinates_3d<>::type coordinates_type, const string &coord1, const string &coord2, const string &coord3)
void set_position(const scalar_unit &new_x)
void move(const scalar_unit &new_x)
coordinates_nd(const scalar_unit &new_x, const scalar_unit &new_y, const scalar_unit &new_z)
T distance_to_origin() const
void set_position(const scalar_unit &new_p, const angle &new_theta, scalar_unit new_z)
void set_position(const scalar_unit &new_x, const scalar_unit &new_y, const scalar_unit &new_z)
Class that allows to create scalar units, which are composed of a value (as a float) and dimensions....
void operator+=(string &x, const scifir::coordinates_nd< T > &y)
ostream & operator<<(ostream &os, const scifir::coordinates_nd< T > &x)
string operator+(const string &x, const scifir::coordinates_nd< T > &y)
bool operator==(const scifir::coordinates_nd< T > &x, const scifir::coordinates_nd< U > &y)
bool operator!=(const scifir::coordinates_nd< T > &x, const scifir::coordinates_nd< U > &y)
istream & operator>>(istream &is, scifir::coordinates_nd< T > &x)
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)
float atan_degree(float x)
Calculates the atan receiving x in degrees. It uses the atan() function of the standard library of C+...
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)
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.