Class Segment


  • public class Segment
    extends Object
    Represents a line segment by its endpoints. Endpoints are stored in order as given by the compareTo function of the Point class.
    Author:
    Tyler Chenhall
    • Constructor Detail

      • Segment

        public Segment​(processing.core.PVector one,
                       processing.core.PVector two)
      • Segment

        public Segment​(float p1X,
                       float p1Y,
                       float p2X,
                       float p2Y)
    • Method Detail

      • getLeftPoint

        public processing.core.PVector getLeftPoint()
        Get the left segment endpoint (as ordered by the compareTo function of the Point class).
        Returns:
        The left segment endpoint
      • getRightPoint

        public processing.core.PVector getRightPoint()
        Get the right segment endpoint (as ordered by the compareTo function of the Point class).
        Returns:
        The right segment endpoint
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object