private int Compare(  cVertex tpi, cVertex tpj )
    {
      int a;             //area 
      int x, y;          //projections of ri & rj in 1st quadrant 
      cVertex pi, pj;
      pi = tpi;
      pj = tpj;
      cVertex myhead = new cVertex();
      myhead = list.head;
      a = myhead.v.AreaSign( myhead.v, pi.v, pj.v );
      if (a > 0)
	return -1;
      else if (a < 0)
	return 1;
      else { // Collinear with list.head
	x =  Math.abs( pi.v.x -  list.head.v.x ) - Math.abs( pj.v.x -  list.head.v.x );
	y =  Math.abs( pi.v.y -  list.head.v.y ) - Math.abs( pj.v.y -  list.head.v.y );
	ndelete++;
	
	if ( (x < 0) || (y < 0) ) {
	  pi.mark = true;
	  return -1;
	}
	else if ( (x > 0) || (y > 0) ) {
	  pj.mark = true;
	  return 1;
	}
	else { // points are coincident 
	  
	  if (pi.vnum > pj.vnum)
	    pj.mark = true;
	  else 
	    pi.mark = true;
	  return 0;
	  
	}
      }
    }