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
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
scifir::coordinates_ndr< T > Class Template Reference

#include <coordinates_ndr.hpp>

Public Member Functions

 coordinates_ndr ()
 
 coordinates_ndr (const coordinates_ndr< T > &x)
 
 coordinates_ndr (coordinates_ndr< T > &&x)
 
template<typename U >
 coordinates_ndr (const vector< U > &new_values, const vector< float > &new_angles)
 
template<typename U >
 coordinates_ndr (const vector< U > &new_values, const vector< angle > &new_angles)
 
 coordinates_ndr (const scalar_unit &new_x)
 
 coordinates_ndr (const scalar_unit &new_x, const scalar_unit &new_y, const angle &new_theta)
 
 coordinates_ndr (const scalar_unit &new_p, const angle &new_polar_theta, const angle &new_theta)
 
 coordinates_ndr (const scalar_unit &new_x, const scalar_unit &new_y, const scalar_unit &new_z, const angle &new_theta, const angle &new_phi)
 
 coordinates_ndr (const scalar_unit &new_p, const angle &new_cylindrical_theta, scalar_unit new_z, const angle &new_theta, const angle &new_phi)
 
 coordinates_ndr (const scalar_unit &new_r, const angle &new_spherical_theta, const angle &new_spherical_phi, const angle &new_theta, const angle &new_phi)
 
 coordinates_ndr (const angle &new_latitude, const angle &new_longitude, const scalar_unit &new_altitude, const angle &new_theta, const angle &new_phi)
 
template<typename U >
 coordinates_ndr (const coordinates_nd< U > &new_coordinates, const vector< float > &new_angles)
 
template<typename U >
 coordinates_ndr (coordinates_nd< U > &&new_coordinates, const vector< float > &new_angles)
 
template<typename U >
 coordinates_ndr (const coordinates_nd< U > &new_coordinates, const vector< angle > &new_angles)
 
template<typename U >
 coordinates_ndr (coordinates_nd< U > &&new_coordinates, const vector< angle > &new_angles)
 
 coordinates_ndr (const string &init_coordinates_ndr)
 
coordinates_ndr< T > & operator= (const coordinates_ndr< T > &x_coordinates)
 
coordinates_ndr< T > & operator= (coordinates_ndr< T > &&x_coordinates)
 
template<typename U >
coordinates_ndr< T > & operator= (const coordinates_nd< U > &x_coordinates)
 
template<typename U >
coordinates_ndr< T > & operator= (coordinates_nd< U > &&x_coordinates)
 
coordinates_ndr< T > & operator= (const string &init_coordinates_ndr)
 
bool is_nd (int i) const
 
int get_nd () const
 
void change_nd (const vector< scalar_unit > &new_values, const vector< float > &new_angles)
 
void change_nd (const vector< scalar_unit > &new_values, const vector< angle > &new_angles)
 
const vector< T > & get_values () const
 
void set_values (const vector< scalar_unit > &new_values)
 
const Tget_value (int i) const
 
Tget_value (int i)
 
const vector< angle > & get_angles () const
 
void set_angles (const vector< float > &new_angles)
 
void set_angles (const vector< angle > &new_angles)
 
const angleget_angle (int i) const
 
angleget_angle (int i)
 
T get_p () const
 
angle get_spherical_theta () const
 
T get_r () const
 
angle get_spherical_phi () const
 
latitude get_latitude () const
 
longitude get_longitude () const
 
scalar_unit get_altitude () const
 
void point_to (direction::name x)
 
void set_position (const scalar_unit &new_x)
 
void set_position (const scalar_unit &new_x, const scalar_unit &new_y)
 
void set_position (const scalar_unit &new_p, const angle &new_theta)
 
void set_position (const scalar_unit &new_x, const scalar_unit &new_y, const scalar_unit &new_z)
 
void set_position (const scalar_unit &new_p, const angle &new_theta, scalar_unit new_z)
 
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)
 
void set_position (const vector< scalar_unit > &new_values)
 
void rotate_in_2d (const angle &new_theta)
 
void rotate_in_3d (int axis, const angle &new_theta)
 
void move (const scalar_unit &new_x)
 
void move (const displacement_2d &x_displacement)
 
void move (const scalar_unit &new_x, const scalar_unit &new_y)
 
void move (const scalar_unit &new_p, const angle &new_theta)
 
void move (const displacement_3d &x_displacement)
 
void move (const scalar_unit &new_x, const scalar_unit &new_y, const scalar_unit &new_z)
 
void move (const scalar_unit &new_p, const angle &new_theta, scalar_unit new_z)
 
void move (const scalar_unit &new_r, const angle &new_theta, const angle &new_phi)
 
void move (const displacement_nd &x_displacement)
 
void move (const scalar_unit &new_r, const vector< angle > &new_angles)
 
T distance_to_origin () const
 
string display_cartesian_2d () const
 
string display_polar () const
 
string display_cartesian_3d () const
 
string display_cylindrical () const
 
string display_spherical () const
 
string display_geographical () const
 

Static Public Member Functions

static coordinates_ndr< Torigin (const coordinates_ndr< T > &origin, const coordinates_ndr< T > &coordinates)
 

Private Member Functions

void initialize_from_string (string init_coordinates_ndr)
 

Private Attributes

vector< Tvalues
 
vector< angleangles
 

Static Private Attributes

static T no_value = T()
 

Detailed Description

template<typename T = length>
class scifir::coordinates_ndr< T >

Definition at line 20 of file coordinates_ndr.hpp.

Constructor & Destructor Documentation

◆ coordinates_ndr() [1/17]

template<typename T = length>
scifir::coordinates_ndr< T >::coordinates_ndr ( )
inline

Definition at line 23 of file coordinates_ndr.hpp.

23 : values(),angles()
24 {}

◆ coordinates_ndr() [2/17]

template<typename T = length>
scifir::coordinates_ndr< T >::coordinates_ndr ( const coordinates_ndr< T > &  x)
inline

Definition at line 26 of file coordinates_ndr.hpp.

26 : values(),angles()
27 {
28 if (x.values.size() == (x.angles.size() + 1))
29 {
30 values = x.values;
31 angles = x.angles;
32 }
33 }

◆ coordinates_ndr() [3/17]

template<typename T = length>
scifir::coordinates_ndr< T >::coordinates_ndr ( coordinates_ndr< T > &&  x)
inline

