NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

## All the Perl that's Practical to Extract and Report

#### chaoticset (2105)

chaoticset
(email not shown publicly)
http://chaoticset.perlmonk.org/
AOL IM: chaoticset23 (Add Buddy, Send Message)
Yahoo! ID: illuminatus_foil (Add User, Send Message)

JAPH. (That's right -- I'm not Really Inexperienced any more.)

I'm not just here, I'm here [perlmonks.org], and here [javajunkies.org] too, I ramble randomly in my philosophical blog [blogspot.com] and my other blog [blogspot.com]. Soon I'll come in a convenient six-pack.

### Journal of chaoticset (2105)

Wednesday May 28, 2003
09:11 PM

### Bounded-Sum 0, Grid Math 0, Trigonometry 0, Nature 0, Me 4

[ #12486 ]
Okay -- bounded-sum GROKKED. El Groko. I Understand. It's worth my Life and my Soul, blah blah blah, I get it.

So, the major conceptual hurdle is down.

Next, I need to calculate the intersection of two lines. Easy enough, but I can't remember how to do it except for trial-and-error, and don't want to code such a monstrosity. I figure that there's an easy algebraic solution I probably never learned, or else someone else has coded such a monstrosity, and one way or another I'm right: CPAN has Math::Project, which is exactly what I need. It's part of a larger package, but that's not a big deal -- and if it becomes one in the future, I'll figure some way around it. (Thanks, Milan!)

After that, I'll need to calculate the area of four different triangles, two with complete information and two others with angles and one side. CPAN has trigonometry so that's not a problem. (Thanks, Jarkko and Raphael!)

Finally, I just need to write the bounded sum operation. It should be straightforward and monotonous, so I should probably work out all the math ahead of time, write it in comments, and then work the Perl from the comments. This method's worked in the past when I have my data structures well in hand and I get the math right; if I get the math wrong, it produces shitty code, and if I get the structures wrong, I end up breaking stuff that already works half the time.

Final sentence all this has been working up to: It's clearly time to carry a pad of paper and a pen with me for a few days, work this crap all out, and see if it works in a few pertinent test cases. (Instead of writing it tonight (wrong), rewriting it for a few hours tomorrow morning, and then trying to figure out what the hell I was doing the day after that.)

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.

Full
Abbreviated
Hidden