Skip to content

Commit acc9bac

Browse files
authored
Add documentation (#47)
* Add documentation * Fix docstrings
1 parent d00aa03 commit acc9bac

File tree

2 files changed

+53
-2
lines changed

2 files changed

+53
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Irrational{:twoπ}
2929

3030
Note: to input the τ character, type `\tau` then press <kbd>Tab</kbd>.
3131

32-
The tau variants of `sinpi`, `cospi`, and `mod2pi` are also defined:
32+
The tau variants of `sinpi`, `cospi`, `sincospi`, `cispi`, and `mod2pi` are also defined:
3333

3434
```julia
3535
julia> sintau(1//4)
@@ -38,11 +38,17 @@ julia> sintau(1//4)
3838
julia> costau(1//2)
3939
-1.0
4040

41+
julia> sincostau(1//2)
42+
(0.0, -1.0)
43+
44+
julia> cistau(1//2)
45+
-1.0 + 0.0im
46+
4147
julia> modtau(9*pi/4)
4248
0.7853981633974481
4349
```
4450

45-
Alternatively, one can use the Unicode aliases `sinτ`, `cosτ`, and `modτ`.
51+
Alternatively, one can use the Unicode aliases `sinτ`, `cosτ`, `sincosτ`, `cisτ`, and `modτ`.
4652

4753
## The tau != 2pi inequality
4854

src/Tau.jl

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,54 @@ function cisτ(x::Integer)
4545
return complex(one(y), zero(y))
4646
end
4747

48+
# Aliases
4849
const sintau = sinτ
4950
const costau = cosτ
5051
const sincostau = sincosτ
5152
const cistau = cisτ
5253

54+
# Documentation
55+
56+
"""
57+
sinτ(x)
58+
sintau(x)
59+
60+
Compute ``\\sin(\\tau x)`` more accurately than `sin(tau*x)`, especially for large `x`.
61+
62+
See also: `costau`, `sincostau`.
63+
"""
64+
function sinτ end
65+
66+
"""
67+
cosτ(x)
68+
costau(x)
69+
70+
Compute ``\\cos(\\tau x)`` more accurately than `cos(tau*x)`, especially for large `x`.
71+
72+
See also: `sintau`, `sincostau`.
73+
"""
74+
function cosτ end
75+
76+
"""
77+
sincosτ(x)
78+
costau(x)
79+
80+
Simultaneously compute `sintau(x)` and `costau(x)` (the sine and cosine of `tau*x`,
81+
where `x` is in radians), returning a tuple `(sine, cosine)`.
82+
83+
See also: `sintau`, `costau`.
84+
"""
85+
function sincosτ end
86+
87+
88+
"""
89+
cisτ(x)
90+
cistau(x)
91+
92+
Compute ``\\exp(\\tau i x)`` more accurately than `cis(tau*x)`, especially for large `x`.
93+
94+
See also: `cis`, `sincostau`.
95+
"""
96+
function cisτ end
97+
5398
end

0 commit comments

Comments
 (0)