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_nd.hpp"
#include "../coordinates/coordinates_2d.hpp"
#include "../coordinates/coordinates_3d.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 | |
string | scifir::to_string (const vector_unit_nd &x) |
It generates a string representation of vector_unit_nd. | |
scalar_unit | scifir::norm (const vector_unit_nd &x) |
It returns the value of the vector, which is the value in 1D, p in 2D (polar coordinates), or r in 3D (spherical coordinates). | |
vector_unit_nd | scifir::sqrt (const vector_unit_nd &x) |
It squares the vector, creating a vector_unit_nd with the value squared and always the same angles. The dimensions are squared with the same rules for the square of dimensions than scalar_unit classes. | |
vector_unit_nd | scifir::sqrt_nth (const vector_unit_nd &x, int index) |
It takes the root of the vector with the index given, creating a vector_unit_nd with the value rooted to that index and always maintains the same angles. 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_nd &x, const vector_unit_nd &y) |
Creates a scalar_unit as the dot product of the two vectors x and y. | |
vector_unit_nd | scifir::cross_product (const vector_unit_nd &x, const vector_unit_nd &y) |
Creates a vector_unit_nd as the cross product of the two vectors x and y. If both vectors aren't in 3D, it returns an empty vector_unit_nd, because the cross product doesn't exists outside 3D. | |
angle | scifir::angle_between (const vector_unit_nd &x, const vector_unit_nd &y) |
Returns the angle between two vectors x and y inside the ND space, which can be 2D or 3D, depending on the ND of the vectors. If the vectors have different ND, it returns an empty vector_unit_nd instead. | |
bool | scifir::same_nd (const vector_unit_nd &x, const vector_unit_nd &y) |
Checks if two vectors have the same number of dimensions. | |
bool | scifir::same_direction (const vector_unit_nd &x, const vector_unit_nd &y) |
Checks if two vectors x and y have the same direction. Both vectors must have the same ND, otherwise it returns an empty vector_unit_nd instead. | |
bool | scifir::parallel (const vector_unit_nd &x, const vector_unit_nd &y) |
Checks if two vectors x and y are parallel, which means that their direction is the same or the exact opposite. Both vectors must have the same ND, otherwise it returns an empty vector_unit_nd instead. | |
bool | scifir::orthogonal (const vector_unit_nd &x, const vector_unit_nd &y) |
Checks if two vectors x and y are orthogonal, that's, if they have 90 degrees between them. Both vectors must have the same ND, otherwise it returns an empty vector_unit_nd instead. | |
scifir::vector_unit_nd | operator* (const scifir::scalar_unit &x, const scifir::vector_unit_nd &y) |
It creates a new vector_unitn3d scaling a vector_unit_nd by the scalar_unit x. | |
bool | operator!= (const scifir::vector_unit_nd &x, const scifir::vector_unit_nd &y) |
Comparison operator. Two vector_unit_nd are not equal if their value, dimensions or angles are different. | |
bool | operator== (const scifir::vector_unit_nd &x, const string &init_vector_nd) |
Returns true if x is equal to the vector_unit_nd 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_nd &x, const string &init_vector_nd) |
Returns true if x is not equal to the vector_unit_nd 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_nd, const scifir::vector_unit_nd &x) |
Returns true if x is equal to the vector_unit_nd 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_nd, const scifir::vector_unit_nd &x) |
Returns true if x is not equal to the vector_unit_nd 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_nd &y) |
Concatenates the string representation of the vector_unit_nd y to the string x. | |
string | operator+ (const string &x, const scifir::vector_unit_nd &y) |
Creates a new string as the concatenation of the string x with the representation string of the vector_unit_nd y. | |
string | operator+ (const scifir::vector_unit_nd &y, const string &x) |
Creates a new string as the concatenation of the string x with the representation string of the vector_unit_nd y. | |
ostream & | operator<< (ostream &os, const scifir::vector_unit_nd &x) |
Adds the string representation of the vector_unit_nd x to an output stream os. | |
istream & | operator>> (istream &is, scifir::vector_unit_nd &x) |
Allows that an istream initializes by string a vector_unit_nd x. | |
bool operator!= | ( | const scifir::vector_unit_nd & | x, |
const scifir::vector_unit_nd & | y | ||
) |
Comparison operator. Two vector_unit_nd are not equal if their value, dimensions or angles are different.
Definition at line 947 of file vector_unit_nd.cpp.
bool operator!= | ( | const scifir::vector_unit_nd & | x, |
const string & | init_vector_nd | ||
) |
Returns true if x is not equal to the vector_unit_nd 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 958 of file vector_unit_nd.cpp.
bool operator!= | ( | const string & | init_vector_nd, |
const scifir::vector_unit_nd & | x | ||
) |
Returns true if x is not equal to the vector_unit_nd 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 969 of file vector_unit_nd.cpp.
scifir::vector_unit_nd operator* | ( | const scifir::scalar_unit & | x, |
const scifir::vector_unit_nd & | y | ||
) |
It creates a new vector_unitn3d scaling a vector_unit_nd by the scalar_unit x.
Definition at line 925 of file vector_unit_nd.cpp.
string operator+ | ( | const scifir::vector_unit_nd & | y, |
const string & | x | ||
) |
Creates a new string as the concatenation of the string x with the representation string of the vector_unit_nd y.
Definition at line 989 of file vector_unit_nd.cpp.
string operator+ | ( | const string & | x, |
const scifir::vector_unit_nd & | y | ||
) |
Creates a new string as the concatenation of the string x with the representation string of the vector_unit_nd y.
Definition at line 981 of file vector_unit_nd.cpp.
void operator+= | ( | string & | x, |
const scifir::vector_unit_nd & | y | ||
) |
Concatenates the string representation of the vector_unit_nd y to the string x.
Definition at line 974 of file vector_unit_nd.cpp.
ostream & operator<< | ( | ostream & | os, |
const scifir::vector_unit_nd & | x | ||
) |
Adds the string representation of the vector_unit_nd x to an output stream os.
Definition at line 997 of file vector_unit_nd.cpp.
bool operator== | ( | const scifir::vector_unit_nd & | x, |
const string & | init_vector_nd | ||
) |
Returns true if x is equal to the vector_unit_nd 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 952 of file vector_unit_nd.cpp.
bool operator== | ( | const string & | init_vector_nd, |
const scifir::vector_unit_nd & | x | ||
) |
Returns true if x is equal to the vector_unit_nd 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 963 of file vector_unit_nd.cpp.
istream & operator>> | ( | istream & | is, |
scifir::vector_unit_nd & | x | ||
) |
Allows that an istream initializes by string a vector_unit_nd x.
Definition at line 1011 of file vector_unit_nd.cpp.