12 #include <corsika/framework/geometry/BaseVector.hpp> 13 #include <corsika/framework/geometry/QuantityVector.hpp> 29 template <
typename TDimension>
30 class Vector :
public BaseVector<TDimension> {
33 using quantity_square_type =
34 decltype(std::declval<quantity_type>() * std::declval<quantity_type>());
37 : BaseVector<TDimension>(pCS, pQVector) {}
42 : BaseVector<TDimension>(cs, QuantityVector<TDimension>(x, y, z)) {}
110 template <
typename TDimension2>
113 template <
typename TDimension2>
116 Vector operator+(Vector<TDimension>
const& pVec)
const;
118 Vector operator-(Vector<TDimension>
const& pVec)
const;
120 auto& operator*=(
double const p);
122 template <
typename TScalarDim>
124 template <
typename TScalarDim>
127 auto operator*(
double const p)
const;
129 auto operator/(
double const p)
const;
131 auto& operator+=(Vector<TDimension>
const& pVec);
133 auto& operator-=(Vector<TDimension>
const& pVec);
135 auto operator-()
const;
137 auto normalized()
const;
139 template <
typename TDimension2>
140 auto cross(Vector<TDimension2>
const& pV)
const;
142 template <
typename TDimension2>
143 auto dot(Vector<TDimension2>
const& pV)
const;
155 template <
typename TDimension,
typename UDimension>
156 Vector<phys::units::detail::product_d<TDimension, UDimension>> operator*(
157 quantity<UDimension>
const n, Vector<TDimension>
const& vec);
168 template <
typename TDimension>
169 Vector<TDimension> operator*(
double const n, Vector<TDimension>
const& vec);
173 #include <corsika/detail/framework/geometry/Vector.inl> void rebase(CoordinateSystemPtr const &pCS)
Import and extend the phys::units package.
class "quantity" is the heart of the library.
`, since they are used everywhere as integral part of the framework.
static constexpr quantity zero()
We need a "zero" of each type – for comparisons, to initialize running totals, etc.
std::shared_ptr< CoordinateSystem const > CoordinateSystemPtr
To refer to CoordinateSystems, only the CoordinateSystemPtr must be used.
quantity_type getNorm() const
auto getParallelProjectionOnto(Vector< TDimension2 > const &pVec, CoordinateSystemPtr const &pCS) const
QuantityVector< TDimension > const & getComponents() const
quantity_square_type getSquaredNorm() const