mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-17 02:37:35 +08:00
Vector3f cross product directly return result (#109)
This commit is contained in:
+1
-5
@@ -58,11 +58,7 @@ public:
|
|||||||
|
|
||||||
Vector3 cross(const Matrix31 & b) const {
|
Vector3 cross(const Matrix31 & b) const {
|
||||||
const Vector3 &a(*this);
|
const Vector3 &a(*this);
|
||||||
Vector3 c;
|
return {a(1)*b(2,0) - a(2)*b(1,0), -a(0)*b(2,0) + a(2)*b(0,0), a(0)*b(1,0) - a(1)*b(0,0)};
|
||||||
c(0) = a(1)*b(2,0) - a(2)*b(1,0);
|
|
||||||
c(1) = -a(0)*b(2,0) + a(2)*b(0,0);
|
|
||||||
c(2) = a(0)*b(1,0) - a(1)*b(0,0);
|
|
||||||
return c;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user