Alex Alex - 1 month ago 13
C++ Question

Member function in Eigen math library for vector magnitude

I have been trying to find a method that computes the magnitude of a vector in Eigen and I was not able to. Can somebody provide me with the function name of just if it doesn't exist??

I can create a global method that does the job but I prefer not to.

Answer

You want .norm(). Note that there's also .squaredNorm(), .normalized() and .normalize().

Comments