Tau And Pi

Please include Tau in the upcoming numerics module along with Pi.

Recap: Tau relates the radius of a circle to its circumference (used in math) whereas Pi relates the diameter to its circumference (used in engineering - you can only measure diameters)

Yes, Tau is simply 2 x Pi however degrees are simply 57.296 x radians and calculators use both.

Perhaps I’m passionate about this issue because my code is littered with PiOverTwo and I keep making the mistake of thinking this represents a half rotation.

Please, one Tau for one revolution, and TauOverFour for a quarter revolution.

1 Like

I moved this into the Numerics section so that the right people are more likely to see it. Much conversation about that module also takes place in its Git Issues.

This was brought up on the Numerics project as Issue #89, where @scanon responded with a link to this article rebutting the argument.

I'm definitely just dense but I don't understand how including π and τ is harmful. Wouldn't the ability to use the 'appropriate' one without having to define either be a win, even if a tiny one?

1 Like

Adding redundant spellings for a single concept is something we’ve generally tried to avoid. I don’t really think that tau is especially harmful, but neither does it make code significantly easier to write (and maybe makes it a little harder to read).

4 Likes

Thank you Nevin for linking that article, however the author is incorrect in so many places.

Rooting the authors personal bias towards π (and I used to be one of them) by saying the maximum angle between two vectors as calculated by the dot product is 180 degrees so let’s stop at 180 degrees
and make that our fundamental value of rotation is just wrong.

The author also suggests that the cosine curve, defined from -π to π implies π as the most natural value for expressing rotations. This is incorrect

1 full rotation = 1 Tau = 1 period = 1 wavelength

Consider the wavelength example.

Waves have a period of one wavelength, not 2 wavelength halves, and so if we take the cosine curve example above it would be more intuitive if the notation embodied the idea that half the “wavelength”
of the cosine curve lies on the negative side and half the “wavelength” lies on the positive side, adding together to make one “wavelength” (period) of the curve.

One period being from 0 to τ, or from -τ/2 to τ/2 (but not - a whole π to + a whole π)

In engineering callipers measure the diameter of cylinders, and so Pi will get you to the circumference in one step, however CNC lathes don’t do this...they measure the distance of the cylinder edge from its central axis of rotation (ie measuring its radius)
so even in CNC machining, radius is now more fundamental than diameter.

I’m not suggesting we get rid of Pi, but yes, Tau is more fundamental, and if I could go back 20 years to my younger self and give him one tip it would be to use Tau.

My code is complicated enough and too often I discover a bug to be rooted in my monkey brain having put PiOverFour for 90 degrees or PiOverTwo for 180.

2 Likes

No one is stopping you from defining var tau: Self { 2 * .pi } in your own code.

You can even set up a linter rule to prohibit .pi in your codebase if you feel strongly about it.

4 Likes

Unity games engine, python, and a couple of other languages have adopted Tau, not without reason.

FWIW whenever I end up working with Radians, I do just this. I even prefer it over degrees, which for me was more clear than Pi-based Radians.

As general support for Tau...Anecdotally, trig made much more sense to me with Tau compared to using Pi. I was mainly convinced to change due to Numberphile and Vihart's videos. I'm out of the loop as far as what's done in education now but would personally hope tau is something that gains more adoption as an easier way to learn basic trig.

IME, Programming helped greatly when learning several Math concepts, so having Tao available would only help me and others like me. I can't imagine any negatives to adding it. Especially since it is a sound mathematical concept.

3 Likes