"tests/git@gitlab.iap.kit.edu:pranav/corsika.git" did not exist on "35b66632dc172e5aa805e684178d11f85e0b6a53"
Newer
Older
/**
* (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
*
* See file AUTHORS for a list of contributors.
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
*/
#ifndef _include_LINETRAJECTORY_H
#define _include_LINETRAJECTORY_H
#include <corsika/geometry/BaseTrajectory.h>
#include <corsika/geometry/Point.h>
#include <corsika/geometry/Vector.h>
#include <corsika/units/PhysicalUnits.h>
class LineTrajectory : public BaseTrajectory {
using VelocityVec = Vector<corsika::units::si::SpeedType::dimension_type>;
public:
LineTrajectory(Point const& pR0, VelocityVec const& pV0)
: r0(pR0)
Point GetPosition(corsika::units::si::TimeType t) const override {
return r0 + v0 * t;
}
LengthType DistanceBetween(corsika::units::si::TimeType t1,
corsika::units::si::TimeType t2) const override {
assert(t2 >= t1);
return v0.norm() * (t2 - t1);
}