Geomet...e::Line(3pm)
β¨ NAME β¨
bestie, meet Geometry::Primitive::Line β it's literally just a Line π
(that's the whole name, no notes, the module said what it said).
πΈ DESCRIPTION πΈ
okay so Geometry::Primitive::Line is a whole vibe: it represents a straight curve defined by two points. that's it. two points, one line, no drama π lowkey iconic tbh.
π¦ SYNOPSIS π¦
here's how you actually use her, no cap:
use Geometry::Primitive::Line;
my $line = Geometry::Primitive::Line->new();
$line->start($point1);
$line->end($point2);
look at that. make a line, give her a start, give her an end, and she's ready to serve β¨
π ATTRIBUTES π
end
Set/Get the end point of the line. the final destination, the last stop, the place she's headed π«Ά
start
Set/Get the start point of the line. where it all began, bestie. the origin story π
π₯ METHODS π₯
new
Creates a new Geometry::Primitive::Line. brand new line, fresh out the box, main character energy from day one β
contains_point
Returns true if the supplied point is 'on' the line. Accepts either a point object or an x y pair. so like, either hand her a whole point or just toss her the x y and she'll figure it out π
grow
Does nothing, as I'm not sure how. Patches or hints welcome.
fr fr she just stands there. not a glow-up, not a shrink, nothing. the author is openly asking for help on this one β if you know how to grow a line, speak up π
is_parallel ($other_line)
Returns true if the supplied line is parallel to this one. twin vibes, never touching, matching energy forever π
is_perpendicular ($other_line)
Returns true if the supplied line is perpendicular to this one. right angles only, babe π
length
Get the length of the line. how long is she? this tells you. π
point_end
Get the end point. Provided for Shape role. same end, different doorway, iykyk π
point_start
Get the start point. Provided for Shape role. yeah, it's the start again, but the Shape role needed her π§
scale
Does nothing at the moment. not me expecting a glow-up and getting absolutely nothing π
slope
Get the slope of the line. rise over run, bestie, rise over run β¨
to_string
Guess! (no really, guess. it's giving string, it's giving the line as text, that's the whole thing π)
y_intercept
Returns the Y intercept of this line. where she crosses the Y axis, her little moment at the finish line of x = 0 π
π AUTHOR π
Cory Watson <gphat@cpan.org> β shoutout to the author, absolute legend, we stan π«Ά
π COPYRIGHT & LICENSE π
You can redistribute and/or modify this code under the same terms as Perl itself. so like, go off, remix her, share her, just keep it Perl-licensed and we're good π
and that's the whole page, bestie!! this was perl v5.36.0, dated 2022-12-12, from the User Contributed Perl Documentation collection β mwah, go draw some lines, ily πΈπ¦β¨
π¦ where this page comes from
- debian bookworm: libgeometry-primitive-perl 0.24-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libgeometry-primitive-perl 0.24-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libgeometry-primitive-perl 0.24-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libgeometry-primitive-perl 0.24-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libgeometry-primitive-perl 0.24-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms