public int indexOf ( float x , float y ) { for ( int i = 0 ; i < points . length ; i += 2 ) { if ( ( points [ i ] == x ) && ( points [ i + 1 ] == y ) ) { return i / 2 ; } } return - 1 ; }
Get the index of a given point