From 135ade8636a297e83efb980bd84a3ead697df356 Mon Sep 17 00:00:00 2001 From: Maximilian Reininghaus <maximilian.reininghaus@kit.edu> Date: Wed, 15 Aug 2018 18:38:03 +0200 Subject: [PATCH] fixed sign issue in Helix --- Framework/Geometry/Helix.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Framework/Geometry/Helix.h b/Framework/Geometry/Helix.h index a1ba1075..195ae386 100644 --- a/Framework/Geometry/Helix.h +++ b/Framework/Geometry/Helix.h @@ -5,6 +5,8 @@ #include <Geometry/Point.h> #include <Units/PhysicalUnits.h> +#include <cmath> + class Helix // TODO: inherit from to-be-implemented "Trajectory" { using SpeedVec = Vector<Speed>; @@ -19,8 +21,8 @@ class Helix // TODO: inherit from to-be-implemented "Trajectory" public: 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(vPar.normalized().cross(vPerp)), - radius(pvPar.norm() / pOmegaC) + r0(pR0), omegaC(pOmegaC), vPar(pvPar), vPerp(pvPerp), uPerp(vPerp.cross(vPar.normalized()), + radius(pvPar.norm() / abs(pOmegaC)) { } -- GitLab