diff --git a/Framework/Geometry/Helix.h b/Framework/Geometry/Helix.h index d64df54461422222800f79a69cf1eaa9b726fe38..3453971c1b8b559ed67222b0f0bce1f388bef82b 100644 --- a/Framework/Geometry/Helix.h +++ b/Framework/Geometry/Helix.h @@ -19,8 +19,8 @@ class Helix // TODO: inherit from to-be-implemented "Trajectory" Length const radius; public: - Helix(Point const pR0, phys::units::quantity<phys::units::frequency_d> pOmegaC, - SpeedVec const pvPar, SpeedVec const pvPerp) : + Helix(Point const& pR0, phys::units::quantity<phys::units::frequency_d> pOmegaC, + SpeedVec const& pvPar, SpeedVec const& pvPerp) : r0(pR0), omegaC(pOmegaC), vPar(pvPar), vPerp(pvPerp), uPerp(vPerp.cross(vPar.normalized())), radius(pvPar.norm() / abs(pOmegaC)) { diff --git a/Framework/Geometry/LineTrajectory.h b/Framework/Geometry/LineTrajectory.h new file mode 100644 index 0000000000000000000000000000000000000000..ec026e065dee0a9fe4fbb0b2835d719756652dd4 --- /dev/null +++ b/Framework/Geometry/LineTrajectory.h @@ -0,0 +1,26 @@ +#ifndef _include_LINETRAJECTORY_H +#define _include_LINETRAJECTORY_H + +#include <Framework/Geometry/Point.h> +#include <Framework/Geometry/Vector.h> +#include <Units/PhysicalUnits.h> + +class LineTrajectory // TODO: inherit from Trajectory +{ + using SpeedVec = Vector<Speed::dimension_type>; + + Point const r0; + SpeedVec const v0; + + LineTrajectory(Point const& pR0, SpeedVec const& pV0) : + r0(r0), v0(pV0) + { + } + + auto getPosition(Time t) const + { + return r0 + v0 * t; + } +}; + +#endif