AP_Math: correct norm to need two arguments
Correctly use sqrtf instead of the double version Stop casting to float since sq already returns one
This commit is contained in:
parent
f3d995a716
commit
7b98f41947
@ -185,10 +185,10 @@ float sq(const T first, const Params... parameters)
|
||||
* Variadic template for calculating the norm (pythagoras) of a vector of any
|
||||
* dimension.
|
||||
*/
|
||||
template<class T, class... Params>
|
||||
float norm(const T first, const Params... parameters)
|
||||
template<class T, class U, class... Params>
|
||||
float norm(const T first, const U second, const Params... parameters)
|
||||
{
|
||||
return sqrt(static_cast<float>(sq(first, parameters...)));
|
||||
return sqrtf(sq(first, second, parameters...));
|
||||
}
|
||||
|
||||
template<typename A, typename B>
|
||||
|
Loading…
Reference in New Issue
Block a user