2 # Run this script in the same directory as plot_bessel.gnuplot
3 # i.e cd examples/sf ; ./bessel
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";
18 qx "gnuplot -persist plot_bessel.gnuplot";