From 8708675b1f3aa5a3a1cba9f5c3435664f7a8c1b6 Mon Sep 17 00:00:00 2001 From: "rmackay9@yahoo.com" Date: Sat, 25 Sep 2010 02:43:11 +0000 Subject: [PATCH] added constructor with 9 elements to matrix3.h corrected matrix * vector function. git-svn-id: https://arducopter.googlecode.com/svn/trunk@551 f9c3cf11-9bcb-44bc-f272-b75c42450872 --- libraries/AP_Math/matrix3.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libraries/AP_Math/matrix3.h b/libraries/AP_Math/matrix3.h index 902575bfd1..51fd144c75 100644 --- a/libraries/AP_Math/matrix3.h +++ b/libraries/AP_Math/matrix3.h @@ -47,6 +47,9 @@ public: // setting ctor Matrix3(const Vector3 a0, const Vector3 b0, const Vector3 c0): a(a0), b(b0), c(c0) {} + // setting ctor + Matrix3(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 void operator () (const Vector3 a0, const Vector3 b0, const Vector3 c0) { a = a0; b = b0; c = c0; } @@ -88,9 +91,9 @@ public: // multiplication by a vector Vector3 operator *(const Vector3 &v) const { - return Vector3(a.x * v.x + a.y * v.x + a.z * v.x, - b.x * v.y + b.y * v.y + b.z * v.y, - c.x * v.z + c.y * v.z + c.z * v.z); + return Vector3(a.x * v.x + a.y * v.y + a.z * v.z, + b.x * v.x + b.y * v.y + b.z * v.z, + c.x * v.x + c.y * v.y + c.z * v.z); } // multiplication by another Matrix3