package march;

public class Edge{
  public Vertex v1,v2;
  
  public Edge(Vertex v1, Vertex v2){
    this.v1 = v1;
    this.v2 = v2;
  }
  public Vertex getUpper(){
    if( v1.py >= v2.py){
      return v1;
    }
    else{
      return v2;
    }
  }

  public Vertex getLower(){
    if( v1.py < v2.py ){
      return v1;
    }
    else{
      return v2;
    }
  }

  public double getSlope(){
    return (v1.py - v2.py)/(v1.px - v2.px);
  }

  public String toString(){
    return ("v1 = " + v1.toString() + "," + " v2 = " + v2.toString());
  }
      
}
