Skip to content

armgit / flix

Public Imported from GitHub
0

Making an ESP32-based quadcopter from scratch

Quaternion::fromBetweenVectors: pass u and v as const references (#21)

KiraFluxd06eb2a1aa5b
diff --git a/flix/quaternion.h b/flix/quaternion.h
index 29a3d04..81eb79f 100644
--- a/flix/quaternion.h
+++ b/flix/quaternion.h
@@ -45,7 +45,7 @@ public:
cx * cy * sz - sx * sy * cz);
}
- static Quaternion fromBetweenVectors(Vector u, Vector v) {
+ static Quaternion fromBetweenVectors(const Vector& u, const Vector& v) {
float dot = u.x * v.x + u.y * v.y + u.z * v.z;
float w1 = u.y * v.z - u.z * v.y;
float w2 = u.z * v.x - u.x * v.z;