public double angle(){
  return Math.atan2(p1.y - p0.y,p1.x - p0.x);
}

public double angle ( ) { return Math . atan2 ( p1 . y - p0 . y , p1 . x - p0 . x ) ; }
computes the angle that the vector defined by this segment makes with the x - axis . the angle will be in the range [ - pi , pi ] radians .