Definition at line 35 of file coordinates_ndr.hpp.

35 : values(),angles()
36 {
37 if (x.values.size() == (x.angles.size() + 1))
38 {
39 values = std::move(x.values);
40 angles = std::move(x.angles);
41 }
42 }

◆ coordinates_ndr() [4/17]

template<typename T = length>
template<typename U >
scifir::coordinates_ndr< T >::coordinates_ndr ( const vector< U > &  new_values,
const vector< float > &  new_angles 
)
inlineexplicit

Definition at line 45 of file coordinates_ndr.hpp.

45 : values(),angles()
46 {
47 if (new_values.size() == (new_values.size() + 1))
48 {
49 for(const U& x_value : new_values)
50 {
51 values.push_back(T(x_value));
52 }
53 for(const float& x_angle : new_angles)
54 {
55 angles.push_back(angle(x_angle));
56 }
57 }
58 }

◆ coordinates_ndr() [5/17]

template<typename T = length>
template<typename U >
scifir::coordinates_ndr< T >::coordinates_ndr ( const vector< U > &  new_values,
const vector< angle > &  new_angles 
)
inlineexplicit

Definition at line 61 of file coordinates_ndr.hpp.

61 : values(),angles()
62 {
63 if (new_values.size() == (new_angles.size() + 1))
64 {
65 for(const U& x_value : new_values)
66 {
67 values.push_back(T(x_value));
68 }
69 angles = new_angles;
70 }
71 }

◆ coordinates_ndr() [6/17]

template<typename T = length>
scifir::coordinates_ndr< T >::coordinates_ndr ( const scalar_unit new_x)
inlineexplicit

Definition at line 73 of file coordinates_ndr.hpp.

73 : values(),angles()
74 {
75 values.push_back(T(new_x));
76 }

◆ coordinates_ndr() [7/17]

template<typename T = length>
scifir::coordinates_ndr< T >::coordinates_ndr ( const scalar_unit new_x,
const scalar_unit new_y,
const angle new_theta 
)
inlineexplicit

Definition at line 78 of file coordinates_ndr.hpp.

78 : values(),angles()
79 {
80 values.push_back(T(new_x));
81 values.push_back(T(new_y));
82 angles.push_back(new_theta);
83 }

◆ coordinates_ndr() [8/17]

template<typename T = length>
scifir::coordinates_ndr< T >::coordinates_ndr ( const scalar_unit new_p,
const angle new_polar_theta,
const angle new_theta 
)
inlineexplicit

Definition at line 85 of file coordinates_ndr.hpp.

85 : values(),angles()
86 {
87 values.push_back(T(new_p * scifir::cos(new_polar_theta)));
88 values.push_back(T(new_p * scifir::sin(new_polar_theta)));
89 angles.push_back(new_theta);
90 }
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
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

◆ coordinates_ndr() [9/17]

template<typename T = length>
scifir::coordinates_ndr< T >::coordinates_ndr ( const scalar_unit new_x,
const scalar_unit new_y,
const scalar_unit new_z,
const angle new_theta,
const angle new_phi 
)
inlineexplicit

Definition at line 92 of file coordinates_ndr.hpp.

92 : values(),angles()
93 {
94 values.push_back(T(new_x));
95 values.push_back(T(new_y));
96 values.push_back(T(new_z));
97 angles.push_back(new_theta);
98 angles.push_back(new_phi);
99 }

◆ coordinates_ndr() [10/17]

template<typename T = length>
scifir::coordinates_ndr< T >::coordinates_ndr ( const scalar_unit new_p,
const angle new_cylindrical_theta,
scalar_unit  new_z,
const angle new_theta,
const angle new_phi 
)
inlineexplicit

Definition at line 101 of file coordinates_ndr.hpp.

101 : values(),angles()
102 {
103 values.push_back(T(new_p * scifir::cos(new_cylindrical_theta)));
104 values.push_back(T(new_p * scifir::sin(new_cylindrical_theta)));
105 values.push_back(T(new_z));
106 angles.push_back(new_theta);
107 angles.push_back(new_phi);
108 }

◆ coordinates_ndr() [11/17]

template<typename T = length>
scifir::coordinates_ndr< T >::coordinates_ndr ( const scalar_unit new_r,
const angle new_spherical_theta,
const angle new_spherical_phi,
const angle new_theta,
const angle new_phi 
)
inlineexplicit

Definition at line 110 of file coordinates_ndr.hpp.

110 : values(),angles()
111 {
112 values.push_back(T(new_r * scifir::cos(new_spherical_theta) * scifir::sin(new_spherical_phi)));
113 values.push_back(T(new_r * scifir::sin(new_spherical_theta) * scifir::sin(new_spherical_phi)));
114 values.push_back(T(new_r * scifir::cos(new_spherical_phi)));
115 angles.push_back(new_theta);
116 angles.push_back(new_phi);
117 }

◆ coordinates_ndr() [12/17]

template<typename T = length>
scifir::coordinates_ndr< T >::coordinates_ndr ( const angle new_latitude,
const angle new_longitude,
const scalar_unit new_altitude,
const angle new_theta,
const angle new_phi 
)
inlineexplicit

Definition at line 119 of file coordinates_ndr.hpp.

119 : values(),angles()
120 {
121 values.push_back(T(new_altitude * scifir::cos(new_latitude) * scifir::cos(new_longitude)));
122 values.push_back(T(new_altitude * scifir::cos(new_latitude) * scifir::sin(new_longitude)));
123 values.push_back(T(new_altitude * scifir::sin(new_latitude)));
124 angles.push_back(new_theta);
125 angles.push_back(new_phi);
126 }

◆ coordinates_ndr() [13/17]

template<typename T = length>
template<typename U >
scifir::coordinates_ndr< T >::coordinates_ndr ( const coordinates_nd< U > &  new_coordinates,
const vector< float > &  new_angles 
)
inlineexplicit

Definition at line 129 of file coordinates_ndr.hpp.

129 : values(),angles()
130 {
131 if (new_coordinates.values.size() == (new_angles.size() + 1))
132 {
133 for(const U& x_value : new_coordinates.values)
134 {
135 values.push_back(T(x_value));
136 }
137 for(const float& x_angle : new_angles)
138 {
139 angles.push_back(angle(x_angle));
140 }
141 }
142 }

◆ coordinates_ndr() [14/17]

