Alex Alex - 1 year ago 147
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 Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download