Class Segment


  • public class Segment
    extends Object
    segment has increasing abscissae and a decreasing ordinate it defines a part of a trajectory and contains two points

    Segment class diagram

    • Constructor Detail

      • Segment

        public Segment​(Point p0,
                       Point p1)
      • Segment

        public Segment​(float x0,
                       float y0,
                       float x1,
                       float y1)
    • Method Detail

      • ordinate

        public Float ordinate​(float x)
        return the ordinate of a x abscissa value return null if x is not on the segment
      • belong

        public boolean belong​(Point p)
      • cross

        public Float cross​(Segment segment)
        return null if the current segment never cross the segment in parameter else : return the abscissa of the cross' point the equation is alpha*x+beta = alpha2*x+beta2 => x = (-beta+beta2)/(alpha-alpha2)
      • shiftRight

        public void shiftRight​(float x)
      • shiftLeft

        public void shiftLeft​(float x)
      • isHorizontal

        public boolean isHorizontal()
      • drop

        public void drop()
      • getAlpha

        public float getAlpha()
      • getBeta

        public float getBeta()
      • hasNext

        public boolean hasNext()
      • getP0

        public Point getP0()
      • setP0

        public void setP0​(Point p0)
      • getP1

        public Point getP1()
      • setP1

        public void setP1​(Point p1)