template<typename T = length>
template<typename U >
scifir::coordinates_ndr< T >::coordinates_ndr ( coordinates_nd< U > &&  new_coordinates,
const vector< float > &  new_angles 
)
inlineexplicit

Definition at line 145 of file coordinates_ndr.hpp.

145 : values(),angles()
146 {
147 if (new_coordinates.values.size() == (new_angles.size() + 1))
148 {
149 for(const U& x_value : new_coordinates.values)
150 {
151 values.push_back(T(std::move(x_value)));
152 }
153 for(const float& x_angle : new_angles)
154 {
155 angles.push_back(angle(x_angle));
156 }
157 }
158 }

◆ coordinates_ndr() [15/17]

template<typename T = length>
template<typename U >
scifir::coordinates_ndr< T >::coordinates_ndr ( const coordinates_nd< U > &  new_coordinates,
const vector< angle > &  new_angles 
)
inlineexplicit

Definition at line 161 of file coordinates_ndr.hpp.

161 : values(),angles()
162 {
163 if (new_coordinates.values.size() == (new_angles.size() + 1))
164 {
165 for(const U& x_value : new_coordinates.values)
166 {
167 values.push_back(T(x_value));
168 }
169 angles = new_angles;
170 }
171 }

◆ coordinates_ndr() [16/17]

template<typename T = length>
template<typename U >
scifir::coordinates_ndr< T >::coordinates_ndr ( coordinates_nd< U > &&  new_coordinates,
const vector< angle > &  new_angles 
)
inlineexplicit

Definition at line 174 of file coordinates_ndr.hpp.

174 : values(),angles()
175 {
176 if (new_coordinates.values.size() == (new_angles.size() + 1))
177 {
178 for(const U& x_value : new_coordinates.values)
179 {
180 values.push_back(T(std::move(x_value)));
181 }
182 angles = new_angles;
183 }
184 }

◆ coordinates_ndr() [17/17]

template<typename T = length>
scifir::coordinates_ndr< T >::coordinates_ndr ( const string init_coordinates_ndr)
inlineexplicit

Definition at line 186 of file coordinates_ndr.hpp.

186 : values(),angles()
187 {
188 initialize_from_string(init_coordinates_ndr);
189 }
void initialize_from_string(string init_coordinates_ndr)

Member Function Documentation

◆ change_nd() [1/2]

template<typename T = length>
void scifir::coordinates_ndr< T >::change_nd ( const vector< scalar_unit > &  new_values,
const vector< angle > &  new_angles 
)
inline

Definition at line 282 of file coordinates_ndr.hpp.

283 {
284 if (new_values.size() == (new_angles.size() + 1))
285 {
286 values.clear();
287 for(const scalar_unit& x_value : new_values)
288 {
289 values.push_back(T(x_value));
290 }
291 angles = new_angles;
292 }
293 }

◆ change_nd() [2/2]

template<typename T = length>
void scifir::coordinates_ndr< T >::change_nd ( const vector< scalar_unit > &  new_values,
const vector< float > &  new_angles 
)
inline

Definition at line 265 of file coordinates_ndr.hpp.

266 {
267 if (new_values.size() == (new_angles.size() + 1))
268 {
269 values.clear();
270 for(const scalar_unit& x_value : new_values)
271 {
272 values.push_back(T(x_value));
273 }
274 angles.clear();
275 for(const float& x_angle : new_angles)
276 {
277 angles.push_back(angle(x_angle));
278 }
279 }
280 }

◆ display_cartesian_2d()

template<typename T = length>
string scifir::coordinates_ndr< T >::display_cartesian_2d ( ) const
inline

Definition at line 883 of file coordinates_ndr.hpp.

884 {
885 if (values.size() == 2 and angles.size() == 1)
886 {
887 ostringstream out;
888 out << "(";
889 if (get_nd() == 2)
890 {
891 out << values[0] << "," << values[1] << ";" << angles[0];
892 }
893 out << ")";
894 return out.str();
895 }
896 else
897 {
898 return "[no-2d]";
899 }
900 }

◆ display_cartesian_3d()

template<typename T = length>
string scifir::coordinates_ndr< T >::display_cartesian_3d ( ) const
inline

Definition at line 921 of file coordinates_ndr.hpp.

922 {
923 if (values.size() == 3 and angles.size() == 2)
924 {
925 ostringstream out;
926 out << "(";
927 if (get_nd() == 3)
928 {
929 out << values[0] << "," << values[1] << "," << values[2] << ";" << angles[0] << "," << angles[1];
930 }
931 out << ")";
932 return out.str();
933 }
934 else
935 {
936 return "[no-3d]";
937 }
938 }

◆ display_cylindrical()

template<typename T = length>
string scifir::coordinates_ndr< T >::display_cylindrical ( ) const
inline

Definition at line 940 of file coordinates_ndr.hpp.

941 {
942 if (values.size() == 3 and angles.size() == 2)
943 {
944 ostringstream out;
945 out << "(";
946 if (get_nd() == 3)
947 {
948 out << get_p() << "," << get_spherical_theta() << "," << values[2] << ";" << angles[0] << "," << angles[1];
949 }
950 out << ")";
951 return out.str();
952 }
953 else
954 {
955 return "[no-3d]";
956 }
957 }

◆ display_geographical()

template<typename T = length>
string scifir::coordinates_ndr< T >::display_geographical ( ) const
inline

Definition at line 978 of file coordinates_ndr.hpp.

979 {
980 if (values.size() == 3 and angles.size() == 2)
981 {
982 ostringstream out;
983 out << "(";
984 if (get_nd() == 3)
985 {
986 out << get_latitude() << "," << get_longitude() << "," << get_altitude() << ";" << angles[0] << "," << angles[1];
987 }
988 out << ")";
989 return out.str();
990 }
991 else
992 {
993 return "[no-3d]";
994 }
995 }
scalar_unit get_altitude() const
latitude get_latitude() const
longitude get_longitude() const

◆ display_polar()

template<typename T = length>
string scifir::coordinates_ndr< T >::display_polar ( ) const
inline

Definition at line 902 of file coordinates_ndr.hpp.

903 {
904 if (values.size() == 2 and angles.size() == 1)
905 {
906 ostringstream out;
907 out << "(";
908 if (get_nd() == 2)
909 {
910 out << get_p() << "," << get_spherical_theta() << ";" << angles[0];
911 }
912 out << ")";
913 return out.str();
914 }
915 else
916 {
917 return "[no-2d]";
918 }
919 }

