# Julia could have a Tau constant

**URL:** <https://discourse.julialang.org/t/julia-could-have-a-tau-constant/68181>\
**Category:** General Usage\
**Created:** [September 14, 2021, 11:57pm UTC](https://discourse.julialang.org/t/julia-could-have-a-tau-constant/68181 "2021-09-14T23:57:54Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lucas\_Queiroz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lucas_queiroz/32/12086_2.png) [@Lucas\_Queiroz](https://discourse.julialang.org/u/Lucas_Queiroz)\
**Post date:** [September 14, 2021, 11:57pm UTC](https://discourse.julialang.org/t/julia-could-have-a-tau-constant/68181/1 "2021-09-14T23:57:55Z")

</div>

[Python is already into the movement](https://www.w3schools.com/python/ref_math_tau.asp). Let’s get into the tau revolution? `const taunumber = 6.283`

> **[Let's Use Tau--It's Easier Than Pi](https://www.scientificamerican.com/article/let-s-use-tau-it-s-easier-than-pi/)**
>
> A growing movement argues that killing pi would make mathematics simpler, easier and even more beautiful

> **[On "Pi is Wrong" and the Tau Movement - Rhea](https://www.projectrhea.org/rhea/index.php/On_%22Pi_is_Wrong%22_and_the_Tau_Movement)**
>
> Project Rhea: learning by teaching! A Purdue University online education project.

> **[No, really, pi is wrong: The Tau Manifesto](https://tauday.com/tau-manifesto)**
>
> For millennia, the circle has been considered the most perfect of shapes, and the circle constant π captured the geometry of the circle in a single number. But π is wrong, and it’s time to set things right.

[![](https://global.discourse-cdn.com/julialang/original/3X/6/e/6e7f4efd2f435d17b7d0173e46057aac4eddf086.jpeg "Pi Is (still) Wrong.") ](https://www.youtube.com/watch?v=jG7vhMMXagQ)

---

<div class="post-metadata">

**Author:** ![Wen-Wei\_Tseng](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wen-wei_tseng/32/28839_2.png) [@Wen-Wei\_Tseng](https://discourse.julialang.org/u/Wen-Wei_Tseng)\
**Post date:** [September 15, 2021, 12:11am UTC](https://discourse.julialang.org/t/julia-could-have-a-tau-constant/68181/2 "2021-09-15T00:11:22Z")

</div>

Yes, there is a package for tau: [https://github.com/JuliaMath/Tau.jl](https://github.com/JuliaMath/Tau.jl)

---

<div class="post-metadata">

**Author:** ![Lucas\_Queiroz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lucas_queiroz/32/12086_2.png) [@Lucas\_Queiroz](https://discourse.julialang.org/u/Lucas_Queiroz)\
**Post date:** [September 15, 2021, 12:21am UTC](https://discourse.julialang.org/t/julia-could-have-a-tau-constant/68181/3 "2021-09-15T00:21:52Z")

</div>

Indeed.

[But in Base we have](https://github.com/JuliaLang/julia/blob/master/base/mathconstants.jl):

1. pi
2. Euler’s number
3. the Euler-Mascheroni constant
4. the golden ratio
5. Catalan’s constant

why don’t we get tau there as well?

---

<div class="post-metadata">

**Author:** ![Lucas\_Queiroz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lucas_queiroz/32/12086_2.png) [@Lucas\_Queiroz](https://discourse.julialang.org/u/Lucas_Queiroz)\
**Post date:** [September 15, 2021, 1:09am UTC](https://discourse.julialang.org/t/julia-could-have-a-tau-constant/68181/4 "2021-09-15T01:09:32Z")

</div>

It only requires to add one line of code to [**mathconstants.jl**](https://github.com/JuliaLang/julia/blob/master/base/mathconstants.jl).

`Base.@irrational tau 6.28318530717958647693 tau`

I would make a pull request if I knew how to use GitHub.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [September 15, 2021, 2:05am UTC](https://discourse.julialang.org/t/julia-could-have-a-tau-constant/68181/5 "2021-09-15T02:05:32Z")

</div>

> [@Lucas\_Queiroz](#):
>
> I would make a pull request if I knew how to use GitHub.

There already was one, in 2013: [WIP –&nbsp;tau: add MathConst{:τ} by StefanKarpinski · Pull Request #4864 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/pull/4864)

---

<div class="post-metadata">

**Author:** ![Lucas\_Queiroz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lucas_queiroz/32/12086_2.png) [@Lucas\_Queiroz](https://discourse.julialang.org/u/Lucas_Queiroz)\
**Post date:** [September 15, 2021, 2:07am UTC](https://discourse.julialang.org/t/julia-could-have-a-tau-constant/68181/6 "2021-09-15T02:07:34Z")

</div>

I am very happy to know that I was not the first one to make this request 🙂

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [September 15, 2021, 3:00am UTC](https://discourse.julialang.org/t/julia-could-have-a-tau-constant/68181/7 "2021-09-15T03:00:21Z")

</div>

Sorry, ignorance I suppose: but isn’t that just 2\*pi?

---

<div class="post-metadata">

**Author:** ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Post date:** [September 15, 2021, 3:14am UTC](https://discourse.julialang.org/t/julia-could-have-a-tau-constant/68181/8 "2021-09-15T03:14:22Z")

</div>

> [@PetrKryslUCSD](#):
>
> isn’t that just 2\*pi?

no, pi = tau/2

---

<div class="post-metadata">

**Author:** ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Post date:** [September 15, 2021, 3:23am UTC](https://discourse.julialang.org/t/julia-could-have-a-tau-constant/68181/9 "2021-09-15T03:23:37Z")

</div>

Humor aside, the point of tau is that the fact that you have to write `2*pi` in so many formulas shows somehow that `tau = 2*pi` is the more fundamental number. Also, from geometry, the circumference of a circle is `tau * radius`, and the radius is “more fundamental” because the circle is the set of points that are a given radius from the center.

Although I’m inclined to agree, I’m probably the least fanatical tau fan.

---

<div class="post-metadata">

**Author:** ![Lucas\_Queiroz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lucas_queiroz/32/12086_2.png) [@Lucas\_Queiroz](https://discourse.julialang.org/u/Lucas_Queiroz)\
**Post date:** [September 15, 2021, 3:28am UTC](https://discourse.julialang.org/t/julia-could-have-a-tau-constant/68181/10 "2021-09-15T03:28:49Z")

</div>

yes, _tau_ is defined by _tau = 2pi_

as dlakelan has just said, the point of _tau_ is that in many important formulas in mathematics and physics, _pi_ comes multiplied by 2.

 ![IMG_20210915_002415123_HDR_2](https://global.discourse-cdn.com/julialang/original/3X/b/3/b3b2452e6ac2f1abc23ad4a96a5c19e416747329.jpeg)

There are many other formulas in math that illustrate this same point.

---

<div class="post-metadata">

**Author:** ![amrods](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amrods/32/2543_2.png) [@amrods](https://discourse.julialang.org/u/amrods)\
**Post date:** [September 15, 2021, 6:31am UTC](https://discourse.julialang.org/t/julia-could-have-a-tau-constant/68181/11 "2021-09-15T06:31:28Z")

</div>

Is there a unicode character for “pi with three legs”?

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [September 15, 2021, 6:56am UTC](https://discourse.julialang.org/t/julia-could-have-a-tau-constant/68181/12 "2021-09-15T06:56:50Z")

</div>

As everybody can see, it must be:

```julia
π = 2τ

```

with

```julia
π = 6.283185307179586

```

and

```julia
τ = 3.1415926535897

```

Everything else would be too confusing.

---

<div class="post-metadata">

**Author:** ![sijo](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sijo](https://discourse.julialang.org/u/sijo)\
**Post date:** [September 15, 2021, 6:57am UTC](https://discourse.julialang.org/t/julia-could-have-a-tau-constant/68181/13 "2021-09-15T06:57:28Z")

</div>

I especially like that \tau makes radians very natural. Students often struggle with radians. My guess is, if we used \tau instead of \pi, students would find radians _more_ natural than degrees. “A quarter of a circle? well that’s \tau/4 of course!”

---

<div class="post-metadata">

**Author:** ![nandoconde](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nandoconde/32/19497_2.png) [@nandoconde](https://discourse.julialang.org/u/nandoconde)\
**Post date:** [September 15, 2021, 12:29pm UTC](https://discourse.julialang.org/t/julia-could-have-a-tau-constant/68181/14 "2021-09-15T12:29:54Z")

</div>

However, it breaks the easy relationship between radius and arclength:

L = \theta~\cdot~r

---

<div class="post-metadata">

**Author:** ![genkuroki](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/genkuroki/32/18030_2.png) [@genkuroki](https://discourse.julialang.org/u/genkuroki)\
**Post date:** [September 15, 2021, 12:52pm UTC](https://discourse.julialang.org/t/julia-could-have-a-tau-constant/68181/15 "2021-09-15T12:52:59Z")

</div>

It would be a breaking change, but I would like `2π` to be of `Irrational` type where the destination type changes depending on the context, rather than of `Float64` type.

If that were the case, people who want `τ` could just do `τ = 2π` on their own.

---

<div class="post-metadata">

**Author:** ![tbeason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbeason/32/15898_2.png) [@tbeason](https://discourse.julialang.org/u/tbeason)\
**Post date:** [September 15, 2021, 1:04pm UTC](https://discourse.julialang.org/t/julia-could-have-a-tau-constant/68181/16 "2021-09-15T13:04:52Z")

</div>

> [@genkuroki](#):
>
> I would like `2π` to be of `Irrational` type

I believe that is what Tau.jl does

---

<div class="post-metadata">

**Author:** ![sijo](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sijo](https://discourse.julialang.org/u/sijo)\
**Post date:** [September 15, 2021, 1:26pm UTC](https://discourse.julialang.org/t/julia-could-have-a-tau-constant/68181/17 "2021-09-15T13:26:53Z")

</div>

> [@nandoconde](#):
>
> However, it breaks the easy relationship between radius and arclength:

No, a quarter of a circle is still the same number: \pi/2 = \tau/4 \approx 1.57.

It’s just silly that the standard constant (\pi) is a half-circle radians, instead of a full circle.

---

<div class="post-metadata">

**Author:** ![genkuroki](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/genkuroki/32/18030_2.png) [@genkuroki](https://discourse.julialang.org/u/genkuroki)\
**Post date:** [September 15, 2021, 1:34pm UTC](https://discourse.julialang.org/t/julia-could-have-a-tau-constant/68181/18 "2021-09-15T13:34:00Z")

</div>

Just a few minutes ago, I made an amazing mathematical discovery! We have the following:

```julia
julia> 411557987 / 65501488 == 2π
true

```

It seems that 2π is a simple rational number! So it should be enough to define `τ` as follows:

```julia
julia> const τ = 411557987 // 65501488

```

Just kidding. How to make it:

```julia
julia> r = setprecision(56) do; rationalize(2big(π)) end
411557987 // 65501488

```

---

<div class="post-metadata">

**Author:** ![mschauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mschauer/32/13946_2.png) [@mschauer](https://discourse.julialang.org/u/mschauer)\
**Post date:** [September 15, 2021, 1:51pm UTC](https://discourse.julialang.org/t/julia-could-have-a-tau-constant/68181/19 "2021-09-15T13:51:48Z")

</div>

Clearly, the legs of `τ` and `π` are _under_ the fraction bar in the denominator. So one leg less makes a factor of 2 larger.

---

<div class="post-metadata">

**Author:** ![nandoconde](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nandoconde/32/19497_2.png) [@nandoconde](https://discourse.julialang.org/u/nandoconde)\
**Post date:** [September 15, 2021, 2:36pm UTC](https://discourse.julialang.org/t/julia-could-have-a-tau-constant/68181/20 "2021-09-15T14:36:54Z")

</div>

omg, I didn’t even stop to think about it 😂 you’re totally right

[Next page](https://discourse.julialang.org/t/julia-could-have-a-tau-constant/68181.md?page=2)
