mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 05:04:08 +08:00
25 lines
422 B
C++
25 lines
422 B
C++
#include "../../../../../matrix/matrix/math.hpp"
|
|
|
|
typedef matrix::SquareMatrix<float, 24> SquareMatrix24f;
|
|
|
|
inline float sq(float in) {
|
|
return in * in;
|
|
}
|
|
|
|
namespace ecl{
|
|
inline float powf(float x, int exp)
|
|
{
|
|
float ret;
|
|
if (exp > 0) {
|
|
ret = x;
|
|
for (int count = 1; count < exp; count++) {
|
|
ret *= x;
|
|
}
|
|
return ret;
|
|
} else if (exp < 0) {
|
|
return 1.0f / ecl::powf(x, -exp);
|
|
}
|
|
return 1.0f;
|
|
}
|
|
}
|