CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
Helix.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/core/PhysicalGeometry.hpp>
13 #include <corsika/framework/geometry/Point.hpp>
14 #include <corsika/framework/geometry/Vector.hpp>
15 
16 #include <cmath>
17 
18 namespace corsika {
19 
34  class Helix {
35 
36  public:
37  Helix(Point const& pR0, FrequencyType pOmegaC, VelocityVector const& pvPar,
38  VelocityVector const& pvPerp)
39  : r0_(pR0)
40  , omegaC_(pOmegaC)
41  , vPar_(pvPar)
42  , vPerp_(pvPerp)
43  , uPerp_(vPerp_.cross(vPar_.normalized()))
44  , radius_(pvPar.getNorm() / abs(pOmegaC)) {}
45 
46  LengthType getRadius() const;
47 
48  Point getPosition(TimeType const t) const;
49 
50  VelocityVector getVelocity(TimeType const t) const;
51 
52  Point getPositionFromArclength(LengthType const l) const;
53 
54  LengthType getArcLength(TimeType const t1, TimeType const t2) const;
55 
56  TimeType getTimeFromArclength(LengthType const l) const;
57 
58  private:
59  Point r0_;
60  FrequencyType omegaC_;
62  VelocityVector vPar_;
63  VelocityVector vPerp_, uPerp_;
64  LengthType radius_;
65  };
66 
67 } // namespace corsika
68 
69 #include <corsika/detail/framework/geometry/Helix.inl>
quantity< D, X > constexpr abs(quantity< D, X > const &x)
absolute value.
Definition: quantity.hpp:632
Import and extend the phys::units package.
`, since they are used everywhere as integral part of the framework.
quantity_type getNorm() const