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

#include <coordinates_3dr.hpp>

Collaboration diagram for scifir::coordinates_3dr< T >:
Collaboration graph
[legend]

Public Member Functions

 coordinates_3dr ()
 
 coordinates_3dr (const coordinates_3dr< T > &x_coordinates)
 
 coordinates_3dr (coordinates_3dr< T > &&x_coordinates)
 
 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)
 
 coordinates_3dr (const scalar_unit &new_p, const angle &new_cylindrical_theta, scalar_unit new_z, 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)
 
 coordinates_3dr (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_3dr (const coordinates_3d< U > &x_coordinates, const angle &new_theta, const angle &new_phi)
 
template<typename U >
 coordinates_3dr (coordinates_3d< U > &&x_coordinates, const angle &new_theta, const angle &new_phi)
 
 coordinates_3dr (const string &init_coordinates_3dr)
 
coordinates_3dr< T > & operator= (const coordinates_3dr< T > &x_coordinates)
 
coordinates_3dr< T > & operator= (coordinates_3dr< T > &&x_coordinates)
 
coordinates_3dr< T > & operator= (const coordinates_3d< T > &x_coordinates)
 
coordinates_3dr< T > & operator= (coordinates_3d< T > &&x_coordinates)
 
coordinates_3dr< T > & operator= (const string &init_coordinates_3dr)
 
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, 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 rotate_in_x (const angle &x_angle)
 
void rotate_in_y (const angle &x_angle)
 
void rotate_in_z (const angle &x_angle)
 
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)
 
T distance_to_origin () const
 
string display_cartesian () const
 
string display_cylindrical () const
 
string display_spherical () const
 
string display_geographical () const
 

Static Public Member Functions

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

Public Attributes

T x
 
T y
 
T z
 
angle theta
 
angle phi
 

Private Member Functions

void initialize_from_string (string init_coordinates_3dr)
 

Detailed Description

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

Definition at line 17 of file coordinates_3dr.hpp.

Constructor & Destructor Documentation

◆ coordinates_3dr() [1/10]

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

◆ coordinates_3dr() [2/10]

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

Definition at line 23 of file coordinates_3dr.hpp.

23 : x(x_coordinates.x),y(x_coordinates.y),z(x_coordinates.z),theta(x_coordinates.theta),phi(x_coordinates.phi)
24 {}

◆ coordinates_3dr() [3/10]

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

Definition at line 26 of file coordinates_3dr.hpp.

26 : x(std::move(x_coordinates.x)),y(std::move(x_coordinates.y)),z(std::move(x_coordinates.z)),theta(std::move(x_coordinates.theta)),phi(std::move(x_coordinates.phi))
27 {}

◆ coordinates_3dr() [4/10]

template<typename T = length>
scifir::coordinates_3dr< T >::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 
)
inlineexplicit

Definition at line 29 of file coordinates_3dr.hpp.

29 : x(new_x),y(new_y),z(new_z),theta(new_theta),phi(new_phi)
30 {}

◆ coordinates_3dr() [5/10]

template<typename T = length>
scifir::coordinates_3dr< T >::coordinates_3dr ( 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 32 of file coordinates_3dr.hpp.

32 : x(),y(),z(),theta(new_theta),phi(new_phi)
33 {
34 set_position(new_p,new_cylindrical_theta,new_z);
35 }
void set_position(const scalar_unit &new_x, const scalar_unit &new_y, const scalar_unit &new_z)

◆ coordinates_3dr() [6/10]

template<typename T = length>
scifir::coordinates_3dr< T >::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 
)
inlineexplicit

Definition at line 37 of file coordinates_3dr.hpp.

37 : x(),y(),z(),theta(new_theta),phi(new_phi)
38 {
39 set_position(new_r,new_spherical_theta,new_spherical_phi);
40 }

◆ coordinates_3dr() [7/10]

