Tau constant to math lib

1 view
Skip to first unread message

Hans Häggström

unread,
Jun 30, 2010, 3:34:46 AM6/30/10
to sgin...@googlegroups.com
Hi,

Just ran across http://tauday.com/

Basically, it convincingly argues that the natural way to measure a
circle is using a constant where 1 * the constant is a full turn -
which means the constant should be 2*Pi, called Tau (1 Tau = the
circumference of a circle divided by its radius).

I agree with this - very often in games and 3D math, what you want is
to represent a heading or direction, and the natural way to do it is
as a number from 0 to 1 - to get an angle it can then just be
multiplied by Tau (=2Pi).

So, could we add Tau as a constant in the math library, defined as
val Tau = 2 * Pi ?
A small addition that helps simplify a lot of angle related code.

Cheers,

-- Hans (zzorn)

Hicks, Matt

unread,
Jun 30, 2010, 9:53:42 AM6/30/10
to sgin...@googlegroups.com
I'm okay with that, but that would likely be best added to simplex...agree lex?

2010/6/30 Hans Häggström <hans.ha...@iki.fi>

Lex

unread,
Jun 30, 2010, 9:51:33 PM6/30/10
to sgine-dev
2*Pi gets computed by the compiler and inlined as a number. So
performance-wise there is no difference.
The big issue, of course, is that nobody has heared of Tau. You can
represent a direction as 0 to 1 and multiply it by 2*Pi and resulting
code will make a lot more sense. Seeing Tau will confuse anyone not
familiar with it, which means literally anyone.


On Jun 30, 9:53 am, "Hicks, Matt" <mhi...@captiveimagination.com>
wrote:
> I'm okay with that, but that would likely be best added to simplex...agree
> lex?
>
> 2010/6/30 Hans Häggström <hans.haggst...@iki.fi>
>
> > Hi,
>
> > Just ran acrosshttp://tauday.com/

Hans Häggström

unread,
Jul 1, 2010, 2:35:27 AM7/1/10
to sgin...@googlegroups.com
Well, good ideas need to start somewhere. As you can see, the Tau
manifesto was launched this year, so of course it's new, but it
already gained lot of attention in social media. It's a very small
addition which will help push a good idea and help the users write
more elegant code.

For me it already simplified some code, and that was just simple
conversion between radians and degrees (which became rad = degrees *
Tau/360).

-- Hans

Reply all
Reply to author
Forward
0 new messages