/// <summary>
        /// Tests whether the facets of two geometries lie within a given distance.
        /// </summary>
        /// <param name="g1">A geometry</param>
        /// <param name="g2">A geometry</param>
        /// <param name="distance">The distance limit</param>
        /// <returns><c>true</c> if two facets lie with the given distance</returns>
        public static bool IsWithinDistance(Geometry g1, Geometry g2, double distance)
        {
            var dist = new IndexedFacetDistance(g1);

            return(dist.IsWithinDistance(g2, distance));
        }
        /// <summary>
        /// Computes the nearest points of the facets of two geometries.
        /// </summary>
        /// <param name="g1">A geometry</param>
        /// <param name="g2">A geometry</param>
        /// <returns>The nearest points on the facets of the geometries</returns>
        public static Coordinate[] NearestPoints(Geometry g1, Geometry g2)
        {
            var dist = new IndexedFacetDistance(g1);

            return(dist.NearestPoints(g2));
        }
        /// <summary>
        /// Computes the distance between facets of two geometries.
        /// </summary>
        /// <remarks>
        /// For geometries with many segments or points,
        /// this can be faster than using a simple distance
        /// algorithm.
        /// </remarks>
        /// <param name="g1">A geometry</param>
        /// <param name="g2">A geometry</param>
        /// <returns>The distance between the two geometries</returns>
        public static double Distance(Geometry g1, Geometry g2)
        {
            var dist = new IndexedFacetDistance(g1);

            return(dist.Distance(g2));
        }