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. [1,3]).
[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 :-)
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.
$r
$o
@p
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.
$v0
$v1
Math::Vector::Real, Math::Vector::Real::XS.
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:
Non-ASCII character seen before =encoding in 'Fandiño'. Assuming UTF-8
To install Math::Geometry::IntersectionArea, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Math::Geometry::IntersectionArea
CPAN shell
perl -MCPAN -e shell install Math::Geometry::IntersectionArea
For more information on module installation, please visit the detailed CPAN module installation guide.