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
|
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...
#include <coordinates_3d.hpp>
Public Member Functions | |
coordinates_3d () | |
Default constructor. Initializes x, y and z to 0, with the default dimensions. | |
coordinates_3d (const coordinates_3d< float > &x_coordinates) | |
Copy constructor. Initializes x, y and z to the x, y and z of x_coordinates. | |
coordinates_3d (coordinates_3d< float > &&x_coordinates) | |
Move constructor. Initializes x, y and z to the x, y and z of x_coordinates. | |
coordinates_3d (float new_x, float new_y, float new_z) | |
Constructor. Initializes x, y and z to be new_x, new_y and new_z. | |
coordinates_3d (float new_p, const angle &new_theta, float new_z) | |
Constructor. Initializes x, y and z with cylindrical coordinates. | |
coordinates_3d (float new_r, const angle &new_theta, const angle &new_phi) | |
Constructor. Initializes x, y and z with spherical coordinates. | |
coordinates_3d (const angle &new_latitude, const angle &new_longitude, float new_altitude) | |
Constructor. Initializes x, y and z with geographical coordinates. Currently geographical coordinates aren't ready. | |
coordinates_3d (coordinates_3d< length >::type coordinates_type, const string &coord1, const string &coord2, const string &coord3) | |
coordinates_3d (const string &init_coordinates_3d) | |
Constructor. Initializes x, y and z with the initialization string of coordinates_3d init_coordinates_3d. | |
coordinates_3d< float > & | operator= (const coordinates_3d< float > &x_coordinates) |
Copy assignment. Assigns x, y and z to the same values as the x, y and z of x_coordinates. | |
coordinates_3d< float > & | operator= (coordinates_3d< float > &&x_coordinates) |
Move assignment. Assigns x, y and z moved from the x, y and z of x_coordinates. | |
coordinates_3d< float > & | operator= (const string &init_coordinates_3d) |
Assignment. Assigns x, y and z to the values specified in the initialization string of coordinates_3d init_coordinates_3d. | |
float | get_p () const |
Returns the value of p in cylindrical coordinates. | |
angle | get_theta () const |
Returns the value of theta in cylindrical and spherical coordinates (it's the same theta). | |
float | get_r () const |
Returns the value of r in spherical coordinates. | |
angle | get_phi () const |
Returns the value of phi in spherical coordinates. | |
latitude | get_latitude () const |
Returns the latitude in geographical coordinates. In this case, coordinates_3d represents all the astronomical object surrounded by an imaginary sphere of the geographical coordinates. | |
longitude | get_longitude () const |
Returns the longitude in geographical coordinates. In this case, coordinates_3d represents all the astronomical object surrounded by an imaginary sphere of the geographical coordinates. | |
float | get_altitude () const |
Returns the altitude in geographical coordinates. In this case, coordinates_3d represents all the astronomical object surrounded by an imaginary sphere of the geographical coordinates. | |
void | set_position (float new_x, float new_y, float new_z) |
Sets x, y and z to the new_x, new_y and new_z. | |
void | set_position (float new_p, const angle &new_theta, float new_z) |
Sets x, y and z calculated from the cylindrical coordinates given. | |
void | set_position (float new_r, const angle &new_theta, const angle &new_phi) |
Sets x, y and z calculated from the spherical coordinates given. | |
void | set_position (const angle &new_latitude, const angle &new_longitude, float new_altitude) |
Sets x, y and z calculated from the geographical coordinates given. | |
void | rotate_in_x (const angle &x_angle) |
Rotates around the edge x the amount of the param x_angle. | |
void | rotate_in_y (const angle &x_angle) |
Rotates around the edge y the amount of the param x_angle. | |
void | rotate_in_z (const angle &x_angle) |
Rotates around the edge z the amount of the param x_angle. | |
void | move (const displacement_3d &x_displacement) |
Moves x, y and z in the vector x_displacement given. | |
void | move (float new_x, float new_y, float new_z) |
Moves x in new_x, y in new_y and z in new_z. | |
void | move (float new_p, const angle &new_theta, float new_z) |
Moves x, y and z in the cylindrical coordinates given. | |
void | move (float new_r, const angle &new_theta, const angle &new_phi) |
Moves x, y and z in the spherical coordinates given. | |
float | distance_to_origin () const |
Calculates the distance to the origin. | |
string | display_cartesian () const |
Displays the coordinates in cartesian coordinates. | |
string | display_cylindrical () const |
Displays the coordinates in cylindrical coordinates. | |
string | display_spherical () const |
Displays the coordinates in spherical coordinates. | |
string | display_geographical () const |
Displays the coordinates in geographical coordinates. | |
Public Attributes | |
float | x |
The position in the edge x, with type float. | |
float | y |
The position in the edge y, with type float. | |
float | z |
The position in the edge z, with type float. | |
Private Member Functions | |
void | initialize_from_string (string init_coordinates_3d) |
Internal function. Initializes x, y and z with the initialization string of coordinates_3d init_coordinates_3d. | |
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.
Definition at line 423 of file coordinates_3d.hpp.
|
inline |
Default constructor. Initializes x, y and z to 0, with the default dimensions.
Definition at line 426 of file coordinates_3d.hpp.
|
inline |
Copy constructor. Initializes x, y and z to the x, y and z of x_coordinates.
Definition at line 429 of file coordinates_3d.hpp.
|
inline |
Move constructor. Initializes x, y and z to the x, y and z of x_coordinates.
Definition at line 432 of file coordinates_3d.hpp.
|
inlineexplicit |
Constructor. Initializes x, y and z to be new_x, new_y and new_z.
Definition at line 435 of file coordinates_3d.hpp.
|
inlineexplicit |
Constructor. Initializes x, y and z with cylindrical coordinates.
Definition at line 438 of file coordinates_3d.hpp.
|
inlineexplicit |
Constructor. Initializes x, y and z with spherical coordinates.
Definition at line 443 of file coordinates_3d.hpp.
|
inlineexplicit |
Constructor. Initializes x, y and z with geographical coordinates. Currently geographical coordinates aren't ready.
Definition at line 448 of file coordinates_3d.hpp.
|
inlineexplicit |
Definition at line 453 of file coordinates_3d.hpp.
|
inlineexplicit |
Constructor. Initializes x, y and z with the initialization string of coordinates_3d init_coordinates_3d.
Definition at line 473 of file coordinates_3d.hpp.
|
inline |
Displays the coordinates in cartesian coordinates.
Definition at line 620 of file coordinates_3d.hpp.
|
inline |
Displays the coordinates in cylindrical coordinates.
Definition at line 627 of file coordinates_3d.hpp.
|
inline |
Displays the coordinates in geographical coordinates.
Definition at line 641 of file coordinates_3d.hpp.
|
inline |
Displays the coordinates in spherical coordinates.
Definition at line 634 of file coordinates_3d.hpp.
|
inline |
Calculates the distance to the origin.
Definition at line 615 of file coordinates_3d.hpp.
|
inline |
Returns the altitude in geographical coordinates. In this case, coordinates_3d represents all the astronomical object surrounded by an imaginary sphere of the geographical coordinates.
Definition at line 530 of file coordinates_3d.hpp.
|
inline |
Returns the latitude in geographical coordinates. In this case, coordinates_3d represents all the astronomical object surrounded by an imaginary sphere of the geographical coordinates.
Definition at line 520 of file coordinates_3d.hpp.
|
inline |
Returns the longitude in geographical coordinates. In this case, coordinates_3d represents all the astronomical object surrounded by an imaginary sphere of the geographical coordinates.
Definition at line 525 of file coordinates_3d.hpp.
|
inline |
Returns the value of p in cylindrical coordinates.
Definition at line 500 of file coordinates_3d.hpp.
|
inline |
Returns the value of phi in spherical coordinates.
Definition at line 515 of file coordinates_3d.hpp.
|
inline |
Returns the value of r in spherical coordinates.
Definition at line 510 of file coordinates_3d.hpp.
|
inline |
Returns the value of theta in cylindrical and spherical coordinates (it's the same theta).
Definition at line 505 of file coordinates_3d.hpp.
|
inlineprivate |
Internal function. Initializes x, y and z with the initialization string of coordinates_3d init_coordinates_3d.
Definition at line 653 of file coordinates_3d.hpp.
|
inline |
Moves x, y and z in the vector x_displacement given.
Definition at line 587 of file coordinates_3d.hpp.
|
inline |
Moves x, y and z in the cylindrical coordinates given.
Definition at line 601 of file coordinates_3d.hpp.
|
inline |
Moves x, y and z in the spherical coordinates given.
Definition at line 608 of file coordinates_3d.hpp.
Moves x in new_x, y in new_y and z in new_z.
Definition at line 594 of file coordinates_3d.hpp.
|
inline |
Copy assignment. Assigns x, y and z to the same values as the x, y and z of x_coordinates.
Definition at line 478 of file coordinates_3d.hpp.
|
inline |
Assignment. Assigns x, y and z to the values specified in the initialization string of coordinates_3d init_coordinates_3d.
Definition at line 494 of file coordinates_3d.hpp.
|
inline |
Move assignment. Assigns x, y and z moved from the x, y and z of x_coordinates.
Definition at line 486 of file coordinates_3d.hpp.
|
inline |
Rotates around the edge x the amount of the param x_angle.
Definition at line 563 of file coordinates_3d.hpp.
|
inline |
Rotates around the edge y the amount of the param x_angle.
Definition at line 571 of file coordinates_3d.hpp.
|
inline |
Rotates around the edge z the amount of the param x_angle.
Definition at line 579 of file coordinates_3d.hpp.
|
inline |
Sets x, y and z calculated from the geographical coordinates given.
Definition at line 556 of file coordinates_3d.hpp.
|
inline |
Sets x, y and z calculated from the cylindrical coordinates given.
Definition at line 542 of file coordinates_3d.hpp.
|
inline |
Sets x, y and z calculated from the spherical coordinates given.
Definition at line 549 of file coordinates_3d.hpp.
Sets x, y and z to the new_x, new_y and new_z.
Definition at line 535 of file coordinates_3d.hpp.
float scifir::coordinates_3d< float >::x |
The position in the edge x, with type float.
Definition at line 648 of file coordinates_3d.hpp.
float scifir::coordinates_3d< float >::y |
The position in the edge y, with type float.
Definition at line 649 of file coordinates_3d.hpp.
float scifir::coordinates_3d< float >::z |
The position in the edge z, with type float.
Definition at line 650 of file coordinates_3d.hpp.