The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Math::Geometry::IntersectionArea - Calculate area of geometric shapes intersection

SYNOPSIS

  use Math::Geometry::IntersectionArea qw(intersection_area_circle_rectangle);

  my $area = intersection_area_circle_rectangle([1,4], 2, [0, 1], [5, 5]);

DESCRIPTION

This module provides functions to calculate the area of the intersection of several combinations of geometric shapes.

Geometric coordinates are defined with bidimensional vectors from the class Math::Vector::Real. Alternatively, for convenience, all the subroutines accept also raw array references (e.g. [1,3]).

Well, currently only intersections between circles and polygons are supported. If you need to calculate the intersection between other combinations of geometric shapes these are your options:

1) Convince me to extend the module with the functionality you need.

2) Extend it yourself and send me a patch for inclusion (though, it would be highly advisable to discuss the matter first).

In any case, don't hesitate to get in touch with me. I love geometrical problems :-)

EXPORTABLE SUBS

intersection_area_circle_polygon($o, $r, @p)

Returns the area of the intersection between the circle of radius $r centered in $o and the polygon delimited by the list of points in @p.

intersection_area_rectangle($o, $r, $v0, $v1)

Return the area of the intersection between the circle of radius $r with center in $o and the axis-aligned rectangle defined by its two corners $v0 and $v1.

SEE ALSO

Math::Vector::Real, Math::Vector::Real::XS.

COPYRIGHT AND LICENSE

Copyright (C) 2014 by Salvador Fandiño <sfandino@yahoo.com>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.18.2 or, at your option, any later version of Perl 5 you may have available.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 215:

Non-ASCII character seen before =encoding in 'Fandiño'. Assuming UTF-8