aegir
Phlex-based simulation framework for the SHiP experiment.
Loading...
Searching...
No Matches
src
math_utils.hpp
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2026 CERN for the benefit of the SHiP Collaboration
2
//
3
// SPDX-License-Identifier: LGPL-3.0-or-later
4
5
// math_utils.hpp — small numeric helpers shared across plugins
6
7
#pragma once
8
9
#include <array>
10
#include <cmath>
11
12
namespace
aegir
{
13
14
// Euclidean norm of a 3-vector (momentum, position, ...).
15
inline
double
magnitude
(std::array<double, 3>
const
& v) {
16
return
std::sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
17
}
18
19
}
// namespace aegir
aegir
Definition
math_utils.hpp:12
aegir::magnitude
double magnitude(std::array< double, 3 > const &v)
Definition
math_utils.hpp:15
Generated by
1.9.8