template<typename T = length>
scifir::coordinates_3dr< T >::coordinates_3dr ( 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 42 of file coordinates_3dr.hpp.

42 : x(),y(),z(),theta(new_theta),phi(new_phi)
43 {
44 set_position(new_latitude,new_longitude,new_altitude);
45 }

◆ coordinates_3dr() [8/10]

template<typename T = length>
template<typename U >
scifir::coordinates_3dr< T >::coordinates_3dr ( const coordinates_3d< U > &  x_coordinates,
const angle new_theta,
const angle new_phi 
)
inlineexplicit

Definition at line 48 of file coordinates_3dr.hpp.

48 : x(x_coordinates.x),y(x_coordinates.y),z(x_coordinates.z),theta(new_theta),phi(new_phi)
49 {}

◆ coordinates_3dr() [9/10]

template<typename T = length>
template<typename U >
scifir::coordinates_3dr< T >::coordinates_3dr ( coordinates_3d< U > &&  x_coordinates,
const angle new_theta,
const angle new_phi 
)
inlineexplicit

Definition at line 52 of file coordinates_3dr.hpp.

52 : x(std::move(x_coordinates.x)),y(std::move(x_coordinates.y)),z(std::move(x_coordinates.z)),theta(new_theta),phi(new_phi)
53 {}

◆ coordinates_3dr() [10/10]

template<typename T = length>
scifir::coordinates_3dr< T >::coordinates_3dr ( const string init_coordinates_3dr)
inlineexplicit

Definition at line 55 of file coordinates_3dr.hpp.

56 {
57 initialize_from_string(init_coordinates_3dr);
58 }
void initialize_from_string(string init_coordinates_3dr)

Member Function Documentation

◆ display_cartesian()

template<typename T = length>
string scifir::coordinates_3dr< T >::display_cartesian ( ) const
inline

Definition at line 365 of file coordinates_3dr.hpp.

366 {
367 ostringstream out;
368 out << "(" << x << "," << y << "," << z << ";" << theta << "," << phi << ")";
369 return out.str();
370 }

◆ display_cylindrical()

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

Definition at line 372 of file coordinates_3dr.hpp.

373 {
374 ostringstream out;
375 out << "(" << get_p() << "," << get_spherical_theta() << "," << z << ";" << theta << "," << phi << ")";
376 return out.str();
377 }

◆ display_geographical()

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

Definition at line 386 of file coordinates_3dr.hpp.

387 {
388 ostringstream out;
389 out << "(" << get_latitude() << "," << get_longitude() << "," << get_altitude() << ";" << theta << "," << phi << ")";
390 return out.str();
391 }
scalar_unit get_altitude() const
latitude get_latitude() const
longitude get_longitude() const

◆ display_spherical()

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

Definition at line 379 of file coordinates_3dr.hpp.

380 {
381 ostringstream out;
382 out << "(" << get_r() << "," << get_spherical_theta() << "," << get_spherical_phi() << ";" << theta << "," << phi << ")";
383 return out.str();
384 }

◆ distance_to_origin()

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

Definition at line 360 of file coordinates_3dr.hpp.

361 {
362 return T(scifir::sqrt(scifir::pow(x,2) + scifir::pow(y,2) + scifir::pow(z,2)));
363 }
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_3dr< T >::get_altitude ( ) const
inline

Definition at line 139 of file coordinates_3dr.hpp.

140 {
141 return ECEF_to_LLA_altitude(x,y,z);
142 }
scalar_unit ECEF_to_LLA_altitude(const scalar_unit &x, scalar_unit y, const scalar_unit &z)

◆ get_latitude()

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

Definition at line 129 of file coordinates_3dr.hpp.

130 {
131 return ECEF_to_LLA_latitude(x,y,z);
132 }
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_3dr< T >::get_longitude ( ) const
inline

Definition at line 134 of file coordinates_3dr.hpp.

135 {
136 return ECEF_to_LLA_longitude(x,y,z);
137 }
longitude ECEF_to_LLA_longitude(const scalar_unit &x, scalar_unit y, const scalar_unit &z)

◆ get_p()

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

Definition at line 109 of file coordinates_3dr.hpp.

110 {
111 return T(scifir::sqrt(scifir::pow(x,2) + scifir::pow(y,2)));
112 }

◆ get_r()

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

Definition at line 119 of file coordinates_3dr.hpp.

120 {
121 return T(scifir::sqrt(scifir::pow(x,2) + scifir::pow(y,2) + scifir::pow(z,2)));
122 }

◆ get_spherical_phi()

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

Definition at line 124 of file coordinates_3dr.hpp.

125 {
126 return angle(scifir::acos_degree(float(z/scifir::sqrt(scifir::pow(x,2) + scifir::pow(y,2) + scifir::pow(z,2)))));
127 }
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_3dr< T >::get_spherical_theta ( ) const
inline

Definition at line 114 of file coordinates_3dr.hpp.

115 {
116 return scifir::atan(float(y/x));
117 }
angle atan(float x)
Calculates the atan of some value x and returns the result as angle in degrees.
Definition angle.cpp:451

◆ initialize_from_string()

template<typename T = length>
void scifir::coordinates_3dr< T >::initialize_from_string ( string  init_coordinates_3dr)
inlineprivate

Definition at line 400 of file coordinates_3dr.hpp.

401 {
402 vector<string> init_coordinates;
403 vector<string> init_values;
404 vector<string> init_angles;
405 if (init_coordinates_3dr.front() == '(')
406 {
407 init_coordinates_3dr.erase(0,1);
408 }
409 if (init_coordinates_3dr.back() == ')')
410 {
411 init_coordinates_3dr.erase(init_coordinates_3dr.size()-1,1);
412 }
413 boost::split(init_coordinates,init_coordinates_3dr,boost::is_any_of(";"));
414 if (init_coordinates.size() > 0)
415 {
416 boost::split(init_values,init_coordinates[0],boost::is_any_of(","));
417 }
418 if (init_coordinates.size() > 1)
419 {
420 boost::split(init_angles,init_coordinates[1],boost::is_any_of(","));
421 }
422 if (init_values.size() == 3 and init_angles.size() == 2)
423 {
424 if (is_latitude(init_values[0]))
425 {
426 if (is_longitude(init_values[1]))
427 {
428 if (!is_angle(init_values[2]))
429 {
430 set_position(angle(init_values[0]),angle(init_values[1]),T(init_values[2]));
431 }
432 }
433 }
434 else
435 {
436 if (is_angle(init_values[1]))
437 {
438 if (is_angle(init_values[2]))
439 {
440 set_position(T(init_values[0]),angle(init_values[1]),angle(init_values[2]));
441 }
442 else
443 {
444 set_position(T(init_values[0]),angle(init_values[1]),T(init_values[2]));
445 }
446 }
447 else
448 {
449 if (!is_angle(init_values[2]))
450 {
451 set_position(T(init_values[0]),T(init_values[1]),T(init_values[2]));
452 }
453 }
454 }
455 theta = angle(init_angles[0]);
456 phi = angle(init_angles[1]);
457 }
458 }
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

◆ move() [1/4]

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

Definition at line 331 of file coordinates_3dr.hpp.

332 {
333 x += x_displacement.x_projection();
334 y += x_displacement.y_projection();
335 z += x_displacement.z_projection();
336 }

◆ move() [2/4]

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

Definition at line 345 of file coordinates_3dr.hpp.

346 {
347 new_z.change_dimensions(new_p);
348 x += T(new_p * scifir::cos(new_theta));
349 y += T(new_p * scifir::sin(new_theta));
350 z += new_z;
351 }
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

◆ move() [3/4]

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

Definition at line 353 of file coordinates_3dr.hpp.

354 {
355 x += T(new_r * scifir::cos(new_theta) * scifir::sin(new_phi));
356 y += T(new_r * scifir::sin(new_theta) * scifir::sin(new_phi));
357 z += T(new_r * scifir::cos(new_phi));
358 }

◆ move() [4/4]

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

Definition at line 338 of file coordinates_3dr.hpp.

339 {
340 x += new_x;
341 y += new_y;
342 z += new_z;
343 }

◆ operator=() [1/5]

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

Definition at line 80 of file coordinates_3dr.hpp.

81 {
82 x = x_coordinates.x;
83 y = x_coordinates.y;
84 z = x_coordinates.z;
85 return *this;
86 }

◆ operator=() [2/5]

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

Definition at line 60 of file coordinates_3dr.hpp.

61 {
62 x = x_coordinates.x;
63 y = x_coordinates.y;
64 z = x_coordinates.z;
65 theta = x_coordinates.theta;
66 phi = x_coordinates.phi;
67 return *this;
68 }

◆ operator=() [3/5]

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

Definition at line 96 of file coordinates_3dr.hpp.

97 {
98 initialize_from_string(init_coordinates_3dr);
99 return *this;
100 }

◆ operator=() [4/5]

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

Definition at line 88 of file coordinates_3dr.hpp.

89 {
90 x = std::move(x_coordinates.x);
91 y = std::move(x_coordinates.y);
92 z = std::move(x_coordinates.z);
93 return *this;
94 }

◆ operator=() [5/5]

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

Definition at line 70 of file coordinates_3dr.hpp.

71 {
72 x = std::move(x_coordinates.x);
73 y = std::move(x_coordinates.y);
74 z = std::move(x_coordinates.z);
75 theta = std::move(x_coordinates.theta);
76 phi = std::move(x_coordinates.phi);
77 return *this;
78 }

◆ origin()

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

Definition at line 102 of file coordinates_3dr.hpp.

103 {
104 coordinates_3dr<T> new_coordinates(origin);
105 new_coordinates.move(coordinates.x,coordinates.y,coordinates.z);
106 return new_coordinates;
107 }
static coordinates_3dr< T > origin(const coordinates_3dr< T > &origin, const coordinates_3dr< T > &coordinates)

◆ point_to()

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

Definition at line 144 of file coordinates_3dr.hpp.

145 {
146 if (x == direction::LEFT)
147 {
148 theta = 270.0f;
149 phi = 90.0f;
150 }
151 else if(x == direction::RIGHT)
152 {
153 theta = 90.0f;
154 phi = 90.0f;
155 }
156 else if(x == direction::TOP)
157 {
158 theta = 0.0f;
159 phi = 0.0f;
160 }
161 else if(x == direction::BOTTOM)
162 {
163 theta = 0.0f;
164 phi = 180.0f;
165 }
166 else if(x == direction::LEFT_TOP)
167 {
168 theta = 270.0f;
169 phi = 45.0f;
170 }
171 else if(x == direction::RIGHT_TOP)
172 {
173 theta = 90.0f;
174 phi = 45.0f;
175 }
176 else if(x == direction::RIGHT_BOTTOM)
177 {
178 theta = 90.0f;
179 phi = 135.0f;
180 }
181 else if(x == direction::LEFT_BOTTOM)
182 {
183 theta = 270.0f;
184 phi = 135.0f;
185 }
186 else if(x == direction::FRONT)
187 {
188 theta = 0.0f;
189 phi = 90.0f;
190 }
191 else if(x == direction::BACK)
192 {
193 theta = 180.0f;
194 phi = 90.0f;
195 }
196 else if(x == direction::LEFT_FRONT)
197 {
198 theta = 315.0f;
199 phi = 90.0f;
200 }
201 else if(x == direction::RIGHT_FRONT)
202 {
203 theta = 45.0f;
204 phi = 90.0f;
205 }
206 else if(x == direction::TOP_FRONT)
207 {
208 theta = 0.0f;
209 phi = 45.0f;
210 }
211 else if(x == direction::BOTTOM_FRONT)
212 {
213 theta = 0.0f;
214 phi = 135.0f;
215 }
216 else if(x == direction::LEFT_BACK)
217 {
218 theta = 225.0f;
219 phi = 90.0f;
220 }
221 else if(x == direction::RIGHT_BACK)
222 {
223 theta = 135.0f;
224 phi = 90.0f;
225 }
226 else if(x == direction::TOP_BACK)
227 {
228 theta = 180.0f;
229 phi = 45.0f;
230 }
231 else if(x == direction::BOTTOM_BACK)
232 {
233 theta = 180.0f;
234 phi = 135.0f;
235 }
236 else if(x == direction::LEFT_TOP_FRONT)
237 {
238 theta = 315.0f;
239 phi = 45.0f;
240 }
241 else if(x == direction::RIGHT_TOP_FRONT)
242 {
243 theta = 45.0f;
244 phi = 45.0f;
245 }
247 {
248 theta = 315.0f;
249 phi = 135.0f;
250 }
252 {
253 theta = 45.0f;
254 phi = 135.0f;
255 }
256 else if(x == direction::LEFT_TOP_BACK)
257 {
258 theta = 225.0f;
259 phi = 45.0f;
260 }
261 else if(x == direction::RIGHT_TOP_BACK)
262 {
263 theta = 135.0f;
264 phi = 45.0f;
265 }
267 {
268 theta = 225.0f;
269 phi = 135.0f;
270 }
272 {
273 theta = 135.0f;
274 phi = 135.0f;
275 }
276 }

◆ rotate_in_x()

template<typename T = length>
void scifir::coordinates_3dr< T >::rotate_in_x ( const angle x_angle)
inline

Definition at line 307 of file coordinates_3dr.hpp.

308 {
309 T y_coord = y;
310 T z_coord = z;
311 y = y_coord * scifir::cos(x_angle) - z_coord * scifir::sin(x_angle);
312 z = y_coord * scifir::sin(x_angle) + z_coord * scifir::cos(x_angle);
313 }

◆ rotate_in_y()

template<typename T = length>
void scifir::coordinates_3dr< T >::rotate_in_y ( const angle x_angle)
inline

Definition at line 315 of file coordinates_3dr.hpp.

316 {
317 T x_coord = x;
318 T z_coord = z;
319 x = x_coord * scifir::cos(x_angle) - z_coord * scifir::sin(x_angle);
320 z = x_coord * scifir::sin(x_angle) + z_coord * scifir::cos(x_angle);
321 }

◆ rotate_in_z()

template<typename T = length>
void scifir::coordinates_3dr< T >::rotate_in_z ( const angle x_angle)
inline

Definition at line 323 of file coordinates_3dr.hpp.

324 {
325 T x_coord = x;
326 T y_coord = y;
327 x = x_coord * scifir::cos(x_angle) - y_coord * scifir::sin(x_angle);
328 y = x_coord * scifir::sin(x_angle) + y_coord * scifir::cos(x_angle);
329 }

◆ set_position() [1/4]

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

Definition at line 300 of file coordinates_3dr.hpp.

301 {
302 x = T(new_altitude * scifir::cos(new_latitude) * scifir::cos(new_longitude));
303 y = T(new_altitude * scifir::cos(new_latitude) * scifir::sin(new_longitude));
304 z = T(new_altitude * scifir::sin(new_latitude));
305 }

◆ set_position() [2/4]

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

Definition at line 285 of file coordinates_3dr.hpp.

286 {
287 new_z.change_dimensions(new_p);
288 x = T(new_p * scifir::cos(new_theta));
289 y = T(new_p * scifir::sin(new_theta));
290 z = new_z;
291 }

◆ set_position() [3/4]

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

Definition at line 293 of file coordinates_3dr.hpp.

294 {
295 x = T(new_r * scifir::cos(new_theta) * scifir::sin(new_phi));
296 y = T(new_r * scifir::sin(new_theta) * scifir::sin(new_phi));
297 z = T(new_r * scifir::cos(new_phi));
298 }

◆ set_position() [4/4]

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

Definition at line 278 of file coordinates_3dr.hpp.

279 {
280 x = new_x;
281 y = new_y;
282 z = new_z;
283 }

Member Data Documentation

◆ phi

template<typename T = length>
angle scifir::coordinates_3dr< T >::phi

Definition at line 397 of file coordinates_3dr.hpp.

◆ theta

template<typename T = length>
angle scifir::coordinates_3dr< T >::theta

Definition at line 396 of file coordinates_3dr.hpp.

◆ x

template<typename T = length>
T scifir::coordinates_3dr< T >::x

Definition at line 393 of file coordinates_3dr.hpp.

◆ y

template<typename T = length>
T scifir::coordinates_3dr< T >::y

Definition at line 394 of file coordinates_3dr.hpp.

◆ z

template<typename T = length>
T scifir::coordinates_3dr< T >::z

Definition at line 395 of file coordinates_3dr.hpp.


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