Math::Polynomial::Chebyshev - Chebyshev polynomials of the first kind
use Math::Polynomial::Chebyshev; # create a Chebyshev polynomial of the first kind of order 7 my $p = Math::Polynomial::Chebyshev -> chebyshev(7); # get the location of all extremas my $x = $p -> extremas(); # get the location of all roots $x = $p -> roots(); # use higher accuracy use Math::BigFloat; Math::BigFloat -> accuracy(60); my $n = Math::BigFloat -> new(7); $x = Math::Polynomial::Chebyshev -> chebyshev($n);
This package extends Math::Polynomial, so each instance polynomial created by this modules is a subclass of Math::Polynomial.
The Chebyshev polynomials of the first kind are orthogonal with respect to the weight function 1/sqrt(1-x^2).
The first Chebyshev polynomials of the first kind are
T₀(x) = 1 T₁(x) = x T₂(x) = 2 x^2 - 1 T₃(x) = 4 x^3 - 3 x T₄(x) = 8 x^4 - 8 x^2 + 1 T₅(x) = 16 x^5 - 20 x^3 + 5 x T₆(x) = 32 x^6 - 48 x^4 + 18 x^2 - 1 T₇(x) = 64 x^7 - 112 x^5 + 56 x^3 - 7 x T₈(x) = 128 x^8 - 256 x^6 + 160 x^4 - 32 x^2 + 1 T₉(x) = 256 x^9 - 576 x^7 + 432 x^5 - 120 x^3 + 9 x
Math::Polynomial::Chebyshev->chebyshev($n) creates a new polynomial of order $n, where $n is a non-negative integer.
Math::Polynomial::Chebyshev->chebyshev($n)
$n
# create a Chebyshev polynomial of the first kind of order 7 $p = Math::Polynomial::Chebyshev -> chebyshev(7); # do the same, but with Math::BigFloat coefficients use Math::BigFloat; $n = Math::BigFloat -> new(7); $p = Math::Polynomial::Chebyshev -> chebyshev($n); # do the same, but with Math::Complex coefficients use Math::Complex; $n = Math::Complex -> new(7); $p = Math::Polynomial::Chebyshev -> chebyshev($n);
$p->roots return the location of all root of $p. All roots are located in the open interval (-1,1).
$p->roots
$p
# get the roots of a polynomial @x = $p -> roots();
$p->extremas returns the location of all extremas of $p located in the closed interval [-1,1]. There are no extremas outside of this interval. Only the extremas in the closed interval (-1,1) are local extremas. All extremas have values +/-1.
$p->extremas
# get the extremas of a polynomial @x = $p -> extremas();
Please report any bugs through the web interface at https://rt.cpan.org/Ticket/Create.html?Queue=Math-Polynomial-Chebyshev (requires login). We will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc Math::Polynomial::Chebyshev
You can also look for information at:
GitHub Source Repository
https://github.com/pjacklam/p5-Math-Polynomial-Chebyshev
RT: CPAN's request tracker
https://rt.cpan.org/Public/Dist/Display.html?Name=Math-Polynomial-Chebyshev
CPAN Ratings
https://cpanratings.perl.org/dist/Math-Polynomial-Chebyshev
MetaCPAN
https://metacpan.org/release/Math-Polynomial-Chebyshev
CPAN Testers Matrix
http://matrix.cpantesters.org/?dist=Math-Polynomial-Chebyshev
The Perl module Math::Polynomial.
The Wikipedia page https://en.wikipedia.org/wiki/Chebyshev_polynomials.
Copyright (c) 2020 Peter John Acklam.
This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.
Peter John Acklam <pjacklam (at) gmail.com>.
To install Math::Polynomial::Chebyshev, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Math::Polynomial::Chebyshev
CPAN shell
perl -MCPAN -e shell install Math::Polynomial::Chebyshev
For more information on module installation, please visit the detailed CPAN module installation guide.