28 : x(x_component), y(y_component), z(z_component) {}
31 return (component_index == 0) ? x : (component_index == 1) ? y : z;
34 return (component_index == 0) ? x : (component_index == 1) ? y : z;
38 return {x + other.
x, y + other.
y, z + other.
z};
41 return {x - other.
x, y - other.
y, z - other.
z};
44 return {x * scalar, y * scalar, z * scalar};
47 return {x / scalar, y / scalar, z / scalar};
60 return x * other.
x + y * other.
y + z * other.
z;
63 return {y * other.
z - z * other.
y, z * other.
x - x * other.
z, x * other.
y - y * other.
x};
69 return std::sqrt(norm2());
74 return vector * scalar;
Vector3D operator*(Real scalar, const Vector3D &vector)
Vector3D operator*(Real scalar) const
Vector3D operator-() const
Vector3D cross(const Vector3D &other) const
Vector3D operator+(const Vector3D &other) const
Real operator[](int component_index) const
Vector3D operator-(const Vector3D &other) const
Vector3D & operator+=(const Vector3D &other)
Vector3D operator/(Real scalar) const
constexpr Vector3D(Real x_component, Real y_component, Real z_component)
Real & operator[](int component_index)
Real dot(const Vector3D &other) const