1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/** * Magnitude.cc * * Created on: 31 oct. 2012 * Author: AKKA IS */ #include "magnitude.hh" #include <math.h> float magnitude(const std::vector<float>& vec) { return sqrtf(vec[0] * vec[0] + vec[1] * vec[1] + vec[2] * vec[2]); }