Class LineSegment

An immutable line segment in pixel space.

Hierarchy

  • LineSegment

Constructors

Properties

Methods

Constructors

Properties

color: PenColor

line segment color

end: Point

the other end of the line segment

start: Point

one end of the line segment

Methods

  • Returns

    true iff this and that represent the same line segment

    Parameters

    Returns boolean

  • Compute the length of this segment.

    Returns

    the length of the line segment

    Returns number

  • Construct a line segment from coordinate pairs.

    Returns

    line segment from (startx,starty) to (endx,endy) colored color

    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