Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Dinges <blender@dingto.org>2013-05-12 18:13:29 +0400
committerThomas Dinges <blender@dingto.org>2013-05-12 18:13:29 +0400
commit7636aeffe1674ea2281869a0d81cbe20ee42e8b9 (patch)
tree61ab2f2c9bd74ff35d074e4f27a0885b6ac98a32 /intern/cycles/util/util_math.h
parent469979f9cb08640fbc00a43b59eee459460e74e1 (diff)
Cycles / Math:
* Add M_2PI_F and M_4PI_F constants and use them inside the codebase.
Diffstat (limited to 'intern/cycles/util/util_math.h')
-rw-r--r--intern/cycles/util/util_math.h24
1 files changed, 18 insertions, 6 deletions
diff --git a/intern/cycles/util/util_math.h b/intern/cycles/util/util_math.h
index f2e814527fd..6b85e06c25d 100644
--- a/intern/cycles/util/util_math.h
+++ b/intern/cycles/util/util_math.h
@@ -42,23 +42,35 @@ CCL_NAMESPACE_BEGIN
/* Float Pi variations */
+/* Division */
#ifndef M_PI_F
-#define M_PI_F ((float)3.14159265358979323846264338327950288)
+#define M_PI_F ((float)3.14159265358979323846264338327950288) /* pi */
#endif
#ifndef M_PI_2_F
-#define M_PI_2_F ((float)1.57079632679489661923132169163975144)
+#define M_PI_2_F ((float)1.57079632679489661923132169163975144) /* pi/2 */
#endif
#ifndef M_PI_4_F
-#define M_PI_4_F ((float)0.785398163397448309615660845819875721)
+#define M_PI_4_F ((float)0.785398163397448309615660845819875721) /* pi/4 */
#endif
#ifndef M_1_PI_F
-#define M_1_PI_F ((float)0.318309886183790671537767526745028724)
+#define M_1_PI_F ((float)0.318309886183790671537767526745028724) /* 1/pi */
#endif
#ifndef M_2_PI_F
-#define M_2_PI_F ((float)0.636619772367581343075535053490057448)
+#define M_2_PI_F ((float)0.636619772367581343075535053490057448) /* 2/pi */
#endif
+
+/* Multiplication */
+#ifndef M_2PI_F
+#define M_2PI_F ((float)6.283185307179586476925286766559005768) /* 2*pi */
+#endif
+#ifndef M_4PI_F
+#define M_4PI_F ((float)12.56637061435917295385057353311801153) /* 4*pi */
+#endif
+
+/* Float sqrt variations */
+
#ifndef M_SQRT2_F
-#define M_SQRT2_F ((float)1.41421356237309504880)
+#define M_SQRT2_F ((float)1.41421356237309504880) /* sqrt(2) */
#endif