Skip to content

armgit / flix

Public Imported from GitHub
0

Making an ESP32-based quadcopter from scratch

Implement lacking vector division operator

Oleg Kalachev997af183f0e8
diff --git a/flix/vector.h b/flix/vector.h
index 577d46c..5b2df3f 100644
--- a/flix/vector.h
+++ b/flix/vector.h
@@ -37,6 +37,11 @@ public:
return Vector(x * b, y * b, z * b);
}
+ Vector operator / (const float b) const
+ {
+ return Vector(x / b, y / b, z / b);
+ }
+
Vector operator + (const Vector& b) const
{
return Vector(x + b.x, y + b.y, z + b.z);