From cd21e0322510bdd95c5d53075f80c49efcb2f24d Mon Sep 17 00:00:00 2001 From: Hendiadyoin1 Date: Thu, 3 Feb 2022 12:48:17 +0100 Subject: AK+Everywhere: Add sincos and use it in some places Calculating sin and cos at once is quite a bit cheaper than calculating them individually. x87 has even a dedicated instruction for it: `fsincos`. --- Userland/Libraries/LibGfx/Matrix4x4.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Userland/Libraries/LibGfx/Matrix4x4.h') diff --git a/Userland/Libraries/LibGfx/Matrix4x4.h b/Userland/Libraries/LibGfx/Matrix4x4.h index 4637f4e816..4e0c6dda8c 100644 --- a/Userland/Libraries/LibGfx/Matrix4x4.h +++ b/Userland/Libraries/LibGfx/Matrix4x4.h @@ -70,8 +70,8 @@ constexpr static Matrix4x4 scale_matrix(const Vector3& s) template constexpr static Matrix4x4 rotation_matrix(const Vector3& axis, T angle) { - T c = AK::cos(angle); - T s = AK::sin(angle); + T c, s; + AK::sincos(angle, s, c); T t = 1 - c; T x = axis.x(); T y = axis.y(); -- cgit v1.2.3