From d54e76c13878b03c0d65441e73a17336a547a558 Mon Sep 17 00:00:00 2001 From: Lars Mueller Date: Sat, 22 Jan 2022 16:31:23 +0100 Subject: [PATCH] Add quaternion.compose --- quaternion.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/quaternion.lua b/quaternion.lua index eaa7d4d..930d21e 100644 --- a/quaternion.lua +++ b/quaternion.lua @@ -28,6 +28,10 @@ function multiply(self, other) } end +function compose(self, other) + return multiply(other, self) +end + function normalize(self) local len = math.sqrt(self[1] ^ 2 + self[2] ^ 2 + self[3] ^ 2 + self[4] ^ 2) local res = {}