summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Boric <jblbeurope@gmail.com>2021-04-25 21:10:55 +0200
committerLinus Groh <mail@linusgroh.de>2021-04-27 23:06:16 +0200
commit7d84f09e7e1943813242c7d8ee0e60b46697ec60 (patch)
treec9d02f7a4ba35557cd110019b15881040e2d07cd
parent9aa44fa36c1aab95168ec2b982ac394ef13acfa3 (diff)
downloadserenity-7d84f09e7e1943813242c7d8ee0e60b46697ec60.zip
Userland: Move non-standard math constants from math.h
-rw-r--r--AK/ExtraMathConstants.h11
-rw-r--r--Userland/Libraries/LibM/math.cpp1
-rw-r--r--Userland/Libraries/LibM/math.h4
-rw-r--r--Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp1
-rw-r--r--Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp1
5 files changed, 14 insertions, 4 deletions
diff --git a/AK/ExtraMathConstants.h b/AK/ExtraMathConstants.h
new file mode 100644
index 0000000000..907306f45c
--- /dev/null
+++ b/AK/ExtraMathConstants.h
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2021, the SerenityOS developers.
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#pragma once
+
+#define M_TAU 6.28318530717958647692
+#define M_DEG2RAD 0.01745329251994329576
+#define M_RAD2DEG 57.2957795130823208767
diff --git a/Userland/Libraries/LibM/math.cpp b/Userland/Libraries/LibM/math.cpp
index 1dd7ea7674..1ce7cebb53 100644
--- a/Userland/Libraries/LibM/math.cpp
+++ b/Userland/Libraries/LibM/math.cpp
@@ -5,6 +5,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
+#include <AK/ExtraMathConstants.h>
#include <AK/Platform.h>
#include <AK/StdLibExtras.h>
#include <LibC/assert.h>
diff --git a/Userland/Libraries/LibM/math.h b/Userland/Libraries/LibM/math.h
index 4d2f02b539..12e264e34d 100644
--- a/Userland/Libraries/LibM/math.h
+++ b/Userland/Libraries/LibM/math.h
@@ -57,10 +57,6 @@ __BEGIN_DECLS
#define M_SQRT2f32 1.41421356237309504880f
#define M_SQRT1_2f32 0.70710678118654752440f
-#define M_TAU 6.28318530717958647692
-#define M_DEG2RAD 0.01745329251994329576
-#define M_RAD2DEG 57.2957795130823208767
-
#define FP_NAN 0
#define FP_INFINITE 1
#define FP_ZERO 2
diff --git a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp
index d73ab77eb9..ba33075fae 100644
--- a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp
+++ b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp
@@ -4,6 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
+#include <AK/ExtraMathConstants.h>
#include <AK/OwnPtr.h>
#include <LibGfx/Painter.h>
#include <LibWeb/Bindings/CanvasRenderingContext2DWrapper.h>
diff --git a/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp
index 9cd4b1a30a..b758bc867e 100644
--- a/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp
+++ b/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp
@@ -5,6 +5,7 @@
*/
#include <AK/Debug.h>
+#include <AK/ExtraMathConstants.h>
#include <AK/StringBuilder.h>
#include <LibGfx/Painter.h>
#include <LibGfx/Path.h>