public double getDistance ( Coordinate coordinate ) { double minDistance = Double . MAX_VALUE ; if ( ! isEmpty ( ) ) { for ( int i = 0 ; i < this . coordinates . length - 1 ; i ++ ) { double dist = Mathlib . distance ( this . coordinates [ i ] , this . coordinates [ i + 1 ] , coordinate ) ; if ( dist < minDistance ) { minDistance = dist ; } } } return minDistance ; }
Return the minimal distance between this coordinate and any line segment of the geometry .