Geomet...e::Line(3pm)

πŸ“¦
version 0.24 Β· 2 versions
  • 0.24 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.24 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ 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 🫢


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