Add Sort test.
[Math-GSL.git] / examples / sf / bessel
blobaea46aa0b4e1cd317435ab87613b61708f9a7ce1
1 #!/usr/bin/perl -w
2 # Run this script in the same directory as plot_bessel.gnuplot
3 # i.e cd examples/sf ; ./bessel
4 use strict;
5 use warnings;
6 use Math::GSL::SF qw/:bessel/;
8 my $x = [ map { $_/ 100 } ( 0 .. 2000 ) ];
10 open my $fh, ">", 'bessel.data' or die $!;
12 my $negx = [map { -$_ } reverse @$x ];
13 for my $t (@$negx, @$x ) {
14 print $fh join (" ", $t, map { gsl_sf_bessel_Jn( $_, $t) } (0..5)) . "\n";
16 close $fh;
18 qx "gnuplot -persist plot_bessel.gnuplot";