public ShapeTileOctagon bounding_octagon(){
  if (bounding_octagon != null)   return bounding_octagon;
  PlaPointFloat start_corner=start_point_approx();
  PlaPointFloat end_corner=end_point_approx();
  double lx=Math.floor(Math.min(start_corner.v_x,end_corner.v_x));
  double ly=Math.floor(Math.min(start_corner.v_y,end_corner.v_y));
  double rx=Math.ceil(Math.max(start_corner.v_x,end_corner.v_x));
  double uy=Math.ceil(Math.max(start_corner.v_y,end_corner.v_y));
  double start_x_minus_y=start_corner.v_x - start_corner.v_y;
  double end_x_minus_y=end_corner.v_x - end_corner.v_y;
  double ulx=Math.floor(Math.min(start_x_minus_y,end_x_minus_y));
  double lrx=Math.ceil(Math.max(start_x_minus_y,end_x_minus_y));
  double start_x_plus_y=start_corner.v_x + start_corner.v_y;
  double end_x_plus_y=end_corner.v_x + end_corner.v_y;
  double llx=Math.floor(Math.min(start_x_plus_y,end_x_plus_y));
  double urx=Math.ceil(Math.max(start_x_plus_y,end_x_plus_y));
  ShapeTileOctagon result=new ShapeTileOctagon(lx,ly,rx,uy,ulx,lrx,llx,urx);
  bounding_octagon=result.normalize();
  return bounding_octagon;
}

public ShapeTileOctagon bounding_octagon ( ) { if ( bounding_octagon != null ) return bounding_octagon ; PlaPointFloat start_corner = start_point_approx ( ) ; PlaPointFloat end_corner = end_point_approx ( ) ; double lx = Math . floor ( Math . min ( start_corner . v_x , end_corner . v_x ) ) ; double ly = Math . floor ( Math . min ( start_corner . v_y , end_corner . v_y ) ) ; double rx = Math . ceil ( Math . max ( start_corner . v_x , end_corner . v_x ) ) ; double uy = Math . ceil ( Math . max ( start_corner . v_y , end_corner . v_y ) ) ; double start_x_minus_y = start_corner . v_x - start_corner . v_y ; double end_x_minus_y = end_corner . v_x - end_corner . v_y ; double ulx = Math . floor ( Math . min ( start_x_minus_y , end_x_minus_y ) ) ; double lrx = Math . ceil ( Math . max ( start_x_minus_y , end_x_minus_y ) ) ; double start_x_plus_y = start_corner . v_x + start_corner . v_y ; double end_x_plus_y = end_corner . v_x + end_corner . v_y ; double llx = Math . floor ( Math . min ( start_x_plus_y , end_x_plus_y ) ) ; double urx = Math . ceil ( Math . max ( start_x_plus_y , end_x_plus_y ) ) ; ShapeTileOctagon result = new ShapeTileOctagon ( lx , ly , rx , uy , ulx , lrx , llx , urx ) ; bounding_octagon = result . normalize ( ) ; return bounding_octagon ; }
calculates the smallest surrounding octagon of this line segmant
