From 491bb7b8663a7e959160e1be19f0848bd866a2f9 Mon Sep 17 00:00:00 2001 From: Korijn van Golen Date: Wed, 25 Dec 2024 14:19:26 +0100 Subject: [PATCH] use python syntax --- pylinalg/matrix.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/pylinalg/matrix.py b/pylinalg/matrix.py index 5c4e637..111969c 100644 --- a/pylinalg/matrix.py +++ b/pylinalg/matrix.py @@ -309,10 +309,7 @@ def mat_compose(translation, rotation, scaling, /, *, out=None, dtype=None): if out is None: out = np.empty((4, 4), dtype=dtype) - x = rotation[0] - y = rotation[1] - z = rotation[2] - w = rotation[3] + x, y, z, w = rotation x2 = x + x y2 = y + y z2 = z + z @@ -326,9 +323,7 @@ def mat_compose(translation, rotation, scaling, /, *, out=None, dtype=None): wy = w * y2 wz = w * z2 - sx = scaling[0] - sy = scaling[1] - sz = scaling[2] + sx, sy, sz = scaling out.flat[0] = (1 - (yy + zz)) * sx out.flat[4] = (xy + wz) * sx