IAP GITLAB
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
corsika
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Air Shower Physics
corsika
Merge requests
!409
remove unused file
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
remove unused file
removed_unused_file
into
master
Overview
0
Commits
1
Pipelines
2
Changes
1
Merged
Ralf Ulrich
requested to merge
removed_unused_file
into
master
3 years ago
Overview
0
Commits
1
Pipelines
2
Changes
1
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
d88b1073
1 commit,
3 years ago
1 file
+
0
−
59
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
corsika/detail/modules/TrackingLine.inl deleted
100644 → 0
+
0
−
59
Options
/*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
*
* 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.
*/
#pragma once
#include
<corsika/framework/geometry/Point.hpp>
#include
<corsika/framework/geometry/QuantityVector.hpp>
#include
<corsika/framework/geometry/Sphere.hpp>
#include
<corsika/framework/geometry/Vector.hpp>
#include
<corsika/media/Environment.hpp>
#include
<limits>
#include
<stdexcept>
#include
<utility>
namespace
corsika
::
tracking_line
{
inline
std
::
optional
<
std
::
pair
<
TimeType
,
TimeType
>>
TimeOfIntersection
(
corsika
::
Line
const
&
line
,
corsika
::
Sphere
const
&
sphere
)
{
auto
const
delta
=
line
.
getStartPoint
()
-
sphere
.
getCenter
();
auto
const
v
=
line
.
getVelocity
();
auto
const
vSqNorm
=
v
.
getSquaredNorm
();
// 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
.
getSquaredNorm
()
-
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
{};
}
}
inline
TimeType
getTimeOfIntersection
(
Line
const
&
vLine
,
Plane
const
&
vPlane
)
{
auto
const
delta
=
vPlane
.
getCenter
()
-
vLine
.
getStartPoint
();
auto
const
v
=
vLine
.
getVelocity
();
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::tracking_line
Loading