CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
Point.hpp
1 /*
2  * (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
3  *
4  * This software is distributed under the terms of the GNU General Public
5  * Licence version 3 (GPL Version 3). See file LICENSE for a full version of
6  * the license.
7  */
8 
9 #pragma once
10 
12 #include <corsika/framework/geometry/BaseVector.hpp>
13 #include <corsika/framework/geometry/QuantityVector.hpp>
14 #include <corsika/framework/geometry/Vector.hpp>
15 
16 namespace corsika {
17 
22  class Point : public BaseVector<length_d> {
23 
24  public:
25  Point(CoordinateSystemPtr const& pCS, QuantityVector<length_d> const& pQVector)
26  : BaseVector<length_d>(pCS, pQVector) {}
27 
29  : BaseVector<length_d>(cs, {x, y, z}) {}
30 
34  inline QuantityVector<length_d> const& getCoordinates() const;
36 
44 
53 
63  inline LengthType getX(CoordinateSystemPtr const& pCS) const;
64  inline LengthType getY(CoordinateSystemPtr const& pCS) const;
65  inline LengthType getZ(CoordinateSystemPtr const& pCS) const;
72  inline void rebase(CoordinateSystemPtr const& pCS);
73 
74  inline Point operator+(Vector<length_d> const& pVec) const;
75  inline Point operator-(Vector<length_d> const& pVec) const;
76 
80  inline Vector<length_d> operator-(Point const& pB) const;
81  };
82 
83  /*
84  * calculates the distance between two points
85  */
86  inline LengthType distance(Point const& p1, Point const& p2);
87 
88 } // namespace corsika
89 
90 #include <corsika/detail/framework/geometry/Point.inl>
Import and extend the phys::units package.
void rebase(CoordinateSystemPtr const &pCS)
`, since they are used everywhere as integral part of the framework.
std::shared_ptr< CoordinateSystem const > CoordinateSystemPtr
To refer to CoordinateSystems, only the CoordinateSystemPtr must be used.
QuantityVector< length_d > const & getCoordinates() const