private Stack grahamScan(Coordinate[] c){
  Coordinate p;
  Stack ps=new Stack();
  p=(Coordinate)ps.push(c[0]);
  p=(Coordinate)ps.push(c[1]);
  p=(Coordinate)ps.push(c[2]);
  for (int i=3; i < c.length; i++) {
    p=(Coordinate)ps.pop();
    while (!ps.empty() && CGAlgorithms.computeOrientation((Coordinate)ps.peek(),p,c[i]) > 0) {
      p=(Coordinate)ps.pop();
    }
    p=(Coordinate)ps.push(p);
    p=(Coordinate)ps.push(c[i]);
  }
  p=(Coordinate)ps.push(c[0]);
  return ps;
}

private Stack grahamScan ( Coordinate [ ] c ) { Coordinate p ; Stack ps = new Stack ( ) ; p = ( Coordinate ) ps . push ( c [ 0 ] ) ; p = ( Coordinate ) ps . push ( c [ 1 ] ) ; p = ( Coordinate ) ps . push ( c [ 2 ] ) ; for ( int i = 3 ; i < c . length ; i ++ ) { p = ( Coordinate ) ps . pop ( ) ; while ( ! ps . empty ( ) && CGAlgorithms . computeOrientation ( ( Coordinate ) ps . peek ( ) , p , c [ i ] ) > 0 ) { p = ( Coordinate ) ps . pop ( ) ; } p = ( Coordinate ) ps . push ( p ) ; p = ( Coordinate ) ps . push ( c [ i ] ) ; } p = ( Coordinate ) ps . push ( c [ 0 ] ) ; return ps ; }
uses the graham scan algorithm to compute the convex hull vertices .
