line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Geometry::Primitive; |
2
|
1
|
|
|
1
|
|
33975
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
56
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
76
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.24'; |
6
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:GPHAT'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
1; |
9
|
|
|
|
|
|
|
__END__ |
10
|
|
|
|
|
|
|
=head1 NAME |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Geometry::Primitive - Primitive Geometry Entities |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 SYNOPSIS |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Geometry::Primitive is a device and library agnostic system for representing |
17
|
|
|
|
|
|
|
geometric entities such as points, lines and shapes. It provides simple |
18
|
|
|
|
|
|
|
objects and many convenience methods you would expect from a simple geometry |
19
|
|
|
|
|
|
|
library. |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
use Geometry::Primitive::Point; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
my $foo = Geometry::Primitive::Point->new(x => 1, y => 3); |
24
|
|
|
|
|
|
|
... |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 DISCLAIMER |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
I'm not a math guy. I hate math. I will likely learn a lot in the process |
29
|
|
|
|
|
|
|
of making this library. If you are a math person you will probably look at |
30
|
|
|
|
|
|
|
this and find many things missing or wrong. Patches are B<encouraged>. I will |
31
|
|
|
|
|
|
|
likely find that I've done something completely wrong having taken geometry |
32
|
|
|
|
|
|
|
over 10 years ago. C'est la vie. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 ENTITIES |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=over 4 |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=item L<Arc|Geometry::Primitive::Arc> |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=item L<Bezier|Geometry::Primitive::Bezier> |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=item L<Circle|Geometry::Primitive::Circle> |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=item L<Ellipse|Geometry::Primitive::Ellipse> |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=item L<Line|Geometry::Primitive::Line> |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=item L<Point|Geometry::Primitive::Point> |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=item L<Polygon|Geometry::Primitive::Polygon> |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=item L<Rectangle|Geometry::Primitive::Rectangle> |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=back |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 SERIALIZATON |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
All of the entities in this library support serialization via |
59
|
|
|
|
|
|
|
L<MooseX::Storage>. This is primarily to support serialization in consumers |
60
|
|
|
|
|
|
|
of this library, but may be useful for other purposes. All classes are set |
61
|
|
|
|
|
|
|
to JSON format and File IO. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 AUTHOR |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Cory Watson, C<< <gphat@cpan.org> >> |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Many of the ideas here come from my experience using the Cairo library. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 BUGS |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Please report any bugs or feature requests to C<bug-geometry-primitive at rt.cpan.org>, or through |
74
|
|
|
|
|
|
|
the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Geometry-Primitive>. I will be notified, and then you'll |
75
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
80
|
|
|
|
|
|
|
under the same terms as Perl itself. |