package com.github.davidmoten.rtree.geometry;

import com.github.davidmoten.rtree.Entry;

/**
 * A geometrical region that represents an Entry spatially. It is recommended
 * that implementations of this interface implement equals() and hashCode()
 * appropriately that {@link Entry} equality checks work as expected.
 */
public interface Geometry {

	/**
	 * Returns the distance to the given {@link Rectangle}. For a
	 * {@link Rectangle} this might be Euclidean distance but for an EPSG4326
	 * lat-long Rectangle might be great-circle distance.
	 * 
	 * @param r
	 *            rectangle to measure distance to
	 * @return distance to the rectangle r from the geometry
	 */
	double distance(Rectangle r);

	/**
	 * Returns the minimum bounding rectangle of this geometry.
	 * 
	 * @return minimum bounding rectangle
	 */
	Rectangle mbr();
}

@@ -345,24 +345,32 @@
 try %7B%0A%0A%09/**%0A
+%09 * %3Cp%3E%0A
 %09 * Returns 
@@ -549,16 +549,248 @@
 istance.
+ The distance function%0A%09 * should satisfy the following properties:%0A%09 * %3C/p%3E%0A%09 * %0A%09 * %3Cp%3E%0A%09 * %3Ccode%3Edistance(r) &gt;= 0%3C/code%3E%0A%09 * %3C/p%3E%0A%09 * %0A%09 * %3Cp%3E%0A%09 * %3Ccode%3Eif r1 contains r2 then distance(r1)&lt;=distance(r2)%3C/code%3E%0A%09 * %3C/p%3E%0A%09 * 
 %0A%09 * %0A%09 

add javadoc