◆ display_spherical()

template<typename T = length>
string scifir::coordinates_ndr< T >::display_spherical ( ) const
inline

Definition at line 959 of file coordinates_ndr.hpp.

960 {
961 if (values.size() == 3 and angles.size() == 2)
962 {
963 ostringstream out;
964 out << "(";
965 if (get_nd() == 3)
966 {
967 out << get_r() << "," << get_spherical_theta() << "," << get_spherical_phi() << ";" << angles[0] << "," << angles[1];
968 }
969 out << ")";
970 return out.str();
971 }
972 else
973 {
974 return "[no-3d]";
975 }
976 }

◆ distance_to_origin()

template<typename T = length>
T scifir::coordinates_ndr< T >::distance_to_origin ( ) const
inline

Definition at line 873 of file coordinates_ndr.hpp.

874 {
875 scalar_unit x_T = scalar_unit(0.0f,"m2");
876 for (int i = 0; i < values.size(); i++)
877 {
878 x_T += scifir::pow(values[i],2);
879 }
880 return T(scifir::sqrt(x_T));
881 }
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

◆ get_altitude()

template<typename T = length>
scalar_unit scifir::coordinates_ndr< T >::get_altitude ( ) const
inline

Definition at line 457 of file coordinates_ndr.hpp.

458 {
459 if (get_nd() == 3)
460 {
461 return ECEF_to_LLA_altitude(values[0],values[1],values[2]);
462 }
463 else
464 {
465 return scalar_unit();
466 }
467 }
scalar_unit ECEF_to_LLA_altitude(const scalar_unit &x, scalar_unit y, const scalar_unit &z)

◆ get_angle() [1/2]

template<typename T = length>
angle & scifir::coordinates_ndr< T >::get_angle ( int  i)
inline

Definition at line 373 of file coordinates_ndr.hpp.

374 {
375 if (i < (values.size() - 1))
376 {
377 return angles[i];
378 }
379 else
380 {
382 }
383 }
angle coordinates_ndr_no_angle

◆ get_angle() [2/2]

template<typename T = length>
const angle & scifir::coordinates_ndr< T >::get_angle ( int  i) const
inline

Definition at line 361 of file coordinates_ndr.hpp.

362 {
363 if (i < (values.size() - 1))
364 {
365 return angles[i];
366 }
367 else
368 {
370 }
371 }

◆ get_angles()

template<typename T = length>
const vector< angle > & scifir::coordinates_ndr< T >::get_angles ( ) const
inline

Definition at line 336 of file coordinates_ndr.hpp.

337 {
338 return angles;
339 }

◆ get_latitude()

template<typename T = length>
latitude scifir::coordinates_ndr< T >::get_latitude ( ) const
inline

Definition at line 433 of file coordinates_ndr.hpp.

434 {
435 if (get_nd() == 3)
436 {
437 return ECEF_to_LLA_latitude(values[0],values[1],values[2]);
438 }
439 else
440 {
441 return latitude();
442 }
443 }
latitude ECEF_to_LLA_latitude(const scalar_unit &x, scalar_unit y, const scalar_unit &z)

◆ get_longitude()

template<typename T = length>
longitude scifir::coordinates_ndr< T >::get_longitude ( ) const
inline

Definition at line 445 of file coordinates_ndr.hpp.

446 {
447 if (get_nd() == 3)
448 {
449 return ECEF_to_LLA_longitude(values[0],values[1],values[2]);
450 }
451 else
452 {
453 return longitude();
454 }
455 }
longitude ECEF_to_LLA_longitude(const scalar_unit &x, scalar_unit y, const scalar_unit &z)

◆ get_nd()

template<typename T = length>
int scifir::coordinates_ndr< T >::get_nd ( ) const
inline

Definition at line 260 of file coordinates_ndr.hpp.

261 {
262 return values.size();
263 }

◆ get_p()

template<typename T = length>
T scifir::coordinates_ndr< T >::get_p ( ) const
inline

Definition at line 385 of file coordinates_ndr.hpp.

386 {
387 if (get_nd() == 2 or get_nd() == 3)
388 {
389 return T(scifir::sqrt(scifir::pow(values[0],2) + scifir::pow(values[1],2)));
390 }
391 else
392 {
393 return T();
394 }
395 }

◆ get_r()

template<typename T = length>
T scifir::coordinates_ndr< T >::get_r ( ) const
inline

Definition at line 409 of file coordinates_ndr.hpp.

410 {
411 if (get_nd() == 2 or get_nd() == 3)
412 {
413 return T(scifir::sqrt(scifir::pow(values[0],2) + scifir::pow(values[1],2) + scifir::pow(values[2],2)));
414 }
415 else
416 {
417 return T();
418 }
419 }

◆ get_spherical_phi()

template<typename T = length>
angle scifir::coordinates_ndr< T >::get_spherical_phi ( ) const
inline

Definition at line 421 of file coordinates_ndr.hpp.

422 {
423 if (get_nd() == 3)
424 {
425 return angle(scifir::acos_degree(float(values[2]/scifir::sqrt(scifir::pow(values[0],2) + scifir::pow(values[1],2) + scifir::pow(values[2],2)))));
426 }
427 else
428 {
429 return angle();
430 }
431 }
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

◆ get_spherical_theta()

template<typename T = length>
angle scifir::coordinates_ndr< T >::get_spherical_theta ( ) const
inline

Definition at line 397 of file coordinates_ndr.hpp.

398 {
399 if (get_nd() == 2 or get_nd() == 3)
400 {
401 return angle(scifir::atan_degree(float(values[1]/values[0])));
402 }
403 else
404 {
405 return angle();
406 }
407 }
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

◆ get_value() [1/2]

template<typename T = length>
T & scifir::coordinates_ndr< T >::get_value ( int  i)
inline

Definition at line 324 of file coordinates_ndr.hpp.

325 {
326 if (i < (values.size()))
327 {
328 return values[i];
329 }
330 else
331 {
332 return no_value;
333 }
334 }

◆ get_value() [2/2]

template<typename T = length>
const T & scifir::coordinates_ndr< T >::get_value ( int  i) const
inline

Definition at line 312 of file coordinates_ndr.hpp.

313 {
314 if (i < (values.size()))
315 {
316 return values[i];
317 }
318 else
319 {
320 return no_value;
321 }
322 }

