Math::Polynomial::Chebyshev2 - Chebyshev polynomials of the second kind
use Math::Polynomial::Chebyshev2; # create a Chebyshev polynomial of the second kind of order 7 my $p = Math::Polynomial::Chebyshev2 -> chebyshev2(7); # get the location of all roots my $x = $p -> roots(); # use higher accuracy use Math::BigFloat; Math::BigFloat -> accuracy(60); my $n = Math::BigFloat -> new(7); $x = Math::Polynomial::Chebyshev2 -> chebyshev2($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 second kind are orthogonal with respect to the weight function sqrt(1-x^2).
The first Chebyshev polynomials of the second kind are
U₀(x) = 1 U₁(x) = 2 x U₂(x) = 4 x^2 - 1 U₃(x) = 8 x^3 - 4 x U₄(x) = 16 x^4 - 12 x^2 + 1 U₅(x) = 32 x^5 - 32 x^3 + 6 x U₆(x) = 64 x^6 - 80 x^4 + 24 x^2 - 1 U₇(x) = 128 x^7 - 192 x^5 + 80 x^3 - 8 x U₈(x) = 256 x^8 - 448 x^6 + 240 x^4 - 40 x^2 + 1 U₉(x) = 512 x^9 - 1024 x^7 + 672 x^5 - 160 x^3 + 10 x
Math::Polynomial::Chebyshev2->chebyshev2($n) creates a new polynomial of order $n, where $n is a non-negative integer.
Math::Polynomial::Chebyshev2->chebyshev2($n)
$n
# create a Chebyshev polynomial of the second kind of order 7 $p = Math::Polynomial::Chebyshev2 -> chebyshev2(7); # do the same, but with Math::BigFloat coefficients use Math::BigFloat; $n = Math::BigFloat -> new(7); $p = Math::Polynomial::Chebyshev2 -> chebyshev2($n); # do the same, but with Math::Complex coefficients use Math::Complex; $n = Math::Complex -> new(7); $p = Math::Polynomial::Chebyshev2 -> chebyshev2($n);
$p->roots returns 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();
Please report any bugs through the web interface at https://rt.cpan.org/Ticket/Create.html?Queue=Math-Polynomial-Chebyshev2 (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::Chebyshev2
You can also look for information at:
GitHub Source Repository
https://github.com/pjacklam/p5-Math-Polynomial-Chebyshev2
RT: CPAN's request tracker
https://rt.cpan.org/Public/Dist/Display.html?Name=Math-Polynomial-Chebyshev2
CPAN Ratings
https://cpanratings.perl.org/dist/Math-Polynomial-Chebyshev2
MetaCPAN
https://metacpan.org/release/Math-Polynomial-Chebyshev2
CPAN Testers Matrix
http://matrix.cpantesters.org/?dist=Math-Polynomial-Chebyshev2
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.