Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP – tau: add MathConst{:τ} #4864

Closed
wants to merge 1 commit into from
Closed

WIP – tau: add MathConst{:τ} #4864

wants to merge 1 commit into from

Conversation

StefanKarpinski
Copy link
Sponsor Member

There's an issue with code evaluation order here. Maybe I need a toplevel block or something like that. Anyway, thought I'd throw this out there for comment before spending any more time on it. Do we want τ and tau?

@simonbyrne
Copy link
Contributor

One problem with adding these constants is that they can increase the risk of unexpected behaviour when redefined. I feel that most people expect pi to be 3.14159..., but I often use e and tau as variable names, which increases the risk of shooting myself in the foot. Granted this hasn't caused a problem yet, but it's worth thinking about.

@jiahao
Copy link
Member

jiahao commented Nov 20, 2013

I’m sorry, but WAT. Are there people seriously using τ out there instead of 2pi??

@ihnorton
Copy link
Member

@jiahao
Copy link
Member

jiahao commented Nov 20, 2013

Far be it from me to be a pi-imperialist (pimperialist?), but I'm really not convinced of the utility of adding tau to Base. This should receive at least as much due consideration as adding a new function to Base; I've seen PRs closed for functions that are more useful than this.

Unless someone can demonstrate that this is actually gaining traction in scientific computing, people who want this should just define it themselves.

@johnmyleswhite
Copy link
Member

I agree with Jiahao.

@StefanKarpinski
Copy link
Sponsor Member Author

Well, that's why it's a pull request and why I didn't spend much time on it :-)

@jiahao
Copy link
Member

jiahao commented Nov 20, 2013

/me wonders if it’s April 1 in the Nordic calendar...

@ViralBShah
Copy link
Member

I have to agree with @jiahao too.

@StefanKarpinski
Copy link
Sponsor Member Author

I used to be skeptical of the tau thing, but it really does make so much more sense than pi.

@jiahao
Copy link
Member

jiahao commented Nov 20, 2013

I used to be skeptical of Imperial units, but it really still does not make more sense than metric.

@johnmyleswhite
Copy link
Member

I'd love to hear your reasoning sometime, Stefan. I still react to tau as "hipster nonsense".

@StefanKarpinski
Copy link
Sponsor Member Author

Basically, making the unit number of radians a full circle just makes life easier almost everywhere you look. A half circle is just awkward. For example if you know modpi(x) you know where it falls on a half circle. Great. But which half? If you know mod2pi(x) then you know where it falls on the circle, which is a completely natural thing to want to know. When you write 2π you're essentially saying "two half circles". If we went around saying that in English, we'd sound like jackasses. When you write τ/2 you're saying "half a circle" – which is exactly what it looks like.

@toivoh
Copy link
Contributor

toivoh commented Nov 20, 2013

+1 for tau. I've never used it, but it's starting to feel quite compelling.

@JeffBezanson
Copy link
Sponsor Member

I do agree that tau is generally better than pi, but I'm not sure it warrants inclusion in Base. τ is a pretty popular variable name.

@jiahao
Copy link
Member

jiahao commented Nov 20, 2013

This is the most common argument presented in favor of tau. However, that argument works only in an odd number of dimensions. That pernicious factor of 2 alternates between appearing and disappearing between relations involving circles (spheres, hyperspheres) in odd- and even-dimensions. You can see this most clearly in the formulae for the area and volume for these N-spheres. For any given dimension, the factor of 2 will show up in exactly one formula for either the area or the volume, but not both. Of course, you can hide this with the special functions of your choice, but it doesn’t change the fundamental mathematical reason for the factor of 2 showing up.

@jiahao
Copy link
Member

jiahao commented Nov 20, 2013

Mathematical bikeshedding aside, there was a suggestion made in #4862 to introduce twoπ as a constant in Base. That would be much less controversial and in line with current common practice.

@jiahao
Copy link
Member

jiahao commented Nov 20, 2013

It’s also amazing how much virtual ink has been spilled on this: tauday vs pimanifesto

@StefanKarpinski
Copy link
Sponsor Member Author

So you want to have a MathConst called "twoπ" but you're not interested in τ? Um, what?

@arsatiki
Copy link

Hello!

Apologies for messing in this old ticket, but it's dear to my heart. In honor of tomorrow's tau day, I was going to do pretty much this same pull request. I've found tau to be so useful I'm using it exclusively while doing anything trigonometry related. Sadly, redefinition dance is becoming bothersome.

I see that the biggest objection in the previous discussion is conflicting names. Here's a proposal for avoiding that:

  • use palaistau as the non-unicode name, analogous to eulergamma
  • use (MATHEMATICAL ITALIC SMALL TAU, U+1D70F) as the unicode name

(Addition: the Github comment processing corrupts the italic tau. Sorry about that.)

@pao
Copy link
Member

pao commented Jun 27, 2014

use (MATHEMATICAL ITALIC SMALL TAU, U+1D70F) as the unicode name

This won't help, since it normalizes to GREEK SMALL LETTER TAU (U+03C4):

julia> normalize_string("(that letter github won't print correctly)", :NFKC)
"\u3c4"

@kmsquire
Copy link
Member

Hi Antti,

I suggest making a package, which includes the definition of tau and some
example functions of how it's used.

This should satisfy the skeptics (they can ignore the package), and still
let tau be part of Julia (which I support), without conflicting with
anything.

(A general non-Base math constants package would be better, perhaps, but I
don't know what other constants are missing/useful.)

Cheers, Kevin

On Friday, June 27, 2014, Antti Rasinen notifications@github.com wrote:

Hello!

Apologies for messing in this old ticket, but it's dear to my heart. In
honor of tomorrow's tau day, I was going to do pretty much this same pull
request. I've found tau to be so useful I'm using it exclusively while
doing anything trigonometry related. Sadly, redefinition dance is becoming
bothersome.

I see that the biggest objection in the previous discussion is conflicting
names. Here's a proposal for avoiding that:

  • use palaistau as the non-unicode name, analogous to eulergamma
  • use 𝜏 (MATHEMATICAL ITALIC SMALL TAU, U+1D70F) as the unicode name


Reply to this email directly or view it on GitHub
#4864 (comment).

@jiahao
Copy link
Member

jiahao commented Jun 28, 2014

I'm still unconvinced.

@tkelman
Copy link
Contributor

tkelman commented Jun 28, 2014

I use tau often enough as a time constant that this would bug the crap outta me.

@StefanKarpinski
Copy link
Sponsor Member Author

I think the way to go here is to create a Tau.jl package that defines and exports τ as a MathConst. Then people who want to use τ can just do using Tau and have τ available.

@mgkuhn
Copy link
Contributor

mgkuhn commented Jul 1, 2014

Using MATHEMATICAL ITALIC SMALL TAU (U+1D70F) would be very wrong, because in mathematical notation, italic letters denote variables (see e.g. ISO 80000-1), whereas standard constants should be written in an upright font. And the proposed τ is clearly a constant!

For the same reason, the constants and constant functions π, e, sin, log, etc. are written in upright font. (I know, this practice has sadly eroded somewhat for π and e thanks to TeX, which initially lacked an upright Greek font for π, and generally made typesetting non-italic symbol names rather cumbersome in its math mode.)

Generally, I find the idea of tau far more appealing than 2π, but in mathematics, new notational conventions take about 300 years to catch on. If only Euler had thought of this earlier ...

@waldyrious
Copy link
Contributor

Tau.jl is now available since the merge of JuliaLang/METADATA.jl#1048 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet