aegir
Phlex-based simulation framework for the SHiP experiment.
Loading...
Searching...
No Matches
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
12namespace aegir {
13
14// Euclidean norm of a 3-vector (momentum, position, ...).
15inline 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
Definition math_utils.hpp:12
double magnitude(std::array< double, 3 > const &v)
Definition math_utils.hpp:15