diff options
author | jgoppert <james.goppert@gmail.com> | 2013-01-06 15:33:55 -0500 |
---|---|---|
committer | jgoppert <james.goppert@gmail.com> | 2013-01-06 15:33:55 -0500 |
commit | d9491b20cc5fc8b683eb0f60a50da6b322b55e57 (patch) | |
tree | 48d44accf2ccff88766bca351c78be06bb9fa4a0 /apps/systemlib/math/Quaternion.hpp | |
parent | 4f3b17f53b120cd54112097f4217a90863013c1f (diff) | |
download | px4-firmware-d9491b20cc5fc8b683eb0f60a50da6b322b55e57.tar.gz px4-firmware-d9491b20cc5fc8b683eb0f60a50da6b322b55e57.tar.bz2 px4-firmware-d9491b20cc5fc8b683eb0f60a50da6b322b55e57.zip |
Reformat of math library with astyle.
Diffstat (limited to 'apps/systemlib/math/Quaternion.hpp')
-rw-r--r-- | apps/systemlib/math/Quaternion.hpp | 115 |
1 files changed, 58 insertions, 57 deletions
diff --git a/apps/systemlib/math/Quaternion.hpp b/apps/systemlib/math/Quaternion.hpp index 334b0dd03..4b4e959d8 100644 --- a/apps/systemlib/math/Quaternion.hpp +++ b/apps/systemlib/math/Quaternion.hpp @@ -42,7 +42,8 @@ #include "Vector.hpp" #include "Matrix.hpp" -namespace math { +namespace math +{ class Dcm; class EulerAngles; @@ -51,62 +52,62 @@ class __EXPORT Quaternion : public Vector { public: - /** - * default ctor - */ - Quaternion(); - - /** - * ctor from floats - */ - Quaternion(float a, float b, float c, float d); - - /** - * ctor from data - */ - Quaternion(const float * data); - - /** - * ctor from Vector - */ - Quaternion(const Vector & v); - - /** - * ctor from EulerAngles - */ - Quaternion(const EulerAngles & euler); - - /** - * ctor from Dcm - */ - Quaternion(const Dcm & dcm); - - /** - * deep copy ctor - */ - Quaternion(const Quaternion & right); - - /** - * dtor - */ - virtual ~Quaternion(); - - /** - * derivative - */ - Vector derivative(const Vector & w); - - /** - * accessors - */ - void setA(float a) { (*this)(0) = a; } - void setB(float b) { (*this)(1) = b; } - void setC(float c) { (*this)(2) = c; } - void setD(float d) { (*this)(3) = d; } - const float & getA() const { return (*this)(0); } - const float & getB() const { return (*this)(1); } - const float & getC() const { return (*this)(2); } - const float & getD() const { return (*this)(3); } + /** + * default ctor + */ + Quaternion(); + + /** + * ctor from floats + */ + Quaternion(float a, float b, float c, float d); + + /** + * ctor from data + */ + Quaternion(const float *data); + + /** + * ctor from Vector + */ + Quaternion(const Vector &v); + + /** + * ctor from EulerAngles + */ + Quaternion(const EulerAngles &euler); + + /** + * ctor from Dcm + */ + Quaternion(const Dcm &dcm); + + /** + * deep copy ctor + */ + Quaternion(const Quaternion &right); + + /** + * dtor + */ + virtual ~Quaternion(); + + /** + * derivative + */ + Vector derivative(const Vector &w); + + /** + * accessors + */ + void setA(float a) { (*this)(0) = a; } + void setB(float b) { (*this)(1) = b; } + void setC(float c) { (*this)(2) = c; } + void setD(float d) { (*this)(3) = d; } + const float &getA() const { return (*this)(0); } + const float &getB() const { return (*this)(1); } + const float &getC() const { return (*this)(2); } + const float &getD() const { return (*this)(3); } }; int __EXPORT quaternionTest(); |