<link rel="self" href="https://bugs.ruby-lang.org/issues/4897.atom"/>
<link rel="alternate" href="https://bugs.ruby-lang.org/"/>
<id>https://bugs.ruby-lang.org/</id>
<icon>https://bugs.ruby-lang.org/favicon.ico</icon>
<updated>2011-06-18T08:26:16Z</updated>
<author>
<name>Ruby Issue Tracking System</name>
</author>
<entry>
<title>Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=180672011-06-18T08:26:16ZSimon Bairdsimon.baird@gmail.com
<ul></ul><p>Sorry for the too long title. Don't know how to edit. Suggested title:</p>
<p>Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi</p>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=180682011-06-18T08:28:53ZSimon Bairdsimon.baird@gmail.com
<ul></ul><p>Direct link to the gist containing my patch:<br>
<a href="https://gist.github.com/1029552">https://gist.github.com/1029552</a></p>
<p>Edit: mention this is a patch (pluid61's patch is better though)</p>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=180692011-06-18T08:33:45ZSimon Bairdsimon.baird@gmail.com
<ul></ul><p>See <a href="http://tauday.com/">http://tauday.com/</a></p>
<p>Edit: particularly <a href="http://tauday.com/tau-manifesto">http://tauday.com/tau-manifesto</a></p>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=251362012-03-25T16:23:59ZYusuke Endohmame@ruby-lang.org
<ul><li><strong>Category</strong> changed from <i>core</i> to <i>Joke</i></li><li><strong>Status</strong> changed from <i>Open</i> to <i>Feedback</i></li></ul> Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=251392012-03-25T16:29:32ZMartin Dürstduerst@it.aoyama.ac.jp
<ul></ul><p>We have discussed this at today's developers' meeting in Akihabara.</p>
<p>We highly doubt that there are many mathematicians, physicists, engineers, and so on, who use τ. Once τ is widely accepted in these communities, we might add it.</p>
<p>Just as a personal comment, I prefer π to τ because I can eat a pie, but not a tau :-)</p>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=251682012-03-25T23:57:28ZThomas Sawyer
<ul></ul><p>I'm trying to get used to the idea of eating a pizza taue, myself. :-)</p>
<p>This is the classic chicken and egg situation -- "We'll do it if it's popular", but "It won't get popular unless people do it".</p>
<p>I think Tau=2*Pi is a good idea. So if it were just up to me, I'd add it just to show support. It's a rather tiny and harmless addition.</p>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=316642012-10-27T06:13:31ZKoichi Sasada
<ul><li><strong>Target version</strong> changed from <i>2.0.0</i> to <i>Next Major</i></li></ul> Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=368992013-02-24T19:17:42ZThomas Sawyer
<ul></ul><p>Could this patch be applied now? As previously said, it's a good thing to show support for and it's a rather tiny and otherwise harmless addition.</p>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=369972013-02-25T22:34:34ZSimon Bairdsimon.baird@gmail.com
<ul></ul><p><a href="https://github.com/search?q=%22TAU+%3D+2+%2A+Math.PI%22&type=Code">https://github.com/search?q=%22TAU+%3D+2+%2A+Math.PI%22&type=Code</a></p>
<p><a href="https://github.com/search?q=%22TAU+%3D+PI+*+2%22&type=Code">https://github.com/search?q=%22TAU+%3D+PI+*+2%22&type=Code</a></p>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=370902013-02-26T18:20:44ZNobuyoshi Nakadanobu@ruby-lang.org
<ul></ul><p>Why is it called as τ, half of π?</p>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=370942013-02-26T19:12:44ZMatthew Kerwinmatthew@kerwin.net.au
<ul></ul><p>nobu (Nobuyoshi Nakada) wrote:</p>
<blockquote>
<p>Why is it called as τ, half of π?</p>
</blockquote>
<p>It's actually two of π. The reason for the name is justified here: <a href="http://tauday.com/tau-manifesto#sec:one_turn">http://tauday.com/tau-manifesto#sec:one_turn</a></p>
<p>In summary: tau is the first letter of the Greek word "tornos" (lathe), which is the root of the English word "turn;" and the tau constant (2*PI) is the ratio of a circle's radius to its circumference (i.e. one <em>turn</em>.) Also "the horizontal line in each letter suggests that we interpret the “legs” as <em>denominators</em>, so that π has two legs in its denominator, while τ has only one. Seen this way, the relationship τ=2π is perfectly natural."</p>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=370952013-02-26T19:23:18ZMatthew Kerwinmatthew@kerwin.net.au
<ul></ul><p>On 26 February 2013 19:20, nobu (Nobuyoshi Nakada) <a href="mailto:nobu@ruby-lang.org">nobu@ruby-lang.org</a>wrote:</p>
<blockquote>
<p>Why is it called as τ, half of π?</p>
</blockquote>
<p>It's actually two of π. The reason for the name is justified here:<br>
<a href="http://tauday.com/tau-manifesto#sec:one_turn">http://tauday.com/tau-manifesto#sec:one_turn</a></p>
<p>In summary: tau is the first letter of the Greek word "tornos" (lathe),<br>
which is the root of the English word "turn;" and the tau constant (2*PI)<br>
is the ratio of a circle's radius to its circumference (i.e. one <em>turn</em>.)<br>
Also "the horizontal line in each letter suggests that we interpret the<br>
"legs" as <em>*denominators</em>*, so that π has two legs in its denominator,<br>
while τ has only one. Seen this way, the relationship τ=2π is perfectly<br>
natural."</p>
<p>EDIT: apologies for the double-posting. I'm not quite sure how I managed it.</p>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=371232013-02-27T09:26:38ZNathan Zookblogger@pierian-spring.net
<ul></ul><p>Please, just say no. This garbage is one and only thing that has made me really glad that I decided to leave academia. Having to dissuade every crank from this idea would ruin my mood for weeks.</p>
<p>There a large number of excellent candidate constants to be included. There is absolutely no cause to include constants that are power-of-two multiples of each other. You want tau in math? Fine. module Math ; TAU = 2 * PI ; end. Done. Put that in all your files. Move it to your initialization code. Publish a gem. I don't care. But don't waste the time of people who understand that shifting a binary point by 1 really isn't a big deal.</p>
<p>-Math::PI</p>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=371312013-02-27T13:41:03ZHarrison Reisermixtabug@gmail.com
<ul></ul><p>Wow, such vitriol ! I could point out a correlation between it and your stance on academia, but I would be flying in the face of not only courtesy but also the whole point of all this. I assure you that tau is not a joke, and has everything to do with mere common sense, both in pedagogy and practice (which, as it were, seems to be what many have come to know Ruby for).</p>
<p>While, as you say, not having the full circle constant is "not a big deal" given a simple means to derive it, I would be shocked to learn that any practiced programmer makes use of pi alone more often than 2*pi. For this very reason many libraries for other languages include both constants, not just for coding efficiency but for <em>runtime</em> efficiency. So far, this constant has almost ubiquitously been named TWO_PI (or some variation thereof) simply by convention, but the fact of its prevalence should be enough indication of its <em>independent usefulness</em> (an important distinction, one which I have no intention of debating further, having already been, repeatedly and at length -- see <a href="https://en.wikipedia.org/wiki/User:Waldir/Tau">https://en.wikipedia.org/wiki/User:Waldir/Tau</a> for examples).</p>
<p>Now, dynamic languages such as Ruby and Python stand in a unique position. As intuitiveness and coder efficiency are among their primary goals, they indeed have no reason to include a constant named TWO_PI, which would overall detract from these goals. However, a constant named TAU would serve as an indication that this number has some distinction of its own, namely the aforementioned independent usefulness. Therefore if it is to be included at all it should be with conviction rather than the attitude of mere quiet tolerance (as of a vocal minority), as it would indeed stand as a statement to the programming community.</p>
<p>The decision to postpone its addition until recognition spreads further is reasonable, but as trans mentioned it perpetuates the chicken and egg problem. Either way, I hope I have raised sufficient objection to categorizing this issue as a "Joke".</p>
<p>-bug</p>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=371322013-02-27T14:08:11ZEric Hodeldrbrain@segment7.net
<ul></ul><p>=begin</p>
<p>Despite all the argument for this constant, nobody has provided a patch, so it seems like a joke.</p>
<p>Runtime performance of a constant lookup is 3% +/- 1.2% faster than multiplying a float by 2 on my machine over 20 million multiplications. 3% for a built-in constant doesn't seem like a big deal.</p>
<p>I don't trust a wikipedia user page as a reference, it doesn't go through the same vetting process as a regular wikipedia page.</p>
<p>Benchmarks:</p>
<p>$ cat bm.rb <br>
require 'benchmark'</p>
<p>module Math<br>
TAU = 2*Math::PI<br>
end</p>
<p>range = Float::EPSILON..10.0</p>
<p>N = Integer ARGV.shift</p>
<p>case ARGV.shift<br>
when 'tau' then<br>
puts Benchmark.measure {<br>
N.times do<br>
2 * Math::PI * rand(range)<br>
end<br>
}.real<br>
when '2pi' then<br>
puts Benchmark.measure {<br>
N.times do<br>
2 * Math::TAU * rand(range)<br>
end<br>
}.real<br>
else<br>
abort "#{$0} N tau|2pi"<br>
end<br>
$ for i in <code>jot 20</code>; do ruby bm.rb 1_000_000 2pi; done > 2pi.txt<br>
$ for i in <code>jot 20</code>; do ruby bm.rb 1_000_000 tau; done > tau.txt<br>
$ ministat tau.txt 2pi.txt <br>
x tau.txt<br>
+ 2pi.txt<br>
+------------------------------------------------------------------------------+<br>
|x xx x + + + + + |<br>
|x x x*xxx+ x * x+ * ++x +++ + ++ + +|<br>
| |_<strong>_M_A</strong><em>|</em>|________<strong><em>MA</em></strong>____________| |<br>
+------------------------------------------------------------------------------+<br>
N Min Max Median Avg Stddev<br>
x 20 0.486589 0.504393 0.491397 0.49242015 0.0049904288<br>
+ 20 0.490699 0.544828 0.506571 0.5073239 0.011828075<br>
Difference at 95.0% confidence<br>
0.0149037 +/- 0.00581011<br>
3.02663% +/- 1.17991%<br>
(Student's t, pooled s = 0.00907766) </p>
<p>=end</p>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=371332013-02-27T14:13:59ZThomas Sawyer
<ul></ul><blockquote>
<p>Despite all the argument for this constant, nobody has provided a patch, so it seems like a joke.</p>
</blockquote>
<p>"Here is a patch on trunk that implements this: <a href="http://simonbaird.blogspot.com/2011/06/tau-in-ruby.html">http://simonbaird.blogspot.com/2011/06/tau-in-ruby.html</a>"</p>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=371342013-02-27T14:25:45ZMatthew Kerwinmatthew@kerwin.net.au
<ul><li><strong>File</strong> <a href="/attachments/download/3552/tau.patch">tau.patch</a><a href="/attachments/3552/tau.patch"><img src="/images/magnifier.png" alt="Magnifier" /></a> added</li></ul><p>drbrain (Eric Hodel) wrote:</p>
<blockquote>
<p>Despite all the argument for this constant, nobody has provided a patch, so it seems like a joke.</p>
</blockquote>
<p>The gist linked in Comment 2 was a diff/patch, althought it's outdated and no longer applies cleanly. I've attached a new patch (generated using <code>git diff</code>). Please let me know if I'm supposed to generate it with --no-prefix</p>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=371352013-02-27T14:52:46ZEric Hodeldrbrain@segment7.net
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>Yukihiro Matsumoto</i></li></ul><p>The patch is fine.</p>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=371372013-02-27T17:23:18ZMartin Dürstduerst@it.aoyama.ac.jp
<ul></ul><p>Hello Eric,</p>
<p>I'm confused by the code below. First, it uses Math::PI with the 'tau' <br>
option, and Math::TAU with the '2pi' option. Second, even when using <br>
Math::TAU, it includes a multiplication by 2.</p>
<p>Regards, Martin.</p>
<p>On 2013/02/27 14:08, drbrain (Eric Hodel) wrote:</p>
<blockquote>
<p>Benchmarks:</p>
<p>$ cat bm.rb<br>
require 'benchmark'</p>
<p>module Math<br>
TAU = 2*Math::PI<br>
end</p>
<p>range = Float::EPSILON..10.0</p>
<p>N = Integer ARGV.shift</p>
<p>case ARGV.shift<br>
when 'tau' then<br>
puts Benchmark.measure {<br>
N.times do<br>
2 * Math::PI * rand(range)<br>
end<br>
}.real<br>
when '2pi' then<br>
puts Benchmark.measure {<br>
N.times do<br>
2 * Math::TAU * rand(range)<br>
end<br>
}.real<br>
else<br>
abort "#{$0} N tau|2pi"<br>
end</p>
</blockquote>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=371542013-02-28T01:13:08ZMarc-Andre Lafortuneruby-core@marc-andre.ca
<ul><li><strong>Category</strong> changed from <i>Joke</i> to <i>core</i></li></ul><p>duerst (Martin Dürst) wrote:</p>
<blockquote>
<p>Hello Eric,</p>
<p>Second, even when using <br>
Math::TAU, it includes a multiplication by 2.</p>
</blockquote>
<p>Right, I'd say the test doesn't say much... Actually, any difference apparently measured has to be meaningless, there's no intrinsic difference in either cases.</p>
<p>For what it's worth:</p>
<pre>require 'fruity'
module Math
TAU = 2 * PI
end
compare do
pi { Math.cos(2 * Math::PI) }
tau { Math.cos(Math::TAU) }
end
# => tau is faster than pi by 50.0% ± 10.0%
</pre>
<p>I had to call Math.cos, because otherwise just accessing Math::TAU is too difficult to time.</p>
<p>Math currently has 2 constants (PI and E)<br>
I don't see a huge downside in increasing this. On the other hand, TAU is so easy to define, I would trust that anyone knowing of it's existence would simply define it.</p>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=371582013-02-28T02:23:19ZDavid MacMahondavidm@astro.berkeley.edu
<ul></ul><p>I vote -1 on this idea because the name "TAU" is used in a number of fields to represent a wide variety of things:</p>
<p><a href="http://en.wikipedia.org/wiki/Greek_letters_used_in_mathematics,_science,_and_engineering#.CE.A4.CF.84_.28tau.29">http://en.wikipedia.org/wiki/Greek_letters_used_in_mathematics,_science,_and_engineering#.CE.A4.CF.84_.28tau.29</a></p>
<p>For example, tau as also used as a constant representing the golden ratio (1.618...).</p>
<p>The names "PI" and "E" are used far more consistently across fields. Giving special preference to one (proposed!) use of the name "TAU" seems unfair to the other (established!) uses.</p>
<p>How about making a "twopi" gem that defines Math::TAU and BigMath.TAU? If it is as useful as its proponents claim, it will undoubtedly become a very popular gem and the public outcry to add it to the core of the language will be deafening.</p>
<p>Dave</p>
<p>On Feb 26, 2013, at 9:54 PM, drbrain (Eric Hodel) wrote:</p>
<blockquote>
<p>Issue <a class="issue tracker-2 status-2 priority-4 priority-default" title="Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/ (Assigned)" href="https://bugs.ruby-lang.org/issues/4897">#4897</a> has been updated by drbrain (Eric Hodel).</p>
<p>Status changed from Feedback to Assigned<br>
Assignee set to matz (Yukihiro Matsumoto)</p>
<a name="The-patch-is-fine"></a>
<h2 >The patch is fine.<a href="#The-patch-is-fine" class="wiki-anchor">¶</a></h2>
<p>Feature <a class="issue tracker-2 status-2 priority-4 priority-default" title="Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/ (Assigned)" href="https://bugs.ruby-lang.org/issues/4897">#4897</a>: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See <a href="http://tauday.com/">http://tauday.com/</a><br>
<a href="https://bugs.ruby-lang.org/issues/4897#change-37135">https://bugs.ruby-lang.org/issues/4897#change-37135</a></p>
<p>Author: sbaird (Simon Baird)<br>
Status: Assigned<br>
Priority: Low<br>
Assignee: matz (Yukihiro Matsumoto)<br>
Category: Joke<br>
Target version: Next Major</p>
<p>Firstly please read the Tau Manifesto at <a href="http://tauday.com/">http://tauday.com/</a> . It's quite long but essential to understanding why this is a good idea.</p>
<p>Here is a patch on trunk that implements this:<br>
<a href="http://simonbaird.blogspot.com/2011/06/tau-in-ruby.html">http://simonbaird.blogspot.com/2011/06/tau-in-ruby.html</a></p>
<p>Allow me to anticipate and respond in advance to some common objections:</p>
<ol>
<li><p>It's easy to define it yourself so why put this in core.<br>
Possibly correct, but I think this is the right thing to do. Tau is important. And it's a pretty small patch.</p></li>
<li><p>If this constant goes in then pretty soon someone will want every other math constant and there are hundreds of them. (Slippery slope argument).<br>
The circle constant is one of the two most important numbers is mathematics. It's not just another math constant. We already define Pi.</p></li>
</ol>
<p>-- <br>
<a href="http://bugs.ruby-lang.org/">http://bugs.ruby-lang.org/</a></p>
</blockquote>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=371672013-02-28T07:10:43ZMatthew Kerwinmatthew@kerwin.net.au
<ul><li><strong>File</strong> <a href="/attachments/download/3558/tau.patch">tau.patch</a><a href="/attachments/3558/tau.patch"><img src="/images/magnifier.png" alt="Magnifier" /></a> added</li></ul><p>I just noticed a stupid typo in the patch I submitted. Sorry.</p>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=371682013-02-28T07:10:54ZJoseph Lindenbergjosephlindenberg@yahoo.com
<ul></ul><p>The Processing programming language recently added TAU:<br>
<a href="http://code.google.com/p/processing/source/browse/trunk/processing/core/src/processing/core/PConstants.java">http://code.google.com/p/processing/source/browse/trunk/processing/core/src/processing/core/PConstants.java</a></p>
<p>It does seem to be showing up more and more frequently. Here's a recent SAMS book where the author uses it in his examples:<br>
<a href="http://books.google.com/books?id=BFda3Z71Y5YC&printsec=frontcover">http://books.google.com/books?id=BFda3Z71Y5YC&printsec=frontcover</a></p>
<p>I'm in favor of adding TAU. It's definitely not the same as having a bunch of multiples and submultiples of a constant. In fact, you really could say that right now, we have the submultiple-of-a-constant HALF_TAU, just under a different name.</p>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=371692013-02-28T07:38:55ZJoseph Lindenbergjosephlindenberg@yahoo.com
<ul></ul><p>david_macmahon (David MacMahon) wrote:</p>
<blockquote>
<p>For example, tau is also used as a constant representing the golden ratio (1.618...).</p>
</blockquote>
<p>No, not anymore. φ (phi) is used for that now.</p>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=371982013-03-01T05:50:16ZEric Hodeldrbrain@segment7.net
<ul></ul><p>=begin<br>
Martin, you are right. With a corrected benchmark there is an 8.5% +/- 1.2% improvement:</p>
<p>x tau.txt<br>
+ 2pi.txt<br>
+--------------------------------------------------------------------------+<br>
|xx x x + + + + |<br>
|xx x xxxx x x x + + + + + +++ + + + ++ + + +|<br>
| |___<strong><em>A</em></strong><strong>| |</strong>___<strong><em>MA</em></strong>______| |<br>
+--------------------------------------------------------------------------+<br>
N Min Max Median Avg Stddev<br>
x 20 0.526745 0.557717 0.535967 0.5353094 0.0073255609<br>
+ 20 0.562776 0.60921 0.579785 0.5810366 0.011508619<br>
Difference at 95.0% confidence<br>
0.0457272 +/- 0.00617423<br>
8.5422% +/- 1.15339%<br>
(Student's t, pooled s = 0.00964656)</p>
<p>=end</p>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=371992013-03-01T06:15:02ZAlexey Muranov
<ul></ul><p>+1</p>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=372002013-03-01T06:34:57ZMarc-Andre Lafortuneruby-core@marc-andre.ca
<ul></ul><p>drbrain (Eric Hodel) wrote:</p>
<blockquote>
<p>Martin, you are right. With a corrected benchmark there is an 8.5% +/- 1.2% improvement:</p>
</blockquote>
<p>To be more accurate, you'd have to subtract the time of an empty loop. If you compare 42 * pi with 42 *pi; 42 * pi using your technique, you won't get the expected answer (100%). I get ~50% with your technique.</p>
<p>I should introduce some of the techniques in ministat in my fruity gem.</p>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=372072013-03-01T09:37:27ZSimon Bairdsimon.baird@gmail.com
<ul></ul><p>david_macmahon (David MacMahon) wrote:</p>
<blockquote>
<p>I vote -1 on this idea because the name "TAU" is used in a number of fields to represent a wide variety of things:<br>
For example, tau as also used as a constant representing the golden ratio (1.618...).</p>
</blockquote>
<p>mhartl addresses this here:<br>
<a href="http://tauday.com/tau-manifesto#sec:ambiguous_notation">http://tauday.com/tau-manifesto#sec:ambiguous_notation</a></p>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=372082013-03-01T09:46:20ZSimon Bairdsimon.baird@gmail.com
<ul></ul><p>I don't think the benchmarks are particularly relevant here. We should define Tau because it's important, not for any performance benefit.</p>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=372202013-03-01T20:05:59ZBenoit Daloze
<ul></ul><p>sbaird (Simon Baird) wrote:</p>
<blockquote>
<p>I don't think the benchmarks are particularly relevant here. We should define Tau because it's important, not for any performance benefit.</p>
</blockquote>
<p>Indeed.</p>
<p>Although I am not sure of the importance of having TAU. One PI is fine for unit conversions as well as computing the area of a circle. But there are also many cases of 2*PI, which sounds less-than-ideal.</p>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=385322013-04-14T02:57:38ZHarrison Reisermixtabug@gmail.com
<ul></ul><p>Eregon (Benoit Daloze) wrote:</p>
<blockquote>
<p>Although I am not sure of the importance of having TAU. One PI is fine for unit conversions as well as computing the area of a circle. But there are also many cases of 2*PI, which sounds less-than-ideal.</p>
</blockquote>
<p>They are more common than you would think. Finding the area of circles is actually relatively specialized, in comparison with, for example, circular sectors (1/2 * angle * r<sup>2),</sup> for which the circle formula is a special case: 1/2 * tau * r<sup>2</sup> = pi * r<sup>2.</sup> The use of pi is an aesthetic optimization, not representative of any underlying geometric relationship. (However, the use of pi in runtime optimization is still applicable for such special cases.)</p>
<p>This mere coincidence becomes even more obvious when looking at the derivation of the above formulae, and as with everything discussed heretofore, is already discussed in the Tau Manifesto. Incidentally, I recommend anyone still wavering to read it for the benefit of making more informed opinions.</p>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=474322014-06-28T08:49:29ZSimon Bairdsimon.baird@gmail.com
<ul></ul><p>Since today is 6/28, here's a pull request on trunk:</p>
<ul>
<li><a href="https://github.com/ruby/ruby/pull/644">https://github.com/ruby/ruby/pull/644</a></li>
</ul>
<p>See also:</p>
<ul>
<li><a href="http://tauday.com/state-of-the-tau">http://tauday.com/state-of-the-tau</a></li>
</ul>
<p>Best wishes and Happy Tau Day... :)</p>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=532392015-07-02T07:36:58ZSimon Bairdsimon.baird@gmail.com
<ul></ul><p>I'm a bit late, but here it is rebased for Tau Day 2015:</p>
<ul>
<li><a href="https://github.com/ruby/ruby/pull/644">https://github.com/ruby/ruby/pull/644</a></li>
</ul>
Ruby trunk - Feature #4897: Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/https://bugs.ruby-lang.org/issues/4897?journal_id=534772015-07-20T23:05:18ZKenta Muratamuraken@gmail.com
<ul></ul><p>As I wrote in <a href="https://github.com/ruby/ruby/pull/644#issuecomment-123082639">https://github.com/ruby/ruby/pull/644#issuecomment-123082639</a>, I closed the pull-request for the present time.</p>