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
|
#include "./vector_unit_3d.hpp"
#include "../coordinates/coordinates_3d.hpp"
#include "../util/types.hpp"
Go to the source code of this file.
Namespaces | |
namespace | scifir |
The namespace scifir contains all scifir-units, excepting the string literals, which are outside. | |
Functions | |
scalar_unit | scifir::norm (const vector_unit_3d &x) |
It returns the value of the vector in spherical coordinates, r. | |
vector_unit_3d | scifir::sqrt (const vector_unit_3d &x) |
It squares the vector, creating a vector_unit_3d with the value squared and always the same theta and the same phi. The dimensions are squared with the same rules for the square of dimensions than scalar_unit classes. | |
vector_unit_3d | scifir::sqrt_nth (const vector_unit_3d &x, int index) |
It takes the root of the vector with the index given, creating a vector_unit_3d with the value rooted to that index and always maintains the same theta and the same phi. The dimensions are squared with the same rules for the square of dimensions than scalar_unit classes. | |
scalar_unit | scifir::dot_product (const vector_unit_3d &x, const vector_unit_3d &y) |
Creates a scalar_unit as the dot product of the two vectors x and y. | |
vector_unit_3d | scifir::cross_product (const vector_unit_3d &x, const vector_unit_3d &y) |
Creates a vector_unit_3d as the cross product of the two vectors x and y. | |
angle | scifir::angle_between (const vector_unit_3d &x, const vector_unit_3d &y) |
Returns the angle between two vectors x and y inside a 3D space. | |
bool | scifir::same_direction (const vector_unit_3d &x, const vector_unit_3d &y) |
Checks if two vectors x and y have the same direction. | |
bool | scifir::parallel (const vector_unit_3d &x, const vector_unit_3d &y) |
Checks if two vectors x and y are parallel, which means that their direction is the same or the exact opposite. | |
bool | scifir::orthogonal (const vector_unit_3d &x, const vector_unit_3d &y) |
Checks if two vectors x and y are orthogonal, that's, if they have 90 degrees between them. | |
scifir::vector_unit_3d | operator* (const scifir::scalar_unit &x, const scifir::vector_unit_3d &y) |
It creates a new vector_unit_3d scaling a vector_unit_3d by the scalar_unit x. | |
bool | operator!= (const scifir::vector_unit_3d &x, const scifir::vector_unit_3d &y) |
Comparison operator. Two vector_unit_3d are not equal if their value, dimensions, theta or phi are different. | |
bool | operator== (const scifir::vector_unit_3d &x, const string &init_vector_3d) |
Returns true if x is equal to the vector_unit_3d initialized with the string being compared. The vectorial_display() function is not used, and so the values are compared with all its decimal numbers. | |
bool | operator!= (const scifir::vector_unit_3d &x, const string &init_vector_3d) |
Returns true if x is not equal to the vector_unit_3d initialized with the string being compared. The vectorial_display() function is not used, and so the values are compared with all its decimal numbers. | |
bool | operator== (const string &init_vector_3d, const scifir::vector_unit_3d &y) |
Returns true if x is equal to the vector_unit_3d initialized with the string being compared. The vectorial_display() function is not used, and so the values are compared with all its decimal numbers. | |
bool | operator!= (const string &init_vector_3d, const scifir::vector_unit_3d &y) |
Returns true if x is not equal to the vector_unit_3d initialized with the string being compared. The vectorial_display() function is not used, and so the values are compared with all its decimal numbers. | |
void | operator+= (string &x, const scifir::vector_unit_3d &y) |
Concatenates the string representation of the vector_unit_3d y to the string x. | |
string | operator+ (const string &x, const scifir::vector_unit_3d &y) |
Creates a new string as the concatenation of the string x with the representation string of the vector_unit_3d y. | |
string | operator+ (const scifir::vector_unit_3d &y, const string &x) |
Creates a new string as the concatenation of the string x with the representation string of the vector_unit_3d y. | |
ostream & | operator<< (ostream &os, const scifir::vector_unit_3d &x) |
Adds the string representation of the vector_unit_3d x to an output stream os. | |
istream & | operator>> (istream &is, scifir::vector_unit_3d &x) |
Allows that an istream initializes by string a vector_unit_3d x. | |
bool operator!= | ( | const scifir::vector_unit_3d & | x, |
const scifir::vector_unit_3d & | y | ||
) |
Comparison operator. Two vector_unit_3d are not equal if their value, dimensions, theta or phi are different.
Definition at line 539 of file vector_unit_3d.cpp.
bool operator!= | ( | const scifir::vector_unit_3d & | x, |
const string & | init_vector_3d | ||
) |
Returns true if x is not equal to the vector_unit_3d initialized with the string being compared. The vectorial_display() function is not used, and so the values are compared with all its decimal numbers.
Definition at line 550 of file vector_unit_3d.cpp.
bool operator!= | ( | const string & | init_vector_3d, |
const scifir::vector_unit_3d & | y | ||
) |
Returns true if x is not equal to the vector_unit_3d initialized with the string being compared. The vectorial_display() function is not used, and so the values are compared with all its decimal numbers.
Definition at line 561 of file vector_unit_3d.cpp.
scifir::vector_unit_3d operator* | ( | const scifir::scalar_unit & | x, |
const scifir::vector_unit_3d & | y | ||
) |
It creates a new vector_unit_3d scaling a vector_unit_3d by the scalar_unit x.
Definition at line 532 of file vector_unit_3d.cpp.
string operator+ | ( | const scifir::vector_unit_3d & | y, |
const string & | x | ||
) |
Creates a new string as the concatenation of the string x with the representation string of the vector_unit_3d y.
Definition at line 581 of file vector_unit_3d.cpp.
string operator+ | ( | const string & | x, |
const scifir::vector_unit_3d & | y | ||
) |
Creates a new string as the concatenation of the string x with the representation string of the vector_unit_3d y.
Definition at line 573 of file vector_unit_3d.cpp.
void operator+= | ( | string & | x, |
const scifir::vector_unit_3d & | y | ||
) |
Concatenates the string representation of the vector_unit_3d y to the string x.
Definition at line 566 of file vector_unit_3d.cpp.
ostream & operator<< | ( | ostream & | os, |
const scifir::vector_unit_3d & | x | ||
) |
Adds the string representation of the vector_unit_3d x to an output stream os.
Definition at line 589 of file vector_unit_3d.cpp.
bool operator== | ( | const scifir::vector_unit_3d & | x, |
const string & | init_vector_3d | ||
) |
Returns true if x is equal to the vector_unit_3d initialized with the string being compared. The vectorial_display() function is not used, and so the values are compared with all its decimal numbers.
Definition at line 544 of file vector_unit_3d.cpp.
bool operator== | ( | const string & | init_vector_3d, |
const scifir::vector_unit_3d & | y | ||
) |
Returns true if x is equal to the vector_unit_3d initialized with the string being compared. The vectorial_display() function is not used, and so the values are compared with all its decimal numbers.
Definition at line 555 of file vector_unit_3d.cpp.
istream & operator>> | ( | istream & | is, |
scifir::vector_unit_3d & | x | ||
) |
Allows that an istream initializes by string a vector_unit_3d x.
#endif // SCIFIR_UNITS_UNITS_VECTOR_UNIT_3D_HPP_INCLUDED
Definition at line 594 of file vector_unit_3d.cpp.