From b7feb47971837ba1dd5a230d8bddcedc61975ae1 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 29 Aug 2018 11:30:21 -0500 Subject: [PATCH] Add norm method on Position --- include/openmc/position.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/openmc/position.h b/include/openmc/position.h index 97ab6f0e66..d7a13c01e7 100644 --- a/include/openmc/position.h +++ b/include/openmc/position.h @@ -1,6 +1,7 @@ #ifndef OPENMC_POSITION_H #define OPENMC_POSITION_H +#include #include namespace openmc { @@ -46,6 +47,9 @@ struct Position { inline double dot(Position other) { return x*other.x + y*other.y + z*other.z; } + inline double norm() { + return std::sqrt(x*x + y*y + z*z); + } // Data members double x = 0.;