Class LineSegment

An immutable line segment in floating-point pixel space.

Constructors

  • 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

color: PenColor

line segment color

end: Point

the other end of the line segment

start: Point

one end of the line segment

Methods

  • Parameters

    Returns boolean

    true iff this and that represent the same line segment

  • Compute the length of this segment.

    Returns number

    the length of the line segment

  • 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

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

Generated using TypeDoc