◆ get_values()

template<typename T = length>
const vector< T > & scifir::coordinates_ndr< T >::get_values ( ) const
inline

Definition at line 295 of file coordinates_ndr.hpp.

296 {
297 return values;
298 }

◆ initialize_from_string()

template<typename T = length>
void scifir::coordinates_ndr< T >::initialize_from_string ( string  init_coordinates_ndr)
inlineprivate

Definition at line 1002 of file coordinates_ndr.hpp.

1003 {
1004 vector<string> init_coordinates;
1005 vector<string> init_values;
1006 vector<string> init_angles;
1007 if (init_coordinates_ndr.front() == '(')
1008 {
1009 init_coordinates_ndr.erase(0,1);
1010 }
1011 if (init_coordinates_ndr.back() == ')')
1012 {
1013 init_coordinates_ndr.erase(init_coordinates_ndr.size()-1,1);
1014 }
1015 boost::split(init_coordinates,init_coordinates_ndr,boost::is_any_of(";"));
1016 if (init_coordinates.size() > 0)
1017 {
1018 boost::split(init_values,init_coordinates[0],boost::is_any_of(","));
1019 }
1020 if (init_coordinates.size() > 1)
1021 {
1022 boost::split(init_angles,init_coordinates[1],boost::is_any_of(","));
1023 }
1024 for (const string& x_value : init_values)
1025 {
1026 if (x_value == "")
1027 {
1028 return;
1029 }
1030 }
1031 for (const string& x_value : init_angles)
1032 {
1033 if (x_value == "")
1034 {
1035 return;
1036 }
1037 }
1038 if (init_values.size() == 2 and init_angles.size() == 1)
1039 {
1040 if (is_angle(init_values[1]))
1041 {
1042 values.push_back(T(T(init_values[0]) * scifir::cos(angle(init_values[1]))));
1043 values.push_back(T(T(init_values[0]) * scifir::sin(angle(init_values[1]))));
1044 }
1045 else
1046 {
1047 values.push_back(T(init_values[0]));
1048 values.push_back(T(init_values[1]));
1049 }
1050 angles.push_back(angle(init_angles[0]));
1051 }
1052 else if (init_values.size() == 3 and init_angles.size() == 2)
1053 {
1054 if (is_latitude(init_values[0]))
1055 {
1056 if (is_longitude(init_values[1]))
1057 {
1058 if (!is_angle(init_values[2]))
1059 {
1060 values.push_back(T(T(init_values[2]) * scifir::cos(angle(init_values[0])) * scifir::cos(angle(init_values[1]))));
1061 values.push_back(T(T(init_values[2]) * scifir::cos(angle(init_values[0])) * scifir::sin(angle(init_values[1]))));
1062 values.push_back(T(T(init_values[2]) * scifir::sin(angle(init_values[0]))));
1063 }
1064 }
1065 }
1066 else
1067 {
1068 if (is_angle(init_values[1]))
1069 {
1070 if (is_angle(init_values[2]))
1071 {
1072 values.push_back(T(T(init_values[0]) * scifir::cos(angle(init_values[1])) * scifir::sin(angle(init_values[2]))));
1073 values.push_back(T(T(init_values[0]) * scifir::sin(angle(init_values[1])) * scifir::sin(angle(init_values[2]))));
1074 values.push_back(T(T(init_values[0]) * scifir::cos(angle(init_values[2]))));
1075 }
1076 else
1077 {
1078 values.push_back(T(T(init_values[0]) * scifir::cos(angle(init_values[1]))));
1079 values.push_back(T(T(init_values[0]) * scifir::sin(angle(init_values[1]))));
1080 values.push_back(T(init_values[2]));
1081 }
1082 }
1083 else
1084 {
1085 if (!is_angle(init_values[2]))
1086 {
1087 values.push_back(T(init_values[0]));
1088 values.push_back(T(init_values[1]));
1089 values.push_back(T(init_values[2]));
1090 }
1091 }
1092 }
1093 angles.push_back(angle(init_angles[0]));
1094 angles.push_back(angle(init_angles[1]));
1095 }
1096 else
1097 {
1098 if (init_values.size() == (init_angles.size() + 1))
1099 {
1100 for (int i = 0; i < init_values.size(); i++)
1101 {
1102 values.push_back(T(init_values[i]));
1103 }
1104 for (int i = 0; i < init_angles.size(); i++)
1105 {
1106 angles.push_back(angle(init_angles[i]));
1107 }
1108 }
1109 }
1110 }
bool is_latitude(const string &init_latitude)
Definition latitude.cpp:199
bool is_longitude(const string &init_longitude)
bool is_angle(const string &init_angle)
Checks if some string is an initialization string of an angle.
Definition angle.cpp:336

◆ is_nd()

template<typename T = length>
bool scifir::coordinates_ndr< T >::is_nd ( int  i) const
inline

Definition at line 255 of file coordinates_ndr.hpp.

256 {
257 return values.size() == i;
258 }

◆ move() [1/10]

template<typename T = length>
void scifir::coordinates_ndr< T >::move ( const displacement_2d x_displacement)
inline

Definition at line 788 of file coordinates_ndr.hpp.

789 {
790 if (values.size() == 2 and angles.size() == 1)
791 {
792 values[0] += x_displacement.x_projection();
793 values[1] += x_displacement.y_projection();
794 }
795 }

◆ move() [2/10]

template<typename T = length>
void scifir::coordinates_ndr< T >::move ( const displacement_3d x_displacement)
inline

Definition at line 815 of file coordinates_ndr.hpp.

816 {
817 if (values.size() == 3 and angles.size() == 2)
818 {
819 values[0] += x_displacement.x_projection();
820 values[1] += x_displacement.y_projection();
821 values[2] += x_displacement.z_projection();
822 }
823 }

◆ move() [3/10]

template<typename T = length>
void scifir::coordinates_ndr< T >::move ( const displacement_nd x_displacement)
inline

Definition at line 856 of file coordinates_ndr.hpp.

857 {
858 if (x_displacement.get_nd() == get_nd())
859 {
860 for (int i = 0; i < x_displacement.get_nd(); i++)
861 {
862 values[i] += x_displacement.n_projection(i);
863 }
864 }
865 }

◆ move() [4/10]

template<typename T = length>
void scifir::coordinates_ndr< T >::move ( const scalar_unit new_p,
const angle new_theta 
)
inline

