$ perl sill2.pl elt 0 0 is 0.4375 elt 0 1 is 4.3125 elt 0 2 is bath-left elt 1 0 is 0.375 elt 1 1 is 4.375 elt 1 2 is bath-middle elt 2 0 is 0.375 elt 2 1 is 4.4375 elt 2 2 is bath-right bath-left has slope 5.82263230478133 bath-middle has slope 4.91710033552881 bath-right has slope 4.84767847916148 $ cat sill2.pl #!/usr/bin/perl -w use strict; use 5.010; use Math::Trig; BEGIN { push @INC, ".."; } use utils1; my @AoA; my $aoa_ref = \@AoA; my $vector_ref = [0.4375, 4.3125, "bath-left"]; push @AoA, $vector_ref; $vector_ref = [0.375, 4.375, "bath-middle"]; push @AoA, $vector_ref; $vector_ref = [0.375,4.4375, "bath-right"]; push @AoA, $vector_ref; print_aoa($aoa_ref); for my $i ( 0 .. $#AoA ) { my $ratio = $AoA[$i][0]/$AoA[$i][1]; my $rad = asin($ratio); my $degrees = rad2deg($rad); my $name = $AoA[$i][2]; say "$name has slope $degrees"; } __END__ $
This might be the most robust version of this material.
In reply to Re^6: enumerating values for slopes
by Aldebaran
in thread enumerating values for slopes
by Aldebaran
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |