You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/polynomials/ChebyshevT.jl
+15-1Lines changed: 15 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -17,15 +17,24 @@ terms of the given variable `var`, which can be a character, symbol, or string.
17
17
```jldoctest ChebyshevT
18
18
julia> using Polynomials
19
19
20
-
julia> ChebyshevT([1, 0, 3, 4])
20
+
julia> p = ChebyshevT([1, 0, 3, 4])
21
21
ChebyshevT(1⋅T_0(x) + 3⋅T_2(x) + 4⋅T_3(x))
22
22
23
23
julia> ChebyshevT([1, 2, 3, 0], :s)
24
24
ChebyshevT(1⋅T_0(s) + 2⋅T_1(s) + 3⋅T_2(s))
25
25
26
26
julia> one(ChebyshevT)
27
27
ChebyshevT(1.0⋅T_0(x))
28
+
29
+
julia> p(0.5)
30
+
-4.5
31
+
32
+
julia> Polynomials.evalpoly(5.0, p, false) # bypasses the domain check done in p(5.0)
33
+
2088.0
28
34
```
35
+
36
+
The latter shows how to evaluate a `ChebyshevT` polynomial outside of its domain, which is `[-1,1]`. (For newer versions of `Julia`, `evalpoly` is an exported function from Base with methods extended in this package, so the module qualification is unnecessary.
0 commit comments