 |
CONFIG LIB
1.5
Configuration Files Library (by TGG 2020)
|
Go to the documentation of this file.
44 VECTOR_3D(
double xp,
double yp,
double zp ) {
x = xp;
y = yp;
z = zp; };
52 double Len(
void )
const {
return sqrt(
x*
x +
y*
y +
z*
z ); };
54 double LenXY(
void )
const {
return sqrt(
x*
x +
y*
y ); };
56 double LenXZ(
void )
const {
return sqrt(
x*
x +
z*
z ); };
58 double LenYZ(
void )
const {
return sqrt(
y*
y +
z*
z ); };
65 void GetFrom(
double xp,
double yp,
double zp ){
x = xp;
y = yp;
z = zp; };
67 void GetFrom(
double a[] ) {
x = a[0];
y = a[1];
z = a[2];};
70 void PutTo(
double &xp,
double &yp,
double &zp ){ xp =
x; yp =
y; zp =
z; };
72 void PutTo(
double a[] ) { a[0] =
x; a[1] =
y; a[2] =
z;};
75 void AddTo(
double &xp,
double &yp,
double &zp ){ xp +=
x; yp +=
y; zp +=
z; };
77 void AddTo(
double a[] ) { a[0] +=
x; a[1] +=
y; a[2] +=
z;};
80 void Set0(
void ){
x = 0.0;
y = 0.0;
z = 0.0; };
83 bool Isnan(
void ){
return std::isnan(
x ) || std::isnan(
y ) || std::isnan(
z ); };
87 void rotX(
double alpha);
89 void rotY(
double alpha);
91 void rotZ(
double alpha);
93 void rotdX(
double alfa);
95 void rotdY(
double alfa,
double dX = 0. );
97 void rotdZ(
double alfa);
void vout(FILE *ff, VECTOR_3D vec)
printf vector components (x,y,z) to stream ff
bool operator==(const VECTOR_3D &A, const VECTOR_3D &B)
Boolean operator - compares two vectors - true if all appropriate coordinates are equal.
void v_fprintf(FILE *dest, char *name, const VECTOR_3D &vec)
print to stream "dest" name and vector components
void GetFrom(double a[])
sets coordinates from the aray
void AddTo(double a[])
adds coordinates to the array
double Len(void) const
the value of the vector
void voutn(FILE *ff, VECTOR_3D vec)
printf vector components (x,-y,z) to stream ff
void rotY(double alpha)
rotates the vector relative to the Y axis by an alpha[rad] angle
double Square(void) const
the square of the vector value
double Normalize(void)
normalizes the vector to unit - coordiantes are divided by the vector value, returnes the vector valu...
void rotdX(double alfa)
rotates the vector relative to the X axis by an alpha[deg] angle (precise values for 0,...
void rotdZ(double alfa)
rotates the vector relative to the Z axis by an alpha[deg] angle (precise values for 0,...
void v_sprintf(char *dest, char *name, const VECTOR_3D &vec)
print to string "dest" name and vector components
double LenXZ(void) const
the value of the 2D vector in XZ plane
VECTOR_3D operator%(const VECTOR_3D &A, const VECTOR_3D &B)
Arithmetic operator - cross (vector) product of two vectors.
double LenYZ(void) const
the value of the 2D vector in YZ plane
void operator-=(VECTOR_3D &A, const VECTOR_3D &B)
Arithmetic operator - subtraction assigment.
VECTOR_3D VECTOR_3__E0(void)
returns vector (0,0,0)
VECTOR_3D operator+(const VECTOR_3D &A, const VECTOR_3D &B)
Arithmetic operator - sum of two vectors.
Vector 3D class - vector manipulation.
VECTOR_3D(const VECTOR_3D &v)
constructor that copies coordiantes from another vector
VECTOR_3D VECTOR_3__Ez(void)
returns vector (0,0,1)
VECTOR_3D operator/(const VECTOR_3D &A, const double &s)
Arithmetic operator - vector divided by scalar (product of vector and reciprocal scalar)
VECTOR_3D(void)
deafult constructor
VECTOR_3D & operator=(const VECTOR_3D &v)
assignment operator
void PutTo(double a[])
copies coordinates to the array
VECTOR_3D operator-(const VECTOR_3D &A, const VECTOR_3D &B)
Arithmetic operator - subtraction of two vectors (sum of A and -B)
void GetFrom(double xp, double yp, double zp)
sets coordinates from three variables
void AddTo(double &xp, double &yp, double &zp)
adds coordinates to three variables
double operator*(const VECTOR_3D &A, const VECTOR_3D &B)
Arithmetic operator - dot (scalar) product of two vectors.
VECTOR_3D VECTOR_3__Ex(void)
returns vector (1,0,0)
double LenXY(void) const
the value of the 2D vector in XY plane
void rotZ(double alpha)
rotates the vector relative to the Z axis by an alpha[rad] angle
VECTOR_3D operator&(const VECTOR_3D &A, const VECTOR_3D &B)
Arithmetic operator - coordinates products (AxBx, AyBy, AzBz)
VECTOR_3D VECTOR_3__E1(void)
returns vector (1,1,1)
void Set0(void)
resets coordinates to zero
void rotX(double alpha)
Rotating functions rotates the vector relative to the X axis by an alpha[rad] angle
void operator/=(VECTOR_3D &A, const double &s)
Arithmetic operator - division assigment.
bool Isnan(void)
determines if any coordinate of given vector is a not-a-number (NaN) value.
void rotdY(double alfa, double dX=0.)
rotates the vector relative to the Y axis (shifted by dX longwise X) by an alpha[deg] angle (precise ...
void v_printf(char *name, const VECTOR_3D &vec)
print to stdout name and vector components
void operator&=(VECTOR_3D &A, const VECTOR_3D &B)
Arithmetic operator - multiplication assigment (coordiante by coordiante)
void operator%=(VECTOR_3D &A, const VECTOR_3D &B)
Arithmetic operator - cross product assigment.
void PutTo(double &xp, double &yp, double &zp)
copies coordinates to three variables
void operator*=(VECTOR_3D &A, const double &s)
Arithmetic operator - multiplication assigment.
void operator+=(VECTOR_3D &A, const VECTOR_3D &B)
Arithmetic operator - addition assigment.
std::ostream & operator<<(std::ostream &out, const VECTOR_3D &v)
print to std:ostream
VECTOR_3D VECTOR_3__Ey(void)
returns vector (0,1,0)
VECTOR_3D(double a[])
constructor that copies coordiantes from the array
VECTOR_3D(double xp, double yp, double zp)
constructor that copies coordiantes from three variables
void vout0(FILE *ff, VECTOR_3D vec)
printf vector components (x,0,z) to stream ff