Definition at line 806 of file coordinates_ndr.hpp.

807 {
808 if (values.size() == 2 and angles.size() == 1)
809 {
810 values[0] += new_p * scifir::cos(new_theta);
811 values[1] += new_p * scifir::sin(new_theta);
812 }
813 }

◆ move() [5/10]

template<typename T = length>
void scifir::coordinates_ndr< T >::move ( const scalar_unit new_p,
const angle new_theta,
scalar_unit  new_z 
)
inline

Definition at line 835 of file coordinates_ndr.hpp.

836 {
837 if (values.size() == 3 and angles.size() == 2)
838 {
839 new_z.change_dimensions(new_p);
840 values[0] += T(new_p * scifir::cos(new_theta));
841 values[1] += T(new_p * scifir::sin(new_theta));
842 values[2] += new_z;
843 }
844 }

◆ move() [6/10]

template<typename T = length>
void scifir::coordinates_ndr< T >::move ( const scalar_unit new_r,
const angle new_theta,
const angle new_phi 
)
inline

Definition at line 846 of file coordinates_ndr.hpp.

847 {
848 if (values.size() == 3 and angles.size() == 2)
849 {
850 values[0] += T(new_r * scifir::cos(new_theta) * scifir::sin(new_phi));
851 values[1] += T(new_r * scifir::sin(new_theta) * scifir::sin(new_phi));
852 values[2] += T(new_r * scifir::cos(new_phi));
853 }
854 }

◆ move() [7/10]

template<typename T = length>
void scifir::coordinates_ndr< T >::move ( const scalar_unit new_r,
const vector< angle > &  new_angles 
)
inline

Definition at line 867 of file coordinates_ndr.hpp.

868 {
869 displacement_nd x_displacement = displacement_nd(new_r,new_angles);
870 move(x_displacement);
871 }
void move(const scalar_unit &new_x)

◆ move() [8/10]

template<typename T = length>
void scifir::coordinates_ndr< T >::move ( const scalar_unit new_x)
inline

Definition at line 780 of file coordinates_ndr.hpp.

781 {
782 if (values.size() == 1 and angles.size() == 0)
783 {
784 values[0] += new_x;
785 }
786 }

◆ move() [9/10]

template<typename T = length>
void scifir::coordinates_ndr< T >::move ( const scalar_unit new_x,
const scalar_unit new_y 
)
inline

Definition at line 797 of file coordinates_ndr.hpp.

798 {
799 if (values.size() == 2 and angles.size() == 1)
800 {
801 values[0] += new_x;
802 values[1] += new_y;
803 }
804 }

◆ move() [10/10]

template<typename T = length>
void scifir::coordinates_ndr< T >::move ( const scalar_unit new_x,
const scalar_unit new_y,
const scalar_unit new_z 
)
inline

Definition at line 825 of file coordinates_ndr.hpp.

826 {
827 if (values.size() == 3 and angles.size() == 2)
828 {
829 values[0] += new_x;
830 values[1] += new_y;
831 values[2] += new_z;
832 }
833 }

◆ operator=() [1/5]

template<typename T = length>
template<typename U >
coordinates_ndr< T > & scifir::coordinates_ndr< T >::operator= ( const coordinates_nd< U > &  x_coordinates)
inline

Definition at line 212 of file coordinates_ndr.hpp.

213 {
214 if (x_coordinates.values.size() == (angles.size() + 1))
215 {
216 values.clear();
217 for(const U& x_value : x_coordinates.values)
218 {
219 values.push_back(T(x_value));
220 }
221 }
222 return *this;
223 }

◆ operator=() [2/5]

template<typename T = length>
coordinates_ndr< T > & scifir::coordinates_ndr< T >::operator= ( const coordinates_ndr< T > &  x_coordinates)
inline

Definition at line 191 of file coordinates_ndr.hpp.

192 {
193 if (x_coordinates.values.size() == (x_coordinates.angles.size() + 1))
194 {
195 values = x_coordinates.values;
196 angles = x_coordinates.angles;
197 }
198 return *this;
199 }

◆ operator=() [3/5]

template<typename T = length>
coordinates_ndr< T > & scifir::coordinates_ndr< T >::operator= ( const string init_coordinates_ndr)
inline

Definition at line 239 of file coordinates_ndr.hpp.

240 {
241 initialize_from_string(init_coordinates_ndr);
242 return *this;
243 }

◆ operator=() [4/5]

template<typename T = length>
template<typename U >
coordinates_ndr< T > & scifir::coordinates_ndr< T >::operator= ( coordinates_nd< U > &&  x_coordinates)
inline

Definition at line 226 of file coordinates_ndr.hpp.

227 {
228 if (x_coordinates.values.size() == (angles.size() + 1))
229 {
230 values.clear();
231 for(const U& x_value : x_coordinates.values)
232 {
233 values.push_back(T(std::move(x_value)));
234 }
235 }
236 return *this;
237 }

◆ operator=() [5/5]

template<typename T = length>
coordinates_ndr< T > & scifir::coordinates_ndr< T >::operator= ( coordinates_ndr< T > &&  x_coordinates)
inline

Definition at line 201 of file coordinates_ndr.hpp.

202 {
203 if (x_coordinates.values.size() == (x_coordinates.angles.size() + 1))
204 {
205 values = std::move(x_coordinates.values);
206 angles = std::move(x_coordinates.angles);
207 }
208 return *this;
209 }

◆ origin()

template<typename T = length>
static coordinates_ndr< T > scifir::coordinates_ndr< T >::origin ( const coordinates_ndr< T > &  origin,
const coordinates_ndr< T > &  coordinates 
)
inlinestatic

Definition at line 245 of file coordinates_ndr.hpp.

246 {
247 coordinates_ndr<T> new_coordinates(origin);
248 for (unsigned int i = 0; i < coordinates.values.size(); i++)
249 {
250 new_coordinates.get_value(i) += coordinates.get_value(i);
251 }
252 return new_coordinates;
253 }
static coordinates_ndr< T > origin(const coordinates_ndr< T > &origin, const coordinates_ndr< T > &coordinates)

◆ point_to()

template<typename T = length>
void scifir::coordinates_ndr< T >::point_to ( direction::name  x)
inline

Definition at line 469 of file coordinates_ndr.hpp.

