Segment3.pm - third idea of segmentation
use Segment3; Segment3::setup(area_threshold=>100,length_threshold=>10); @stroke=qw(x0 y0 x1 y1 x2 y2 ...); $vectors=Segment3::segment(\@stroke);
This modules implements a quite robust and effective way of transforming a list of coordinates into a list of vectors.
Call this function to set the area threshold for bisecting a vector, and the length threshold for not bisecting it.
This function creates a list of vectors in the following way:
1.
2.
3.
4.
5.
Returns the length of a vector
Given a list of points $stroke
and two indices in that list $first
and $last
, returns:
the length of the vector between the $first
and the $last
point in $stroke
the sum of distances from said vector of points between $first
and $last
in $stroke
the length of the stroke between the two points
This code is copyright (C) 2002 Gianni Ceccarelli Released under the GNU LGPL, version 2.1