Math::Geometry::IntersectionArea - Calculate area of geometric shapes intersection
use Math::Geometry::IntersectionArea qw(intersection_area_circle_rectangle); my $area = intersection_area_circle_rectangle([1,4], 2, [0, 1], [5, 5]);
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.
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 :-)
- intersection_area_circle_polygon($o, $r, @p)
Returns the area of the intersection between the circle of radius
$oand the polygon delimited by the list of points in
- intersection_area_rectangle($o, $r, $v0, $v1)
Return the area of the intersection between the circle of radius
$rwith center in
$oand the axis-aligned rectangle defined by its two corners
Copyright (C) 2014 by Salvador Fandiño <firstname.lastname@example.org>
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