470 {
471 if (is_nd(1))
472 {
473 if (x == direction::LEFT)
474 {
475 if (values[0] > 0)
476 {
477 values[0] *= -1;
478 }
479 }
480 else if(x == direction::RIGHT)
481 {
482 if (values[0] < 0)
483 {
484 values[0] *= -1;
485 }
486 }
487 }
488 else if (is_nd(2))
489 {
490 if (x == direction::LEFT)
491 {
492 angles[0] = 180.0f;
493 }
494 else if(x == direction::RIGHT)
495 {
496 angles[0] = 0.0f;
497 }
498 else if(x == direction::TOP)
499 {
500 angles[0] = 90.0f;
501 }
502 else if(x == direction::BOTTOM)
503 {
504 angles[0] = 270.0f;
505 }
506 else if(x == direction::LEFT_TOP)
507 {
508 angles[0] = 135.0f;
509 }
510 else if(x == direction::RIGHT_TOP)
511 {
512 angles[0] = 45.0f;
513 }
514 else if(x == direction::RIGHT_BOTTOM)
515 {
516 angles[0] = 315.0f;
517 }
518 else if(x == direction::LEFT_BOTTOM)
519 {
520 angles[0] = 225.0f;
521 }
522 }
523 else if (is_nd(3))
524 {
525 if (x == direction::LEFT)
526 {
527 angles[0] = 270.0f;
528 angles[1] = 90.0f;
529 }
530 else if(x == direction::RIGHT)
531 {
532 angles[0] = 90.0f;
533 angles[1] = 90.0f;
534 }
535 else if(x == direction::TOP)
536 {
537 angles[0] = 0.0f;
538 angles[1] = 0.0f;
539 }
540 else if(x == direction::BOTTOM)
541 {
542 angles[0] = 0.0f;
543 angles[1] = 180.0f;
544 }
545 else if(x == direction::LEFT_TOP)
546 {
547 angles[0] = 270.0f;
548 angles[1] = 45.0f;
549 }
550 else if(x == direction::RIGHT_TOP)
551 {
552 angles[0] = 90.0f;
553 angles[1] = 45.0f;
554 }
555 else if(x == direction::RIGHT_BOTTOM)
556 {
557 angles[0] = 90.0f;
558 angles[1] = 135.0f;
559 }
560 else if(x == direction::LEFT_BOTTOM)
561 {
562 angles[0] = 270.0f;
563 angles[1] = 135.0f;
564 }
565 else if(x == direction::FRONT)
566 {
567 angles[0] = 0.0f;
568 angles[1] = 90.0f;
569 }
570 else if(x == direction::BACK)
571 {
572 angles[0] = 180.0f;
573 angles[1] = 90.0f;
574 }
575 else if(x == direction::LEFT_FRONT)
576 {
577 angles[0] = 315.0f;
578 angles[1] = 90.0f;
579 }
580 else if(x == direction::RIGHT_FRONT)
581 {
582 angles[0] = 45.0f;
583 angles[1] = 90.0f;
584 }
585 else if(x == direction::TOP_FRONT)
586 {
587 angles[0] = 0.0f;
588 angles[1] = 45.0f;
589 }
590 else if(x == direction::BOTTOM_FRONT)
591 {
592 angles[0] = 0.0f;
593 angles[1] = 135.0f;
594 }
595 else if(x == direction::LEFT_BACK)
596 {
597 angles[0] = 225.0f;
598 angles[1] = 90.0f;
599 }
600 else if(x == direction::RIGHT_BACK)
601 {
602 angles[0] = 135.0f;
603 angles[1] = 90.0f;
604 }
605 else if(x == direction::TOP_BACK)
606 {
607 angles[0] = 180.0f;
608 angles[1] = 45.0f;
609 }
610 else if(x == direction::BOTTOM_BACK)
611 {
612 angles[0] = 180.0f;
613 angles[1] = 135.0f;
614 }
615 else if(x == direction::LEFT_TOP_FRONT)
616 {
617 angles[0] = 315.0f;
618 angles[1] = 45.0f;
619 }
620 else if(x == direction::RIGHT_TOP_FRONT)
621 {
622 angles[0] = 45.0f;
623 angles[1] = 45.0f;
624 }
625 else if(x == direction::LEFT_BOTTOM_FRONT)
626 {
627 angles[0] = 315.0f;
628 angles[1] = 135.0f;
629 }
631 {
632 angles[0] = 45.0f;
633 angles[1] = 135.0f;
634 }
635 else if(x == direction::LEFT_TOP_BACK)
636 {
637 angles[0] = 225.0f;
638 angles[1] = 45.0f;
639 }
640 else if(x == direction::RIGHT_TOP_BACK)
641 {
642 angles[0] = 135.0f;
643 angles[1] = 45.0f;
644 }
645 else if(x == direction::LEFT_BOTTOM_BACK)
646 {
647 angles[0] = 225.0f;
648 angles[1] = 135.0f;
649 }
650 else if(x == direction::RIGHT_BOTTOM_BACK)
651 {
652 angles[0] = 135.0f;
653 angles[1] = 135.0f;
654 }
655 }
656 }

◆ rotate_in_2d()

template<typename T = length>
void scifir::coordinates_ndr< T >::rotate_in_2d ( const angle new_theta)
inline

Definition at line 741 of file coordinates_ndr.hpp.

742 {
743 if (get_nd() == 2)
744 {
745 T x_coord = values[0];
746 T y_coord = values[1];
747 values[0] = x_coord * scifir::cos(new_theta) - y_coord * scifir::sin(new_theta);
748 values[1] = x_coord * scifir::sin(new_theta) + y_coord * scifir::cos(new_theta);
749 }
750 }

◆ rotate_in_3d()

template<typename T = length>
void scifir::coordinates_ndr< T >::rotate_in_3d ( int  axis,
const angle new_theta 
)
inline

Definition at line 752 of file coordinates_ndr.hpp.

753 {
754 if (get_nd() == 3)
755 {
756 if (axis == 1)
757 {
758 T y_coord = values[1];
759 T z_coord = values[2];
760 values[1] = y_coord * scifir::cos(new_theta) - z_coord * scifir::sin(new_theta);
761 values[2] = y_coord * scifir::sin(new_theta) + z_coord * scifir::cos(new_theta);
762 }
763 else if (axis == 2)
764 {
765 T x_coord = values[0];
766 T z_coord = values[2];
767 values[0] = x_coord * scifir::cos(new_theta) - z_coord * scifir::sin(new_theta);
768 values[2] = x_coord * scifir::sin(new_theta) + z_coord * scifir::cos(new_theta);
769 }
770 else if (axis == 3)
771 {
772 T x_coord = values[0];
773 T y_coord = values[1];
774 values[0] = x_coord * scifir::cos(new_theta) - y_coord * scifir::sin(new_theta);
775 values[1] = x_coord * scifir::sin(new_theta) + y_coord * scifir::cos(new_theta);
776 }
777 }
778 }

