$ 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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.