---
name: "Geometry::Primitive::Line"
section: "3pm"
platform: "linux"
package: "libgeometry-primitive-perl"
version: "0.24-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Geometry::Primitive::Line"
---

# Geometry::Primitive::Line(3pm)

A Line

## NAME

Geometry::Primitive::Line - A Line

## DESCRIPTION

Geometry::Primitive::Line represents a straight curve defined by two points.

## SYNOPSIS

```
  use Geometry::Primitive::Line;
  my $line = Geometry::Primitive::Line->new();
  $line->start($point1);
  $line->end($point2);
```

## ATTRIBUTES

### end

Set/Get the end point of the line.

### start

Set/Get the start point of the line.

## METHODS

### new

Creates a new Geometry::Primitive::Line

### contains\_point

Returns true if the supplied point is 'on' the line.  Accepts either a point object or an x y pair.

### grow

Does nothing, as I'm not sure how.  Patches or hints welcome.

### is\_parallel ($other\_line)

Returns true if the supplied line is parallel to this one.

### is\_perpendicular ($other\_line)

Returns true if the supplied line is perpendicular to this one.

### length

Get the length of the line.

### point\_end

Get the end point.  Provided for Shape role.

### point\_start

Get the start point.  Provided for Shape role.

### scale

Does nothing at the moment.

### slope

Get the slope of the line.

### to\_string

Guess!

### y\_intercept

Returns the Y intercept of this line.

## AUTHOR

Cory Watson \<gphat@cpan.org\>

## COPYRIGHT & LICENSE

You can redistribute and/or modify this code under the same terms as Perl itself.
