Math-Geometry-Planar-Offset
view release on metacpan or search on metacpan
lib/Math/Geometry/Planar/Offset.pm view on Meta::CPAN
}
else {
$x_int = ($Bb - $Ab) / ($Am - $Bm);$y_int = $Am *$x_int + $Ab;
}
# Now, if the lines are not parallel, and the intersection
# happens on the line segments, we are here with
# the x and y coordinates of the intersection of the two lines.
## $debug and printf ("intersection: %6.0f,%6.0f\n",$x_int, $y_int);
# Let's find the time of intersect.
# distance formula with adjustment for speed
$time = sqrt( ($x_int - $points->[$n][0])**2 + ($y_int - $points->[$n][1])**2 ) / $bis_scale[$n];
if( (abs($time) < $first_time) )
# && ( $time / abs($time)== $offset / abs($offset) ) )
{
# note that none of the times loaded here have a sign
$first_time = abs($time);
$join_time = $first_time;
$first_join=$n;
$first_event="join";
}
( run in 0.232 second using v1.01-cache-2.11-cpan-26ccb49234f )