Skip to content
Snippets Groups Projects
Commit 11568c77 authored by Johan Jansen's avatar Johan Jansen
Browse files

VectorMath: Add scalar division to custom EKF vector math

parent 807e02b4
No related branches found
No related tags found
No related merge requests found
......@@ -198,3 +198,13 @@ void swap_var(float &d1, float &d2)
d1 = d2;
d2 = tmp;
}
// overload / operator to provide a vector scalar division
Vector3f operator/(const Vector3f &vec, const float scalar)
{
Vector3f vecOut;
vecOut.x = vec.x / scalar;
vecOut.y = vec.y / scalar;
vecOut.z = vec.z / scalar;
return vecOut;
}
......@@ -89,6 +89,7 @@ Vector3f operator*( Mat3f matIn, Vector3f vecIn);
Mat3f operator*( Mat3f matIn1, Mat3f matIn2);
Vector3f operator%( Vector3f vecIn1, Vector3f vecIn2);
Vector3f operator*(Vector3f vecIn1, float sclIn1);
Vector3f operator/(const Vector3f &vec, const float scalar);
void swap_var(float &d1, float &d2);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment