From 3cffa8efe619da2b4ea0e54a424898af41cf43d4 Mon Sep 17 00:00:00 2001 From: benfry Date: Tue, 22 Jan 2013 02:55:43 +0000 Subject: [PATCH] add TAU as alias for TWO_PI (issue #1488) --- android/core/src/processing/core/PConstants.java | 1 + core/src/processing/core/PConstants.java | 10 ++++++---- core/todo.txt | 3 +++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/android/core/src/processing/core/PConstants.java b/android/core/src/processing/core/PConstants.java index fe09d4c16..5d0acc5cb 100644 --- a/android/core/src/processing/core/PConstants.java +++ b/android/core/src/processing/core/PConstants.java @@ -101,6 +101,7 @@ public interface PConstants { static final float THIRD_PI = PI / 3.0f; static final float QUARTER_PI = PI / 4.0f; static final float TWO_PI = PI * 2.0f; + static final float TAU = PI * 2.0f; static final float DEG_TO_RAD = PI/180.0f; static final float RAD_TO_DEG = 180.0f/PI; diff --git a/core/src/processing/core/PConstants.java b/core/src/processing/core/PConstants.java index d12c3d2fd..021a79455 100644 --- a/core/src/processing/core/PConstants.java +++ b/core/src/processing/core/PConstants.java @@ -128,8 +128,8 @@ public interface PConstants { * @see PConstants#TWO_PI * @see PConstants#QUARTER_PI */ - static final float HALF_PI = PI / 2.0f; - static final float THIRD_PI = PI / 3.0f; + static final float HALF_PI = (float) (Math.PI / 2.0); + static final float THIRD_PI = (float) (Math.PI / 3.0); /** * ( begin auto-generated from QUARTER_PI.xml ) * @@ -144,7 +144,7 @@ public interface PConstants { * @see PConstants#TWO_PI * @see PConstants#HALF_PI */ - static final float QUARTER_PI = PI / 4.0f; + static final float QUARTER_PI = (float) (Math.PI / 4.0); /** * ( begin auto-generated from TWO_PI.xml ) * @@ -159,7 +159,9 @@ public interface PConstants { * @see PConstants#HALF_PI * @see PConstants#QUARTER_PI */ - static final float TWO_PI = PI * 2.0f; + static final float TWO_PI = (float) (2.0 * Math.PI); + + static final float TAU = (float) (2.0 * Math.PI); static final float DEG_TO_RAD = PI/180.0f; static final float RAD_TO_DEG = 180.0f/PI; diff --git a/core/todo.txt b/core/todo.txt index 2ccb4d2ee..0572c9428 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -36,6 +36,9 @@ X also problematic with it not being called now X loadBytes does not close input stream X http://code.google.com/p/processing/issues/detail?id=1542 X add randomGaussian() +X Add TAU as alias for TWO_PI +X http://code.google.com/p/processing/issues/detail?id=1488 +_ waiting on reference from Casey andres A P3D sketches failing to run