Skip to content

JuliaMath/Tau.jl

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Tau.jl



CI codecov

This Julia package defines the Tau constant and related functions.

tau ≈ 2*pi

Usage

After installing this package with Pkg.add("Tau"), it can be used as follows:

julia> using Tau

julia> tau === τ  2*pi
true

julia> typeof(tau)
Irrational{:twoπ}

Note: to input the τ character, type \tau then press Tab.

The tau variants of sinpi, cospi, sincospi, cispi, and mod2pi are also defined:

julia> sintau(1//4)
1.0

julia> costau(1//2)
-1.0

julia> sincostau(1//2)
(0.0, -1.0)

julia> cistau(1//2)
-1.0 + 0.0im

julia> modtau(9*pi/4)
0.7853981633974481

Alternatively, one can use the Unicode aliases sinτ, cosτ, sincosτ, cisτ, and modτ.

The tau != 2pi inequality

When this package was first created, the equality tau == 2pi did hold true, in accordance to the mathematical definition of the constant. However, that is not valid anymore -- the two values are only approximately equal: tau ≈ 2*pi.

For a detailed explanation of the reasons for this, see this document.