uncrustify libraries/AP_Math/matrix3.h

This commit is contained in:
uncrustify 2012-08-16 23:20:14 -07:00 committed by Pat Hickey
parent d1c42279fd
commit 97ee36e1e4

View File

@ -43,51 +43,78 @@ public:
// trivial ctor // trivial ctor
// note that the Vector3 ctor will zero the vector elements // note that the Vector3 ctor will zero the vector elements
Matrix3<T>() {} Matrix3<T>() {
}
// setting ctor // setting ctor
Matrix3<T>(const Vector3<T> a0, const Vector3<T> b0, const Vector3<T> c0): a(a0), b(b0), c(c0) {} Matrix3<T>(const Vector3<T> a0, const Vector3<T> b0, const Vector3<T> c0) : a(a0), b(b0), c(c0) {
}
// setting ctor // setting ctor
Matrix3<T>(const T ax, const T ay, const T az, const T bx, const T by, const T bz, const T cx, const T cy, const T cz): a(ax,ay,az), b(bx,by,bz), c(cx,cy,cz) {} Matrix3<T>(const T ax, const T ay, const T az, const T bx, const T by, const T bz, const T cx, const T cy, const T cz) : a(ax,ay,az), b(bx,by,bz), c(cx,cy,cz) {
}
// function call operator // function call operator
void operator () (const Vector3<T> a0, const Vector3<T> b0, const Vector3<T> c0) void operator () (const Vector3<T> a0, const Vector3<T> b0, const Vector3<T> c0)
{ a = a0; b = b0; c = c0; } {
a = a0; b = b0; c = c0;
}
// test for equality // test for equality
bool operator == (const Matrix3<T> &m) bool operator == (const Matrix3<T> &m)
{ return (a==m.a && b==m.b && c==m.c); } {
return (a==m.a && b==m.b && c==m.c);
}
// test for inequality // test for inequality
bool operator != (const Matrix3<T> &m) bool operator != (const Matrix3<T> &m)
{ return (a!=m.a || b!=m.b || c!=m.c); } {
return (a!=m.a || b!=m.b || c!=m.c);
}
// negation // negation
Matrix3<T> operator - (void) const Matrix3<T> operator - (void) const
{ return Matrix3<T>(-a,-b,-c); } {
return Matrix3<T>(-a,-b,-c);
}
// addition // addition
Matrix3<T> operator + (const Matrix3<T> &m) const Matrix3<T> operator + (const Matrix3<T> &m) const
{ return Matrix3<T>(a+m.a, b+m.b, c+m.c); } {
return Matrix3<T>(a+m.a, b+m.b, c+m.c);
}
Matrix3<T> &operator += (const Matrix3<T> &m) Matrix3<T> &operator += (const Matrix3<T> &m)
{ return *this = *this + m; } {
return *this = *this + m;
}
// subtraction // subtraction
Matrix3<T> operator - (const Matrix3<T> &m) const Matrix3<T> operator - (const Matrix3<T> &m) const
{ return Matrix3<T>(a-m.a, b-m.b, c-m.c); } {
return Matrix3<T>(a-m.a, b-m.b, c-m.c);
}
Matrix3<T> &operator -= (const Matrix3<T> &m) Matrix3<T> &operator -= (const Matrix3<T> &m)
{ return *this = *this - m; } {
return *this = *this - m;
}
// uniform scaling // uniform scaling
Matrix3<T> operator * (const T num) const Matrix3<T> operator * (const T num) const
{ return Matrix3<T>(a*num, b*num, c*num); } {
return Matrix3<T>(a*num, b*num, c*num);
}
Matrix3<T> &operator *= (const T num) Matrix3<T> &operator *= (const T num)
{ return *this = *this * num; } {
return *this = *this * num;
}
Matrix3<T> operator / (const T num) const Matrix3<T> operator / (const T num) const
{ return Matrix3<T>(a/num, b/num, c/num); } {
return Matrix3<T>(a/num, b/num, c/num);
}
Matrix3<T> &operator /= (const T num) Matrix3<T> &operator /= (const T num)
{ return *this = *this / num; } {
return *this = *this / num;
}
// multiplication by a vector // multiplication by a vector
Vector3<T> operator *(const Vector3<T> &v) const; Vector3<T> operator *(const Vector3<T> &v) const;
@ -97,27 +124,37 @@ public:
// extract x column // extract x column
Vector3<T> colx(void) const Vector3<T> colx(void) const
{ return Vector3f(a.x, b.x, c.x); } {
return Vector3f(a.x, b.x, c.x);
}
// extract y column // extract y column
Vector3<T> coly(void) const Vector3<T> coly(void) const
{ return Vector3f(a.y, b.y, c.y); } {
return Vector3f(a.y, b.y, c.y);
}
// extract z column // extract z column
Vector3<T> colz(void) const Vector3<T> colz(void) const
{ return Vector3f(a.z, b.z, c.z); } {
return Vector3f(a.z, b.z, c.z);
}
// multiplication by another Matrix3<T> // multiplication by another Matrix3<T>
Matrix3<T> operator *(const Matrix3<T> &m) const; Matrix3<T> operator *(const Matrix3<T> &m) const;
Matrix3<T> &operator *=(const Matrix3<T> &m) Matrix3<T> &operator *=(const Matrix3<T> &m)
{ return *this = *this * m; } {
return *this = *this * m;
}
// transpose the matrix // transpose the matrix
Matrix3<T> transposed(void) const; Matrix3<T> transposed(void) const;
Matrix3<T> transpose(void) Matrix3<T> transpose(void)
{ return *this = transposed(); } {
return *this = transposed();
}
// zero the matrix // zero the matrix
void zero(void); void zero(void);
@ -132,7 +169,9 @@ public:
// check if any elements are NAN // check if any elements are NAN
bool is_nan(void) bool is_nan(void)
{ return a.is_nan() || b.is_nan() || c.is_nan(); } {
return a.is_nan() || b.is_nan() || c.is_nan();
}
// fill in the matrix with a standard rotation // fill in the matrix with a standard rotation
void rotation(enum Rotation rotation); void rotation(enum Rotation rotation);