#!/usr/bin/perl
#
# create datafiles of the form
#
#   x    cos(x)
#
# over a set of ranges, to show a wave propagating forward 
#
# MWR 5/14/2007

$twopi = (3.14159*2.0);

# create simple cosine wave, no offset, unit amplitude
$start_x = -10;
$end_x = 0;
$dx = 0.01;

$amp = 1.0;

$num_snapshots = 12;

 for ($snapshot = 0; $snapshot <= $num_snapshots; $snapshot++) {

  $this_end_x = $end_x + $snapshot*($twopi/10);

  $outfile = sprintf "cosine_progress_%02d.dat", $snapshot;
  open(OUTFILE, ">$outfile") || die("can't open file $outfile");

  for ($x = $start_x; $x <= $this_end_x; $x += $dx) {

    for ($multiple = 0; $multiple <= $max_multiple; $multiple++) {

       # first, add without any offset
       $xx = $x;
       $y = cos($xx);

    }

    printf OUTFILE " %9.4f  %9.4f  \n", $x, $y;

  }

  close(OUTFILE);

 }


exit 0;
