aboutsummaryrefslogtreecommitdiff
path: root/apps/systemlib/math/Vector3.cpp
diff options
context:
space:
mode:
authorjgoppert <james.goppert@gmail.com>2013-01-06 15:33:55 -0500
committerjgoppert <james.goppert@gmail.com>2013-01-06 15:33:55 -0500
commitd9491b20cc5fc8b683eb0f60a50da6b322b55e57 (patch)
tree48d44accf2ccff88766bca351c78be06bb9fa4a0 /apps/systemlib/math/Vector3.cpp
parent4f3b17f53b120cd54112097f4217a90863013c1f (diff)
downloadpx4-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/Vector3.cpp')
-rw-r--r--apps/systemlib/math/Vector3.cpp50
1 files changed, 25 insertions, 25 deletions
diff --git a/apps/systemlib/math/Vector3.cpp b/apps/systemlib/math/Vector3.cpp
index a30b6d198..edba663cb 100644
--- a/apps/systemlib/math/Vector3.cpp
+++ b/apps/systemlib/math/Vector3.cpp
@@ -45,28 +45,28 @@ namespace math
{
Vector3::Vector3() :
- Vector(3)
+ Vector(3)
{
}
-Vector3::Vector3(const Vector & right) :
- Vector(right)
+Vector3::Vector3(const Vector &right) :
+ Vector(right)
{
#ifdef VECTOR_ASSERT
- ASSERT(right.getRows()==3);
+ ASSERT(right.getRows() == 3);
#endif
}
Vector3::Vector3(float x, float y, float z) :
- Vector(3)
+ Vector(3)
{
- setX(x);
- setY(y);
- setZ(z);
+ setX(x);
+ setY(y);
+ setZ(z);
}
-Vector3::Vector3(const float * data) :
- Vector(3,data)
+Vector3::Vector3(const float *data) :
+ Vector(3, data)
{
}
@@ -74,26 +74,26 @@ Vector3::~Vector3()
{
}
-Vector3 Vector3::cross(const Vector3 & b)
+Vector3 Vector3::cross(const Vector3 &b)
{
- Vector3 & a = *this;
- Vector3 result;
- result(0) = a(1)*b(2) - a(2)*b(1);
- result(1) = a(2)*b(0) - a(0)*b(2);
- result(2) = a(0)*b(1) - a(1)*b(0);
- return result;
+ Vector3 &a = *this;
+ Vector3 result;
+ result(0) = a(1) * b(2) - a(2) * b(1);
+ result(1) = a(2) * b(0) - a(0) * b(2);
+ result(2) = a(0) * b(1) - a(1) * b(0);
+ return result;
}
int __EXPORT vector3Test()
{
- printf("Test Vector3\t\t: ");
- // test float ctor
- Vector3 v(1,2,3);
- ASSERT(equal(v(0),1));
- ASSERT(equal(v(1),2));
- ASSERT(equal(v(2),3));
- printf("PASS\n");
- return 0;
+ printf("Test Vector3\t\t: ");
+ // test float ctor
+ Vector3 v(1, 2, 3);
+ ASSERT(equal(v(0), 1));
+ ASSERT(equal(v(1), 2));
+ ASSERT(equal(v(2), 3));
+ printf("PASS\n");
+ return 0;
}
} // namespace math