Go to the documentation of this file.
23 #ifndef COM_DAFER45_TBTK_VECTOR_3D
24 #define COM_DAFER45_TBTK_VECTOR_3D
27 #include <initializer_list>
48 Vector3d(std::initializer_list<double> components);
51 Vector3d(
const std::vector<double> &components);
102 result.
x =
x + rhs.
x;
103 result.
y =
y + rhs.
y;
104 result.
z =
z + rhs.
z;
112 result.
x =
x - rhs.
x;
113 result.
y =
y - rhs.
y;
114 result.
z =
z - rhs.
z;
132 result.
x =
y*rhs.
z -
z*rhs.
y;
133 result.
y =
z*rhs.
x -
x*rhs.
z;
134 result.
z =
x*rhs.
y -
y*rhs.
x;
152 result.
x = lhs*rhs.
x;
153 result.
y = lhs*rhs.
y;
154 result.
z = lhs*rhs.
z;
170 return (*
this)/
norm();
182 return sqrt(
x*
x +
y*
y +
z*
z);
186 return lhs.
x*rhs.
x + lhs.
y*rhs.
y + lhs.
z*rhs.
z;
190 std::vector<double> result;
200 stream <<
"(" << v.
x <<
", " << v.
y <<
", " << v.
z <<
")";
double norm() const
Definition: Vector3d.h:181
double y
Definition: Vector3d.h:39
const Vector3d operator-() const
Definition: Vector3d.h:119
static double dotProduct(const Vector3d &lhs, const Vector3d &rhs)
Definition: Vector3d.h:185
const Vector3d unit() const
Definition: Vector3d.h:169
double x
Definition: Vector3d.h:36
Definition: Vector3d.h:33
const std::vector< double > getStdVector() const
Definition: Vector3d.h:189
friend std::ostream & operator<<(std::ostream &stream, const Vector3d &v)
Definition: Vector3d.h:199
const Vector3d perpendicular(const Vector3d &v) const
Definition: Vector3d.h:173
const Vector3d operator/(double rhs) const
Definition: Vector3d.h:159
const Vector3d parallel(const Vector3d &v) const
Definition: Vector3d.h:177
const Vector3d operator+(const Vector3d &rhs) const
Definition: Vector3d.h:99
std::ostream & operator<<(std::ostream &stream, const HoppingAmplitude &hoppingAmplitude)
Definition: HoppingAmplitude.h:315
const Vector2d operator*(double lhs, const Vector2d &rhs)
Definition: Vector2d.h:129
double z
Definition: Vector3d.h:42
const Vector3d operator*(const Vector3d &rhs) const
Definition: Vector3d.h:129