#!/usr/bin/perl
use warnings;
use strict;
#3_3.pl
#loop over drop radius from 1 micron to 100 microns in steps of 2 micr
+ons
#use each radius to compute cross section
#if radius <20 microns, use (pi)*(r^2)*a*(1-exp(-c*r))
#if radius >= 20 microns, use 2*pi*(r^2)
my @radii = grep $_ & 1, 1 .. 100;
my $pi = atan2 0, -1;
my $twopi = 2 * $pi;
my $a0 = 1.18;
my $c0 = 0.28e6;
my ( @rads, @sigs );
foreach my $r ( @radii )
{
push @rads, 1e-6 * $r;
# push @sigs, $r > 20 ? $twopi * $rad ** 2 : $pi * $rad ** 2 * $a0 *
+ ( 1 - exp -$c0 * $rad );
# **Update: Oops, changed $rad to $rads[-1]
push @sigs, $r > 20 ? $twopi * $rads[-1] ** 2 : $pi * $rads[-1] **
+ 2 * $a0 * ( 1 - exp -$c0 * $rads[-1] );
}
print "@rads\n";
print "@sigs\n";