Math-Polygon

 view release on metacpan or  search on metacpan

lib/Math/Polygon/Transform.pod  view on Meta::CPAN

=encoding utf8

=head1 NAME

Math::Polygon::Transform - Polygon transformation

=head1 INHERITANCE

 Math::Polygon::Transform
   is an Exporter

=head1 SYNOPSIS

  my @poly = ( [1,2], [2,4], [5,7], [1, 2] );

  my $area = polygon_transform resize => 3.14, @poly;

  # requires [2.00]
  my $area = polygon_transform +{resize => 3.14}, @poly;

=head1 DESCRIPTION

This package contains polygon transformation algorithms.

=head1 FUNCTIONS

=over 4

=item B<polygon_grid>(%options|\%options, @points)

Snap the polygon points to grid points, where artifacts are removed.

 -Option--Default
  raster  1.0

=over 2

=item raster => FLOAT

The raster size, which determines the points to round to.  The origin
C<[0,0]> is always on a grid-point.  When the raster value is zero,
no transformation will take place.

=back

=item B<polygon_mirror>(%options|\%options, @points)

Mirror the polygon in a line.  Only one of the options can be provided.
Some programs call this "flip" or "flop".

 -Option--Default
  b       0
  line    <C<undef>>
  rc      undef
  x       undef
  y       undef

=over 2

=item b => FLOAT

Only used in combination with option C<rc> to describe a line.

=item line => [POINT, POINT]

Alternative way to specify the mirror line.  The C<rc> and C<b> are
computed from the two points of the line.

=item rc => FLOAT



( run in 0.798 second using v1.01-cache-2.11-cpan-39bf76dae61 )