From 66183d9c1db16bce763c2c7e1bbbec3e8aaf8025 Mon Sep 17 00:00:00 2001 From: Ralf Ulrich <ralf.ulrich@kit.edu> Date: Wed, 11 Nov 2020 19:26:13 +0100 Subject: [PATCH] Delete Tracking.cc --- .../TrackingLeapFrogStraight/Tracking.cc | 61 ------------------- 1 file changed, 61 deletions(-) delete mode 100644 Processes/TrackingLeapFrogStraight/Tracking.cc diff --git a/Processes/TrackingLeapFrogStraight/Tracking.cc b/Processes/TrackingLeapFrogStraight/Tracking.cc deleted file mode 100644 index 7d2905f8f..000000000 --- a/Processes/TrackingLeapFrogStraight/Tracking.cc +++ /dev/null @@ -1,61 +0,0 @@ -/* - * (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. - */ - -#include <corsika/environment/Environment.h> -#include <corsika/geometry/Point.h> -#include <corsika/geometry/QuantityVector.h> -#include <corsika/geometry/Sphere.h> -#include <corsika/geometry/Vector.h> -#include <corsika/process/tracking_bfield/Tracking.h> - -#include <limits> -#include <stdexcept> -#include <utility> - -using namespace corsika::geometry; -using namespace corsika::units::si; - -namespace corsika::process::tracking_bfield { - - std::optional<std::pair<TimeType, TimeType>> TimeOfIntersection(Line const& line, - Sphere const& sphere) { - auto const delta = line.GetR0() - sphere.GetCenter(); - auto const v = line.GetV0(); - auto const vSqNorm = - v.squaredNorm(); // todo: get rid of this by having V0 normalized always - auto const R = sphere.GetRadius(); - - auto const vDotDelta = v.dot(delta); - auto const discriminant = - vDotDelta * vDotDelta - vSqNorm * (delta.squaredNorm() - R * R); - - if (discriminant.magnitude() > 0) { - auto const sqDisc = sqrt(discriminant); - auto const invDenom = 1 / vSqNorm; - return std::make_pair((-vDotDelta - sqDisc) * invDenom, - (-vDotDelta + sqDisc) * invDenom); - } else { - return {}; - } - } - - TimeType TimeOfIntersection(Line const& vLine, Plane const& vPlane) { - auto const delta = vPlane.GetCenter() - vLine.GetR0(); - auto const v = vLine.GetV0(); - auto const n = vPlane.GetNormal(); - auto const c = n.dot(v); - - if (c.magnitude() == 0) { - return std::numeric_limits<TimeType::value_type>::infinity() * 1_s; - } else { - return n.dot(delta) / c; - } - } -} // namespace corsika::process::tracking_bfield -- GitLab