private static float polyMinExtent ( float [ ] verts , int nverts ) { float minDist = Float . MAX_VALUE ; for ( int i = 0 ; i < nverts ; i ++ ) { int ni = ( i + 1 ) % nverts ; int p1 = i * 3 ; int p2 = ni * 3 ; float maxEdgeDist = 0 ; for ( int j = 0 ; j < nverts ; j ++ ) { if ( j == i || j == ni ) { continue ; } float d = distancePtSeg2d ( verts , j * 3 , verts , p1 , p2 ) ; maxEdgeDist = Math . max ( maxEdgeDist , d ) ; } minDist = Math . min ( minDist , maxEdgeDist ) ; } return ( float ) Math . sqrt ( minDist ) ; }
Calculate minimum extend of the polygon .