in reply to line segment intersection
I found the necessary module on CPAN. It's called Imager::Graph::Util. Here's an example script:
#!/usr/bin/perl -w use strict; use Imager::Graph::Util; my ($ax, $ay, $bx, $by, $cx, $cy, $dx, $dy) = GetLines(); # you have t +o write that subroutine my @line1 = line_from_points($ax, $ay, $bx, $by); my @line2 = line_from_points($cx, $cy, $dx, $dy); # @p will contain the (x, y) point of intersection if it exists my @p = intersect_lines(@line1, @line2);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: line segment intersection
by tall_man (Parson) on Apr 30, 2003 at 17:27 UTC |