sub make_bounce_path { 
    my ($ground, $bounce_height, $bounces) = @_;
    my $pi = atan2(1,1) * 4;  
    my $points = "M0,$height ";
    my $y;
   
    for (my $x=1; $x < $width; $x+=5) {
        $y = int($ground - abs(($bounce_height * 
               sin(($x/($width*2/$bounces)) * 2 * $pi))));
        $points .= "L$x,$y ";    
        $ground -= 40/($width/5);
        $height -= 40/($width/5);
    }
    return $points;
}