◆ set_angles() [1/2]

template<typename T = length>
void scifir::coordinates_ndr< T >::set_angles ( const vector< angle > &  new_angles)
inline

Definition at line 353 of file coordinates_ndr.hpp.

354 {
355 if (values.size() == (new_angles.size() + 1))
356 {
357 angles = new_angles;
358 }
359 }

◆ set_angles() [2/2]

template<typename T = length>
void scifir::coordinates_ndr< T >::set_angles ( const vector< float > &  new_angles)
inline

Definition at line 341 of file coordinates_ndr.hpp.

342 {
343 if (values.size() == (new_angles.size() + 1))
344 {
345 angles.clear();
346 for(const float& x_angle : new_angles)
347 {
348 angles.push_back(angle(x_angle));
349 }
350 }
351 }

◆ set_position() [1/8]

template<typename T = length>
void scifir::coordinates_ndr< T >::set_position ( const angle new_latitude,
const angle new_longitude,
const scalar_unit new_altitude 
)
inline

Definition at line 721 of file coordinates_ndr.hpp.

722 {
723 if (values.size() == 3 and angles.size() == 2)
724 {
725 values.clear();
726 values.push_back(T(new_altitude * scifir::cos(new_latitude) * scifir::cos(new_longitude)));
727 values.push_back(T(new_altitude * scifir::cos(new_latitude) * scifir::sin(new_longitude)));
728 values.push_back(T(new_altitude * scifir::sin(new_latitude)));
729 }
730 }

◆ set_position() [2/8]

template<typename T = length>
void scifir::coordinates_ndr< T >::set_position ( const scalar_unit new_p,
const angle new_theta 
)
inline

Definition at line 677 of file coordinates_ndr.hpp.

678 {
679 if (values.size() == 2 and angles.size() == 1)
680 {
681 values.clear();
682 values.push_back(T(new_p * scifir::cos(new_theta)));
683 values.push_back(T(new_p * scifir::sin(new_theta)));
684 }
685 }

◆ set_position() [3/8]

template<typename T = length>
void scifir::coordinates_ndr< T >::set_position ( const scalar_unit new_p,
const angle new_theta,
scalar_unit  new_z 
)
inline

Definition at line 698 of file coordinates_ndr.hpp.

699 {
700 if (values.size() == 3 and angles.size() == 2)
701 {
702 values.clear();
703 new_z.change_dimensions(new_p);
704 values.push_back(T(new_p * scifir::cos(new_theta)));
705 values.push_back(T(new_p * scifir::sin(new_theta)));
706 values.push_back(T(new_z));
707 }
708 }

◆ set_position() [4/8]

template<typename T = length>
void scifir::coordinates_ndr< T >::set_position ( const scalar_unit new_r,
const angle new_theta,
const angle new_phi 
)
inline

Definition at line 710 of file coordinates_ndr.hpp.

711 {
712 if (values.size() == 3 and angles.size() == 2)
713 {
714 values.clear();
715 values.push_back(T(new_r * scifir::cos(new_theta) * scifir::sin(new_phi)));
716 values.push_back(T(new_r * scifir::sin(new_theta) * scifir::sin(new_phi)));
717 values.push_back(T(new_r * scifir::cos(new_phi)));
718 }
719 }

◆ set_position() [5/8]

template<typename T = length>
void scifir::coordinates_ndr< T >::set_position ( const scalar_unit new_x)
inline

Definition at line 658 of file coordinates_ndr.hpp.

659 {
660 if (values.size() == 1 and angles.size() == 0)
661 {
662 values.clear();
663 values.push_back(new_x);
664 }
665 }

◆ set_position() [6/8]

template<typename T = length>
void scifir::coordinates_ndr< T >::set_position ( const scalar_unit new_x,
const scalar_unit new_y 
)
inline

Definition at line 667 of file coordinates_ndr.hpp.

668 {
669 if (values.size() == 2 and angles.size() == 1)
670 {
671 values.clear();
672 values.push_back(new_x);
673 values.push_back(new_y);
674 }
675 }

◆ set_position() [7/8]

template<typename T = length>
void scifir::coordinates_ndr< T >::set_position ( const scalar_unit new_x,
const scalar_unit new_y,
const scalar_unit new_z 
)
inline

Definition at line 687 of file coordinates_ndr.hpp.

688 {
689 if (values.size() == 3 and angles.size() == 2)
690 {
691 values.clear();
692 values.push_back(T(new_x));
693 values.push_back(T(new_y));
694 values.push_back(T(new_z));
695 }
696 }

◆ set_position() [8/8]

template<typename T = length>
void scifir::coordinates_ndr< T >::set_position ( const vector< scalar_unit > &  new_values)
inline

Definition at line 732 of file coordinates_ndr.hpp.

733 {
734 if (values.size() == new_values.size() and new_values.size() == (angles.size() + 1))
735 {
736 values.clear();
737 values = new_values;
738 }
739 }

◆ set_values()

template<typename T = length>
void scifir::coordinates_ndr< T >::set_values ( const vector< scalar_unit > &  new_values)
inline

Definition at line 300 of file coordinates_ndr.hpp.

301 {
302 if (values.size() == new_values.size())
303 {
304 values.clear();
305 for(const scalar_unit& x_value : new_values)
306 {
307 values.push_back(T(x_value));
308 }
309 }
310 }

Member Data Documentation

◆ angles

template<typename T = length>
vector<angle> scifir::coordinates_ndr< T >::angles
private

Definition at line 999 of file coordinates_ndr.hpp.

◆ no_value

template<typename T >
T scifir::coordinates_ndr< T >::no_value = T()
staticprivate

Definition at line 1000 of file coordinates_ndr.hpp.

◆ values

template<typename T = length>
vector<T> scifir::coordinates_ndr< T >::values
private

Definition at line 998 of file coordinates_ndr.hpp.


The documentation for this class was generated from the following file: