Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LineSegment

An immutable line segment in pixel space.

Hierarchy

  • LineSegment

Index

Constructors

Properties

Methods

Constructors

constructor

  • Construct a line segment from start and end points.

    Parameters

    • start: Point

      one end of the line segment

    • end: Point

      the other end of the line segment

    • color: PenColor

      line segment color

    Returns LineSegment

Properties

Readonly color

color: PenColor

Readonly end

end: Point

Readonly start

start: Point

Methods

length

  • length(): number
  • Compute the length of this segment.

    Returns number

    the length of the line segment

Static fromCoordinates

  • fromCoordinates(startx: number, starty: number, endx: number, endy: number, color: PenColor): LineSegment
  • Construct a line segment from coordinate pairs.

    Parameters

    • startx: number

      x-coordinate of start point

    • starty: number

      y-coordinate of start point

    • endx: number

      x-coordinate of end point

    • endy: number

      y-coordinate of end point

    • color: PenColor

      line segment color

    Returns LineSegment

Generated using TypeDoc