diff --git a/README.md b/README.md index a8b4965..842a841 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Irrational{:twoπ} Note: to input the τ character, type `\tau` then press Tab. -The tau variants of `sinpi`, `cospi`, and `mod2pi` are also defined: +The tau variants of `sinpi`, `cospi`, `sincospi`, `cispi`, and `mod2pi` are also defined: ```julia julia> sintau(1//4) @@ -38,11 +38,17 @@ julia> sintau(1//4) 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τ`, and `modτ`. +Alternatively, one can use the Unicode aliases `sinτ`, `cosτ`, `sincosτ`, `cisτ`, and `modτ`. ## The tau != 2pi inequality diff --git a/src/Tau.jl b/src/Tau.jl index af91e98..edc20fc 100644 --- a/src/Tau.jl +++ b/src/Tau.jl @@ -45,9 +45,54 @@ function cisτ(x::Integer) return complex(one(y), zero(y)) end +# Aliases const sintau = sinτ const costau = cosτ const sincostau = sincosτ const cistau = cisτ +# Documentation + +""" + sinτ(x) + sintau(x) + +Compute ``\\sin(\\tau x)`` more accurately than `sin(tau*x)`, especially for large `x`. + +See also: `costau`, `sincostau`. +""" +function sinτ end + +""" + cosτ(x) + costau(x) + +Compute ``\\cos(\\tau x)`` more accurately than `cos(tau*x)`, especially for large `x`. + +See also: `sintau`, `sincostau`. +""" +function cosτ end + +""" + sincosτ(x) + costau(x) + +Simultaneously compute `sintau(x)` and `costau(x)` (the sine and cosine of `tau*x`, +where `x` is in radians), returning a tuple `(sine, cosine)`. + +See also: `sintau`, `costau`. +""" +function sincosτ end + + +""" + cisτ(x) + cistau(x) + +Compute ``\\exp(\\tau i x)`` more accurately than `cis(tau*x)`, especially for large `x`. + +See also: `cis`, `sincostau`. +""" +function cisτ end + end