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
|
Class that creates a vector unit in 3D. The vector is in spherical coordinates with a value and dimensions of the scalar_unit, and an angle theta and another angle phi for his direction. All base and derived vectorial unit classes in 3D inherit from vector_unit_3d, and add the suffix **_3d** in their name. Initialization string example: "1 N 20θ 30Φ". 'θ' is the Unicode Character U+03B8. 'Φ' is the Unicode Character U+03A6. More...
#include <vector_unit_3d.hpp>
Public Member Functions | |
vector_unit_3d () | |
Default constructor. The value is set to 0, the dimensions are empty and theta and phi are 0. | |
vector_unit_3d (const vector_unit_3d &x) | |
Copy constructor. The member-variables are copied from vector_unit_3d x. | |
vector_unit_3d (vector_unit_3d &&x) | |
Move constructor. The member-variables are moved from vector_unit_3d x. | |
vector_unit_3d (float new_value, dimension::type new_dimension, prefix::type new_prefix, float new_theta, float new_phi, dimension::position new_position=dimension::NUMERATOR) | |
vector_unit_3d (float new_value, dimension::type new_dimension, prefix::type new_prefix, const angle &new_theta, const angle &new_phi, dimension::position new_position=dimension::NUMERATOR) | |
vector_unit_3d (double new_value, dimension::type new_dimension, prefix::type new_prefix, float new_theta, float new_phi, dimension::position new_position=dimension::NUMERATOR) | |
vector_unit_3d (double new_value, dimension::type new_dimension, prefix::type new_prefix, const angle &new_theta, const angle &new_phi, dimension::position new_position=dimension::NUMERATOR) | |
vector_unit_3d (long double new_value, dimension::type new_dimension, prefix::type new_prefix, float new_theta, float new_phi, dimension::position new_position=dimension::NUMERATOR) | |
vector_unit_3d (long double new_value, dimension::type new_dimension, prefix::type new_prefix, const angle &new_theta, const angle &new_phi, dimension::position new_position=dimension::NUMERATOR) | |
vector_unit_3d (int new_value, dimension::type new_dimension, prefix::type new_prefix, float new_theta, float new_phi, dimension::position new_position=dimension::NUMERATOR) | |
vector_unit_3d (int new_value, dimension::type new_dimension, prefix::type new_prefix, const angle &new_theta, const angle &new_phi, dimension::position new_position=dimension::NUMERATOR) | |
vector_unit_3d (float new_value, const string &init_dimensions, float new_theta, float new_phi) | |
The value is new_value, the dimensions are initialized with the initialization string of dimensions, theta is new_theta and phi is new_phi. | |
vector_unit_3d (float new_value, const string &init_dimensions, const angle &new_theta, const angle &new_phi) | |
The value is new_value, the dimensions are initialized with the initialization string of dimensions, theta is new_theta and phi is new_phi. | |
vector_unit_3d (double new_value, const string &init_dimensions, float new_theta, float new_phi) | |
The value is new_value (the double is casted to a float), the dimensions are initialized with the initialization string of dimensions, theta is new_theta and phi is new_phi. | |
vector_unit_3d (double new_value, const string &init_dimensions, const angle &new_theta, const angle &new_phi) | |
The value is new_value (the double is casted to a float), the dimensions are initialized with the initialization string of dimensions, theta is new_theta and phi is new_phi. | |
vector_unit_3d (long double new_value, const string &init_dimensions, float new_theta, float new_phi) | |
The value is new_value (the long double is casted to a float), the dimensions are initialized with the initialization string of dimensions, theta is new_theta and phi is new_phi. | |
vector_unit_3d (long double new_value, const string &init_dimensions, const angle &new_theta, const angle &new_phi) | |
The value is new_value (the long double is casted to a float), the dimensions are initialized with the initialization string of dimensions, theta is new_theta and phi is new_phi. | |
vector_unit_3d (int new_value, const string &init_dimensions, float new_theta, float new_phi) | |
The value is new_value (the int is casted to a float), the dimensions are initialized with the initialization string of dimensions, theta is new_theta and phi is new_phi. | |
vector_unit_3d (int new_value, const string &init_dimensions, const angle &new_theta, const angle &new_phi) | |
The value is new_value (the int is casted to a float), the dimensions are initialized with the initialization string of dimensions, theta is new_theta and phi is new_phi. | |
vector_unit_3d (float new_value, const vector< dimension > &new_dimensions, float new_theta, float new_phi) | |
The value is new_value, the dimensions are initialized with a vector of dimensions, theta is new_theta and phi is new_phi. | |
vector_unit_3d (float new_value, const vector< dimension > &new_dimensions, const angle &new_theta, const angle &new_phi) | |
The value is new_value, the dimensions are initialized with a vector of dimensions, theta is new_theta and phi is new_phi. | |
vector_unit_3d (double new_value, const vector< dimension > &new_dimensions, float new_theta, float new_phi) | |
The value is new_value (the double is casted to a float), the dimensions are initialized with a vector of dimensions, theta is new_theta and phi is new_phi. | |
vector_unit_3d (double new_value, const vector< dimension > &new_dimensions, const angle &new_theta, const angle &new_phi) | |
The value is new_value (the double is casted to a float), the dimensions are initialized with a vector of dimensions, theta is new_theta and phi is new_phi. | |
vector_unit_3d (long double new_value, const vector< dimension > &new_dimensions, float new_theta, float new_phi) | |
The value is new_value (the long double is casted to a float), the dimensions are initialized with a vector of dimensions, theta is new_theta and phi is new_phi. | |
vector_unit_3d (long double new_value, const vector< dimension > &new_dimensions, const angle &new_theta, const angle &new_phi) | |
The value is new_value (the long double is casted to a float), the dimensions are initialized with a vector of dimensions, theta is new_theta and phi is new_phi. | |
vector_unit_3d (int new_value, const vector< dimension > &new_dimensions, float new_theta, float new_phi) | |
The value is new_value (the int is casted to a float), the dimensions are initialized with a vector of dimensions, theta is new_theta and phi is new_phi. | |
vector_unit_3d (int new_value, const vector< dimension > &new_dimensions, const angle &new_theta, const angle &new_phi) | |
The value is new_value (the int is casted to a float), the dimensions are initialized with a vector of dimensions, theta is new_theta and phi is new_phi. | |
vector_unit_3d (const scalar_unit &x, float new_theta, float new_phi) | |
The value and the dimensions are copied from the scalar_unit x, theta is new_theta, phi is new_phi. | |
vector_unit_3d (const scalar_unit &x, const angle &new_theta, const angle &new_phi) | |
The value and the dimensions are copied from the scalar_unit x, theta is new_theta, phi is new_phi. | |
vector_unit_3d (const string &init_scalar, float new_theta, float new_phi) | |
The value and the dimensions are copied from the initialization string of scalar_unit init_scalar, theta is new_theta, phi is new_phi. | |
vector_unit_3d (const string &init_scalar, const angle &new_theta, const angle &new_phi) | |
The value and the dimensions are copied from the initialization string of scalar_unit init_scalar, theta is new_theta, phi is new_phi. | |
vector_unit_3d (const string &init_vector_3d) | |
The value, the dimensions, theta and phi are initialized from the initialization string of vector_unit_3d init_vector_3d. | |
vector_unit_3d & | operator= (const vector_unit_3d &x) |
Copy assignment. The member-variables are copied from the vector_unit_3d x. | |
vector_unit_3d & | operator= (vector_unit_3d &&x) |
Move assignment. The member-variables are moved from the vector_unit_3d x. | |
vector_unit_3d & | operator= (const scalar_unit &x) |
The value and the dimensions are copied from the scalar_unit x, theta and phi are not changed. | |
vector_unit_3d & | operator= (scalar_unit &&x) |
The value and the dimensions are moved from the scalar_unit x, theta and phi are not changed. | |
vector_unit_3d & | operator= (const string &init_vector_3d) |
The value, the dimensions, theta and phi are set from the initialization string init_vector_3d. | |
bool | operator== (vector_unit_3d x) const |
Comparison operator. Two vector_unit_3d are equal if their value, dimensions, theta and phi are the same. | |
void | point_to (direction::name x) |
Theta is set to the direction specified in 3D. Possible values are LEFT, RIGHT, TOP, BOTTOM, LEFT_TOP, RIGHT_TOP, RIGHT_BOTTOM, LEFT_BOTTOM, FRONT, BACK, LEFT_FRONT, RIGHT_FRONT, TOP_FRONT, BOTTOM_FRONT, LEFT_BACK, RIGHT_BACK, TOP_BACK, BOTTOM_BACK, LEFT_TOP_FRONT, RIGHT_TOP_FRONT, LEFT_BOTTOM_FRONT, RIGHT_BOTTOM_FRONT, LEFT_TOP_BACK, RIGHT_TOP_BACK, LEFT_BOTTOM_BACK, RIGHT_BOTTOM_BACK. | |
void | operator+= (const vector_unit_3d &x) |
The vector_unit_3d is summed as vector, in spherical coordinates. The addition of vectors is used for the calculation. | |
void | operator-= (vector_unit_3d x) |
The vector_unit_3d is substracted as vector, in spherical coordinates. The substraction of vectors is used for the calculation. | |
vector_unit_3d | operator+ (const vector_unit_3d &x) const |
Addition of vectors in 3D. It creates a new vector as the addition of the other two. | |
vector_unit_3d | operator- (vector_unit_3d x) const |
Substraction of vectors in 3D. It creates a new vector as the difference of the other two. | |
vector_unit_3d | operator* (const scalar_unit &x) const |
It creates a new vector_unit_3d scaling a vector_unit_3d by the scalar_unit x. | |
vector_unit_3d | operator/ (const scalar_unit &x) const |
It creates a new vector_unit_3d scaling a vector_unit_3d by the inverse of the scalar_unit x. | |
vector_unit_3d | operator^ (const scalar_unit &x) const |
It powers a vector by a scalar_unit x if that scalar_unit has empty dimensions. | |
template<typename T , typename = typename enable_if<scifir::is_number<T>::value>::type> | |
vector_unit_3d | operator+ (T x) const |
It creates a new vector as the addition of the numeric type x to the value. Theta and phi are not changed. | |
template<typename T , typename = typename enable_if<scifir::is_number<T>::value>::type> | |
vector_unit_3d | operator- (T x) const |
It creates a new vector as the substraction of the numeric type x to the value. Theta and phi are not changed. | |
template<typename T , typename = typename enable_if<scifir::is_number<T>::value>::type> | |
vector_unit_3d | operator* (T x) const |
It creates a new vector as the multiplication of the numeric type x to the value. Theta and phi are not changed. | |
template<typename T , typename = typename enable_if<scifir::is_number<T>::value>::type> | |
vector_unit_3d | operator/ (T x) const |
It creates a new vector as the division of the value with the numeric type x. Theta and phi are not changed. | |
template<typename T , typename = typename enable_if<is_integer_number<T>::value>::type> | |
vector_unit_3d | operator^ (T x) const |
It creates a new vector as the power of the value with the numeric type x. Theta and phi are not changed. | |
template<typename T , typename = typename enable_if<scifir::is_number<T>::value>::type> | |
void | operator+= (T x) |
It sums the numeric type x to the value. Theta and phi are not changed. | |
template<typename T , typename = typename enable_if<scifir::is_number<T>::value>::type> | |
void | operator-= (T x) |
It substracts the numeric type x to the value. Theta and phi are not changed. | |
template<typename T , typename = typename enable_if<scifir::is_number<T>::value>::type> | |
void | operator*= (T x) |
It multiplies the numeric type x to the value. Theta and phi are not changed. | |
template<typename T , typename = typename enable_if<scifir::is_number<T>::value>::type> | |
void | operator/= (T x) |
It divides the numeric type x to the value. Theta and phi are not changed. | |
scalar_unit | x_projection () const |
It creates the x projection of the vector, returning it as a scalar_unit of the same dimensions, and the value corresponds to the projection. | |
scalar_unit | y_projection () const |
It creates the y projection of the vector, returning it as a scalar_unit of the same dimensions, and the value corresponds to the projection. | |
scalar_unit | z_projection () const |
It creates the z projection of the vector, returning it as a scalar_unit of the same dimensions, and the value corresponds to the projection. | |
void | invert () |
Changes the direction of the vector to the opposite direction. It does that by adding 180 degrees to theta and calculating the new phi as "180 - phi". | |
string | vectorial_display (int number_of_decimals=2) const |
Displays the vector as the string representation of the scalar unit adding also the angle theta and the angle phi. | |
string | vectorial_base_display (int number_of_decimals=2) const |
Displays the vector as the string representation of the scalar unit adding also the angle theta and the angle phi. It displays the dimensions with its base dimensions. | |
string | vectorial_custom_display (const string &init_dimensions, int number_of_decimals=2) const |
Displays the vector as the string representation of the scalar unit adding also the angle theta and the angle phi. It displays the vector in the dimensions specified in the initialization string of dimensions init_dimensions. | |
![]() | |
scalar_unit () | |
Default constructor, the value is 0 and the dimensions are empty. | |
scalar_unit (const scalar_unit &x) | |
Copy constructor, copies the value and the dimensions. | |
scalar_unit (scalar_unit &&x) | |
Move constructor, moves the value and the dimensions. | |
scalar_unit (float new_value, dimension::type new_dimension, prefix::type new_prefix, dimension::position new_position=dimension::NUMERATOR) | |
scalar_unit (double new_value, dimension::type new_dimension, prefix::type new_prefix, dimension::position new_position=dimension::NUMERATOR) | |
scalar_unit (long double new_value, dimension::type new_dimension, prefix::type new_prefix, dimension::position new_position=dimension::NUMERATOR) | |
scalar_unit (int new_value, dimension::type new_dimension, prefix::type new_prefix, dimension::position new_position=dimension::NUMERATOR) | |
scalar_unit (float new_value, const string &init_dimensions) | |
Creates a new scalar_unit with the value and with the dimensions specified in the string. | |
scalar_unit (double new_value, const string &init_dimensions) | |
Creates a new scalar_unit, the double is casted to a float. | |
scalar_unit (long double new_value, const string &init_dimensions) | |
Creates a new scalar_unit, the long double is casted to a float. | |
scalar_unit (int new_value, const string &init_dimensions) | |
Creates a new scalar_unit, the int is casted to a float. | |
scalar_unit (float new_value, const vector< dimension > &new_dimensions) | |
Creates a new scalar_unit with the value given and copying the dimensions. | |
scalar_unit (double new_value, const vector< dimension > &new_dimensions) | |
Creates a new scalar_unit, the double is casted to a float, the dimensions are copied. | |
scalar_unit (long double new_value, const vector< dimension > &new_dimensions) | |
Creates a new scalar_unit, the long double is casted to a float, the dimensions are copied. | |
scalar_unit (int new_value, const vector< dimension > &new_dimensions) | |
Creates a new scalar_unit, the int is casted to a float, the dimensions are copied. | |
scalar_unit (const string &init_scalar) | |
Creates a new scalar_unit, the initialization string specifies both the value and the dimensions. | |
scalar_unit & | operator= (const scalar_unit &x) |
Copy assignment, it assigns a copy of the scalar_unit. | |
scalar_unit & | operator= (scalar_unit &&x) |
Move assignment, it moves the scalar_unit. | |
scalar_unit & | operator= (const string &init_scalar) |
Assignment with an initialization string, the value and the dimensions are both specified. | |
operator float () const | |
Cast the scalar_unit to their float equivalent, it discards the dimensions and copies the value to a float. | |
bool | operator== (scalar_unit x) const |
Comparison operator, two scalar_unit classes are considered equivalent if they have the same value given the same dimensions. | |
scalar_unit | operator+ (scalar_unit x) const |
Addition operator, it sums two scalar_unit classes, their dimensions are changed to be equal first. If the basic dimensions are different, it returns an empty scalar_unit class. | |
scalar_unit | operator- (scalar_unit x) const |
Substraction operator, it substracts one scalar_unit from the other, their dimensions are changed to be equal first. If the basic dimensions are different, it returns an empty scalar_unit class. | |
scalar_unit | operator* (scalar_unit x) const |
Multiplication operator, it multiplies two scalar_unit classes, their dimensions are also multiplied. | |
scalar_unit | operator/ (scalar_unit x) const |
Division operator, it divides one scalar_unit class with the other, their dimensions are also divided. | |
scalar_unit | operator^ (const scalar_unit &x) const |
Power operator, it powers a scalar_unit class with another, if that second scalar_unit class, which is the exponent, as empty dimensions. If the exponent doesn't has empty dimensions it returns an empty scalar_unit class. | |
void | operator+= (scalar_unit x) |
Addition operator, it adds a scalar_unit class to another, by converting their dimensions to be equal first. If their basic dimensions are different, it doesn't sums to the value. | |
void | operator-= (scalar_unit x) |
Substraction operator, it substracts a scalar_unit class to another, by converting their dimensions to be equal first. If their basic dimensions are different, it doesn't substracts to the value. | |
template<typename T , typename = typename enable_if<scifir::is_number<T>::value>::type> | |
scalar_unit | operator+ (T y) const |
Addition operator, it sums the numeric type to the value, independent of the dimensions. | |
template<typename T , typename = typename enable_if<scifir::is_number<T>::value>::type> | |
scalar_unit | operator- (T y) const |
Substraction operator, it substracts the numeric type to the value, independent of the dimensions. | |
template<typename T , typename = typename enable_if<scifir::is_number<T>::value>::type> | |
scalar_unit | operator* (T y) const |
Multiplication operator, it multiplies the numeric type with the value, independent of the dimensions. | |
template<typename T , typename = typename enable_if<scifir::is_number<T>::value>::type> | |
scalar_unit | operator/ (T y) const |
Division operator, it divides the value with the numeric type, independent of the dimensions. | |
template<typename T , typename = typename enable_if<is_integer_number<T>::value>::type> | |
scalar_unit | operator^ (T y) const |
Power operator, it powers the value with the numeric type, independent of the dimensions. | |
template<typename T , typename = typename enable_if<scifir::is_number<T>::value>::type> | |
void | operator+= (T y) |
Addition operator, it adds the numeric type to the value, independent of the dimensions. | |
template<typename T , typename = typename enable_if<scifir::is_number<T>::value>::type> | |
void | operator-= (T y) |
Substraction operator, it substracts the numeric type to the value, independent of the dimensions. | |
template<typename T , typename = typename enable_if<scifir::is_number<T>::value>::type> | |
void | operator*= (T y) |
Multiplication operator, it multiplies the numeric type to the value, independent of the dimensions. | |
template<typename T , typename = typename enable_if<scifir::is_number<T>::value>::type> | |
void | operator/= (T y) |
Division operator, it divides the numeric type to the value, independent of the dimensions. | |
scalar_unit & | operator++ () |
Increment operator, it increases the value by one. | |
scalar_unit & | operator++ (int) |
Increment operator, it increases the value by one. | |
scalar_unit & | operator-- () |
Decrement operator, it decreases the value by one. | |
scalar_unit & | operator-- (int) |
Decrement operator, it decreases the value by one. | |
void | change_dimensions (const string &init_dimensions) |
Changes the dimensions to the dimensions specified by the initialization string of dimensions. | |
void | change_dimensions (const scalar_unit &x) |
Changes the dimensions to the same dimensions of the scalar_unit. | |
bool | has_dimensions (const string &init_dimensions) const |
Checks if the basic dimensions are the same as the initialization string of dimensions. | |
bool | has_dimensions (const vector< dimension > &x_dimensions) const |
Checks if the basic dimensions are the same as some set of dimensions. | |
bool | has_dimensions (const scalar_unit &x) const |
Checks if the basic dimensions are the same as other scalar_unit. | |
bool | has_empty_dimensions () const |
Checks if there aren't base dimensions. | |
bool | is_dimensionless () const |
Returns true if there aren't dimensions or if all dimensions are dimensionless. | |
bool | has_simple_dimensions () const |
Returns true if there's only a simple dimension. | |
bool | has_single_dimensions () const |
Returns true if there's only one dimension, which can be simple or composite. | |
bool | has_composite_dimensions () const |
Returns true is there's more than one simple dimension. | |
string | display_dimensions () const |
Generates an string of the dimensions of the scalar_unit, with the same format as the initialization string of dimensions. | |
dimension::type | get_single_dimension_type () const |
Returns the dimension::type if there's only one dimension, returns dimension::NONE if there's more than one dimension or if the dimensions are empty. | |
vector< dimension > | get_base_dimensions () const |
Generates a set of the base dimensions of the dimensions of the scalar_unit. | |
const vector< dimension > & | get_dimensions () const |
Read-only getter of the dimensions. | |
const float & | get_value () const |
Read-only getter of the value. | |
string | display (int number_of_decimals=2, bool with_brackets=false, bool use_close_prefix=false) const |
Generates a string representation of the scalar_unit, with the value and the dimensions. The dimensions can be enclosed by brackets, and the value can be set to have the closest prefix. | |
string | base_display (int number_of_decimals=2, bool with_brackets=false, bool use_close_prefix=false) const |
Generates a string representation of the scalar_unit, with its dimensions converted to their base counterpart. | |
string | custom_display (const string &init_dimensions, int number_of_decimals=2, bool with_brackets=false) const |
Generates a string representation of the scalar_unit, with the dimensions changed to any set of dimensions, specified by an initialization string of dimensions. | |
string | to_latex (const string &init_dimensions, int number_of_decimals=2, bool with_brackets=false) const |
Static Public Member Functions | |
static vector_unit_3d | cartesian_3d (const string &init_dimensions, float new_x, float new_y, float new_z) |
The dimensions are initialized from the initialization string of dimensions new_dimensions, the cartesian coordinates new_x, new_y and new_z are converted to spherical coordinates and then set the value, theta and phi. | |
static vector_unit_3d | cylindrical (const string &init_dimensions, float new_p, angle new_theta, float new_z) |
The dimensions are initialized from the initialization string of dimensions new_dimensions, the cylindrical coordinates new_p, new_theta and new_z are converted to spherical coordinates and then set the value, theta and phi. | |
Public Attributes | |
angle | theta |
Angle theta of the vector in 3D space, in spherical coordinates. As all angles of scifir-units, it's stored in degrees. | |
angle | phi |
Angle phi of the vector in 3D space, in spherical coordinates. As all angles of scifir-units, it's stored in degrees. | |
Protected Member Functions | |
void | initialize_from_string (string init_vector_3d) |
Initializes the member-variables with the initialization string of vector_unit_3d init_vector_3d. | |
![]() | |
void | add_dimension (const dimension &new_dimension) |
Internal function. It adds a dimension, changing the value according to the conversion factor of the added dimension and the prefix. | |
void | remove_dimension (const dimension &old_dimension) |
Internal function. It removes a dimension, changing the value according to the conversion factor of the removed dimension and the prefix. | |
void | initialize_from_string (string init_scalar, const vector< dimension > &real_dimensions) |
Internal function. It sets the value and the dimensions of the scalar_unit to the value and dimensions specified by the initialization string of scalar_unit. | |
void | check_dimensions (const vector< dimension > &real_dimensions) |
Additional Inherited Members | |
![]() | |
vector< dimension > | dimensions |
Dimensions of the scalar_unit. They can be simple dimensions, composite dimensions or special names. | |
float | value |
Value of the scalar_unit. It changes automatically when the dimensions change. | |
Class that creates a vector unit in 3D. The vector is in spherical coordinates with a value and dimensions of the scalar_unit, and an angle theta and another angle phi for his direction. All base and derived vectorial unit classes in 3D inherit from vector_unit_3d, and add the suffix **_3d** in their name. Initialization string example: "1 N 20θ 30Φ". 'θ' is the Unicode Character U+03B8. 'Φ' is the Unicode Character U+03A6.
Definition at line 302 of file vector_unit_3d.hpp.
vector_unit_3d::vector_unit_3d | ( | ) |
Default constructor. The value is set to 0, the dimensions are empty and theta and phi are 0.
Definition at line 10 of file vector_unit_3d.cpp.
vector_unit_3d::vector_unit_3d | ( | const vector_unit_3d & | x | ) |
Copy constructor. The member-variables are copied from vector_unit_3d x.
Definition at line 13 of file vector_unit_3d.cpp.
vector_unit_3d::vector_unit_3d | ( | vector_unit_3d && | x | ) |
Move constructor. The member-variables are moved from vector_unit_3d x.
Definition at line 16 of file vector_unit_3d.cpp.
|
explicit |
Definition at line 19 of file vector_unit_3d.cpp.
|
explicit |
Definition at line 22 of file vector_unit_3d.cpp.
|
explicit |
Definition at line 25 of file vector_unit_3d.cpp.
|
explicit |
Definition at line 28 of file vector_unit_3d.cpp.
|
explicit |
Definition at line 31 of file vector_unit_3d.cpp.
|
explicit |
Definition at line 34 of file vector_unit_3d.cpp.
|
explicit |
Definition at line 37 of file vector_unit_3d.cpp.
|
explicit |
Definition at line 40 of file vector_unit_3d.cpp.
|
explicit |
The value is new_value, the dimensions are initialized with the initialization string of dimensions, theta is new_theta and phi is new_phi.
Definition at line 43 of file vector_unit_3d.cpp.
|
explicit |
The value is new_value, the dimensions are initialized with the initialization string of dimensions, theta is new_theta and phi is new_phi.
Definition at line 46 of file vector_unit_3d.cpp.
|
explicit |
The value is new_value (the double is casted to a float), the dimensions are initialized with the initialization string of dimensions, theta is new_theta and phi is new_phi.
Definition at line 49 of file vector_unit_3d.cpp.
|
explicit |
The value is new_value (the double is casted to a float), the dimensions are initialized with the initialization string of dimensions, theta is new_theta and phi is new_phi.
Definition at line 52 of file vector_unit_3d.cpp.
|
explicit |
The value is new_value (the long double is casted to a float), the dimensions are initialized with the initialization string of dimensions, theta is new_theta and phi is new_phi.
Definition at line 55 of file vector_unit_3d.cpp.
|
explicit |
The value is new_value (the long double is casted to a float), the dimensions are initialized with the initialization string of dimensions, theta is new_theta and phi is new_phi.
Definition at line 58 of file vector_unit_3d.cpp.
|
explicit |
The value is new_value (the int is casted to a float), the dimensions are initialized with the initialization string of dimensions, theta is new_theta and phi is new_phi.
Definition at line 61 of file vector_unit_3d.cpp.
|
explicit |
The value is new_value (the int is casted to a float), the dimensions are initialized with the initialization string of dimensions, theta is new_theta and phi is new_phi.
Definition at line 64 of file vector_unit_3d.cpp.
|
explicit |
The value is new_value, the dimensions are initialized with a vector of dimensions, theta is new_theta and phi is new_phi.
Definition at line 67 of file vector_unit_3d.cpp.
|
explicit |
The value is new_value, the dimensions are initialized with a vector of dimensions, theta is new_theta and phi is new_phi.
Definition at line 70 of file vector_unit_3d.cpp.
|
explicit |
The value is new_value (the double is casted to a float), the dimensions are initialized with a vector of dimensions, theta is new_theta and phi is new_phi.
Definition at line 73 of file vector_unit_3d.cpp.
|
explicit |
The value is new_value (the double is casted to a float), the dimensions are initialized with a vector of dimensions, theta is new_theta and phi is new_phi.
Definition at line 76 of file vector_unit_3d.cpp.
|
explicit |
The value is new_value (the long double is casted to a float), the dimensions are initialized with a vector of dimensions, theta is new_theta and phi is new_phi.
Definition at line 79 of file vector_unit_3d.cpp.
|
explicit |
The value is new_value (the long double is casted to a float), the dimensions are initialized with a vector of dimensions, theta is new_theta and phi is new_phi.
Definition at line 82 of file vector_unit_3d.cpp.
|
explicit |
The value is new_value (the int is casted to a float), the dimensions are initialized with a vector of dimensions, theta is new_theta and phi is new_phi.
Definition at line 85 of file vector_unit_3d.cpp.
|
explicit |
The value is new_value (the int is casted to a float), the dimensions are initialized with a vector of dimensions, theta is new_theta and phi is new_phi.
Definition at line 88 of file vector_unit_3d.cpp.
|
explicit |
The value and the dimensions are copied from the scalar_unit x, theta is new_theta, phi is new_phi.
Definition at line 91 of file vector_unit_3d.cpp.
|
explicit |
The value and the dimensions are copied from the scalar_unit x, theta is new_theta, phi is new_phi.
Definition at line 94 of file vector_unit_3d.cpp.
|
explicit |
The value and the dimensions are copied from the initialization string of scalar_unit init_scalar, theta is new_theta, phi is new_phi.
Definition at line 97 of file vector_unit_3d.cpp.
|
explicit |
The value and the dimensions are copied from the initialization string of scalar_unit init_scalar, theta is new_theta, phi is new_phi.
Definition at line 100 of file vector_unit_3d.cpp.
The value, the dimensions, theta and phi are initialized from the initialization string of vector_unit_3d init_vector_3d.
Definition at line 103 of file vector_unit_3d.cpp.
|
inlinestatic |
The dimensions are initialized from the initialization string of dimensions new_dimensions, the cartesian coordinates new_x, new_y and new_z are converted to spherical coordinates and then set the value, theta and phi.
Definition at line 338 of file vector_unit_3d.hpp.
|
inlinestatic |
The dimensions are initialized from the initialization string of dimensions new_dimensions, the cylindrical coordinates new_p, new_theta and new_z are converted to spherical coordinates and then set the value, theta and phi.
Definition at line 346 of file vector_unit_3d.hpp.
Initializes the member-variables with the initialization string of vector_unit_3d init_vector_3d.
Definition at line 438 of file vector_unit_3d.cpp.
|
inline |
Changes the direction of the vector to the opposite direction. It does that by adding 180 degrees to theta and calculating the new phi as "180 - phi".
Definition at line 458 of file vector_unit_3d.hpp.
vector_unit_3d vector_unit_3d::operator* | ( | const scalar_unit & | x | ) | const |
It creates a new vector_unit_3d scaling a vector_unit_3d by the scalar_unit x.
Definition at line 356 of file vector_unit_3d.cpp.
|
inline |
It creates a new vector as the multiplication of the numeric type x to the value. Theta and phi are not changed.
Definition at line 390 of file vector_unit_3d.hpp.
It multiplies the numeric type x to the value. Theta and phi are not changed.
Definition at line 424 of file vector_unit_3d.hpp.
vector_unit_3d vector_unit_3d::operator+ | ( | const vector_unit_3d & | x | ) | const |
Addition of vectors in 3D. It creates a new vector as the addition of the other two.
Definition at line 319 of file vector_unit_3d.cpp.
|
inline |
It creates a new vector as the addition of the numeric type x to the value. Theta and phi are not changed.
Definition at line 374 of file vector_unit_3d.hpp.
void vector_unit_3d::operator+= | ( | const vector_unit_3d & | x | ) |
The vector_unit_3d is summed as vector, in spherical coordinates. The addition of vectors is used for the calculation.
Definition at line 289 of file vector_unit_3d.cpp.
It sums the numeric type x to the value. Theta and phi are not changed.
Definition at line 412 of file vector_unit_3d.hpp.
|
inline |
It creates a new vector as the substraction of the numeric type x to the value. Theta and phi are not changed.
Definition at line 382 of file vector_unit_3d.hpp.
vector_unit_3d vector_unit_3d::operator- | ( | vector_unit_3d | x | ) | const |
Substraction of vectors in 3D. It creates a new vector as the difference of the other two.
Definition at line 337 of file vector_unit_3d.cpp.
It substracts the numeric type x to the value. Theta and phi are not changed.
Definition at line 418 of file vector_unit_3d.hpp.
void vector_unit_3d::operator-= | ( | vector_unit_3d | x | ) |
The vector_unit_3d is substracted as vector, in spherical coordinates. The substraction of vectors is used for the calculation.
Definition at line 306 of file vector_unit_3d.cpp.
vector_unit_3d vector_unit_3d::operator/ | ( | const scalar_unit & | x | ) | const |
It creates a new vector_unit_3d scaling a vector_unit_3d by the inverse of the scalar_unit x.
Definition at line 363 of file vector_unit_3d.cpp.
|
inline |
It creates a new vector as the division of the value with the numeric type x. Theta and phi are not changed.
Definition at line 398 of file vector_unit_3d.hpp.
It divides the numeric type x to the value. Theta and phi are not changed.
Definition at line 434 of file vector_unit_3d.hpp.
vector_unit_3d & vector_unit_3d::operator= | ( | const scalar_unit & | x | ) |
The value and the dimensions are copied from the scalar_unit x, theta and phi are not changed.
Definition at line 124 of file vector_unit_3d.cpp.
vector_unit_3d & vector_unit_3d::operator= | ( | const string & | init_vector_3d | ) |
The value, the dimensions, theta and phi are set from the initialization string init_vector_3d.
Definition at line 136 of file vector_unit_3d.cpp.
vector_unit_3d & vector_unit_3d::operator= | ( | const vector_unit_3d & | x | ) |
Copy assignment. The member-variables are copied from the vector_unit_3d x.
Definition at line 108 of file vector_unit_3d.cpp.
vector_unit_3d & vector_unit_3d::operator= | ( | scalar_unit && | x | ) |
The value and the dimensions are moved from the scalar_unit x, theta and phi are not changed.
Definition at line 130 of file vector_unit_3d.cpp.
vector_unit_3d & vector_unit_3d::operator= | ( | vector_unit_3d && | x | ) |
Move assignment. The member-variables are moved from the vector_unit_3d x.
Definition at line 116 of file vector_unit_3d.cpp.
bool vector_unit_3d::operator== | ( | scifir::vector_unit_3d | x | ) | const |
Comparison operator. Two vector_unit_3d are equal if their value, dimensions, theta and phi are the same.
Definition at line 142 of file vector_unit_3d.cpp.
vector_unit_3d vector_unit_3d::operator^ | ( | const scalar_unit & | x | ) | const |
It powers a vector by a scalar_unit x if that scalar_unit has empty dimensions.
Definition at line 370 of file vector_unit_3d.cpp.
|
inline |
It creates a new vector as the power of the value with the numeric type x. Theta and phi are not changed.
Definition at line 406 of file vector_unit_3d.hpp.
void vector_unit_3d::point_to | ( | direction::name | x | ) |
Theta is set to the direction specified in 3D. Possible values are LEFT, RIGHT, TOP, BOTTOM, LEFT_TOP, RIGHT_TOP, RIGHT_BOTTOM, LEFT_BOTTOM, FRONT, BACK, LEFT_FRONT, RIGHT_FRONT, TOP_FRONT, BOTTOM_FRONT, LEFT_BACK, RIGHT_BACK, TOP_BACK, BOTTOM_BACK, LEFT_TOP_FRONT, RIGHT_TOP_FRONT, LEFT_BOTTOM_FRONT, RIGHT_BOTTOM_FRONT, LEFT_TOP_BACK, RIGHT_TOP_BACK, LEFT_BOTTOM_BACK, RIGHT_BOTTOM_BACK.
Definition at line 155 of file vector_unit_3d.cpp.
Displays the vector as the string representation of the scalar unit adding also the angle theta and the angle phi. It displays the dimensions with its base dimensions.
string vector_unit_3d::vectorial_custom_display | ( | const string & | init_dimensions, |
int | number_of_decimals = 2 |
||
) | const |
Displays the vector as the string representation of the scalar unit adding also the angle theta and the angle phi. It displays the vector in the dimensions specified in the initialization string of dimensions init_dimensions.
Displays the vector as the string representation of the scalar unit adding also the angle theta and the angle phi.
|
inline |
It creates the x projection of the vector, returning it as a scalar_unit of the same dimensions, and the value corresponds to the projection.
Definition at line 443 of file vector_unit_3d.hpp.
|
inline |
It creates the y projection of the vector, returning it as a scalar_unit of the same dimensions, and the value corresponds to the projection.
Definition at line 448 of file vector_unit_3d.hpp.
|
inline |
It creates the z projection of the vector, returning it as a scalar_unit of the same dimensions, and the value corresponds to the projection.
Definition at line 453 of file vector_unit_3d.hpp.
angle vector_unit_3d::phi |
Angle phi of the vector in 3D space, in spherical coordinates. As all angles of scifir-units, it's stored in degrees.
Definition at line 469 of file vector_unit_3d.hpp.
angle vector_unit_3d::theta |
Angle theta of the vector in 3D space, in spherical coordinates. As all angles of scifir-units, it's stored in degrees.
Definition at line 468 of file vector_unit_3d.hpp.