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_2d.hpp"
#include "../coordinates/coordinates_2d.hpp"
#include "../util/types.hpp"
#include "boost/algorithm/string.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_2d &x) |
It returns the value of the vector in polar coordinates, p. | |
vector_unit_2d | scifir::sqrt (const vector_unit_2d &x) |
It squares the vector, creating a vector_unit_2d with the value squared and always the same theta. The dimensions are squared with the same rules for the square of dimensions than scalar_unit classes. | |
vector_unit_2d | scifir::sqrt_nth (const vector_unit_2d &x, int index) |
It takes the root of the vector with the index given, creating a vector_unit_2d with the value rooted to that index and always maintains the same theta. 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_2d &x, const vector_unit_2d &y) |
Creates a scalar_unit as the dot product of the two vectors x and y. | |
angle | scifir::angle_between (const vector_unit_2d &x, const vector_unit_2d &y) |
Returns the angle between two vectors x and y inside a 2D space. | |
bool | scifir::same_direction (const vector_unit_2d &x, const vector_unit_2d &y) |
Checks if two vectors x and y have the same direction. | |
bool | scifir::parallel (const vector_unit_2d &x, const vector_unit_2d &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_2d &x, const vector_unit_2d &y) |
Checks if two vectors x and y are orthogonal, that's, if they have 90 degrees of difference. | |
scifir::vector_unit_2d | operator* (const scifir::scalar_unit &x, const scifir::vector_unit_2d &y) |
It creates a new vector_unit_3d scaling a vector_unit_3d by the scalar_unit x. | |
bool | operator!= (const scifir::vector_unit_2d &x, const scifir::vector_unit_2d &y) |
Comparison operator. Two vector_unit_2d are not equal if their value, dimensions or theta are different. | |
bool | operator== (const scifir::vector_unit_2d &x, const string &init_vector_2d) |
Returns true if x is equal to the vector_unit_2d 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_2d &x, const string &init_vector_2d) |
Returns true if x is not equal to the vector_unit_2d 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_2d, const scifir::vector_unit_2d &x) |
Returns true if x is equal to the vector_unit_2d 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_2d, const scifir::vector_unit_2d &x) |
Returns true if x is not equal to the vector_unit_2d 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_2d &y) |
Concatenates the string representation of the vector_unit_2d y to the string x. | |
string | operator+ (const string &x, const scifir::vector_unit_2d &y) |
Creates a new string as the concatenation of the string x with the representation string of the vector_unit_2d y. | |
string | operator+ (const scifir::vector_unit_2d &y, const string &x) |
Creates a new string as the concatenation of the string x with the representation string of the vector_unit_2d y. | |
ostream & | operator<< (ostream &os, const scifir::vector_unit_2d &x) |
Adds the string representation of the vector_unit_2d x to an output stream os. | |
istream & | operator>> (istream &is, scifir::vector_unit_2d &x) |
Allows that an istream initializes by string a vector_unit_2d x. | |
bool operator!= | ( | const scifir::vector_unit_2d & | x, |
const scifir::vector_unit_2d & | y | ||
) |
Comparison operator. Two vector_unit_2d are not equal if their value, dimensions or theta are different.
Definition at line 397 of file vector_unit_2d.cpp.
bool operator!= | ( | const scifir::vector_unit_2d & | x, |
const string & | init_vector_2d | ||
) |
Returns true if x is not equal to the vector_unit_2d 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 408 of file vector_unit_2d.cpp.
bool operator!= | ( | const string & | init_vector_2d, |
const scifir::vector_unit_2d & | x | ||
) |
Returns true if x is not equal to the vector_unit_2d 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 419 of file vector_unit_2d.cpp.
scifir::vector_unit_2d operator* | ( | const scifir::scalar_unit & | x, |
const scifir::vector_unit_2d & | y | ||
) |
It creates a new vector_unit_3d scaling a vector_unit_3d by the scalar_unit x.
Definition at line 390 of file vector_unit_2d.cpp.
string operator+ | ( | const scifir::vector_unit_2d & | y, |
const string & | x | ||
) |
Creates a new string as the concatenation of the string x with the representation string of the vector_unit_2d y.
Definition at line 439 of file vector_unit_2d.cpp.
string operator+ | ( | const string & | x, |
const scifir::vector_unit_2d & | y | ||
) |
Creates a new string as the concatenation of the string x with the representation string of the vector_unit_2d y.
Definition at line 431 of file vector_unit_2d.cpp.
void operator+= | ( | string & | x, |
const scifir::vector_unit_2d & | y | ||
) |
Concatenates the string representation of the vector_unit_2d y to the string x.
Definition at line 424 of file vector_unit_2d.cpp.
ostream & operator<< | ( | ostream & | os, |
const scifir::vector_unit_2d & | x | ||
) |
Adds the string representation of the vector_unit_2d x to an output stream os.
Definition at line 447 of file vector_unit_2d.cpp.
bool operator== | ( | const scifir::vector_unit_2d & | x, |
const string & | init_vector_2d | ||
) |
Returns true if x is equal to the vector_unit_2d 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 402 of file vector_unit_2d.cpp.
bool operator== | ( | const string & | init_vector_2d, |
const scifir::vector_unit_2d & | x | ||
) |
Returns true if x is equal to the vector_unit_2d 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 413 of file vector_unit_2d.cpp.
istream & operator>> | ( | istream & | is, |
scifir::vector_unit_2d & | x | ||
) |
Allows that an istream initializes by string a vector_unit_2d x.
Definition at line 452 of file vector_unit_2d.cpp.