Returns true if the geometries are within the specified distance of one another.

@param geomA Geometry A
@param geomB Geometry B
@param distance Distance
@return True if if the geometries are within the specified distance of one another
511940
public static Boolean isWithinDistance(Geometry geomA, Geometry geomB, Double distance) {
        if(geomA == null||geomB == null){
            return null;
        }
        return geomA.isWithinDistance(geomB, distance);
    }
117431
public static boolean isPointNearMultiLatLng(LatLng point, MultiLatLng multiLatLng, double tolerance) {
        boolean near = false;
        for (LatLng multiPoint : multiLatLng.getLatLngs()) {
            near = isPointNearPoint(point, multiPoint, tolerance);
            if (near) {
                break;
            }
        }
        return near;
    }
789480
protected static double distanceSq(double[] a, double[] b) {
		double sum = 0;
		for (int i = 0; i < a.length; i++) {
			double d = a[i]-b[i];
			sum += d*d;
		}
		return sum;
	}
77257
protected int isBetter2D(Box a, Box b) {
		int compare = Long.compare(a.getVolume(), b.getVolume());
		if(compare != 0) {
			return compare;
		}
		return Long.compare(b.getFootprint(), a.getFootprint()); // i.e. smaller i better
	
	}
339923
public boolean intersects(Geometry geometry) {
		if (geometry == null) {
			return false;
		}
		Coordinate[] arr1 = getCoordinates();
		Coordinate[] arr2 = geometry.getCoordinates();
		for (int i = 0; i < arr1.length - 1; i++) {
			for (int j = 0; j < arr2.length - 1; j++) {
				if (Mathlib.lineIntersects(arr1[i], arr1[i + 1], arr2[j], arr2[j + 1])) {
					return true;
				}
			}
		}
		return false;
	}
969402
public static Point closestPoint(Geometry geomA, Geometry geomB) {
        if (geomA == null || geomB == null) {
            return null;
        }
        // Return the closest point on geomA. (We would have used index
        // 1 to return the closest point on geomB.)
        return geomA.getFactory().createPoint(DistanceOp.nearestPoints(geomA, geomB)[0]);
    }
446760
public static Geometry longestLine(Geometry geomA, Geometry geomB) {
        Coordinate[] coords = new MaxDistanceOp(geomA, geomB).getCoordinatesDistance();
        if(coords!=null){
            return geomA.getFactory().createLineString(coords);
        }
        return null;
    }
418221
private boolean intersects(Rectangle other) {
		Rectangle box = other;
		Circle circle = this;
		
		if (box.contains(x+radius,y+radius)) {
			return true;
		}
		
		float x1 = box.getX();
		float y1 = box.getY();
		float x2 = box.getX() + box.getWidth();
		float y2 = box.getY() + box.getHeight();
		
		Line[] lines = new Line[4];
		lines[0] = new Line(x1,y1,x2,y1);
		lines[1] = new Line(x2,y1,x2,y2);
		lines[2] = new Line(x2,y2,x1,y2);
		lines[3] = new Line(x1,y2,x1,y1);
		
		float r2 = circle.getRadius() * circle.getRadius();
		
		Vector2f pos = new Vector2f(circle.getCenterX(), circle.getCenterY());
		
		for (int i=0;i<4;i++) {
			float dis = lines[i].distanceSquared(pos);
			if (dis < r2) {
				return true;
			}
		}
		
		return false;
	}
201975
function isInLine(p1, m, p2, accuracy) {
  var a = p1.sub(m).sqr();
  var b = p2.sub(m).sqr();
  var c = p1.sub(p2).sqr();

  // control point not between anchors
  if ((a > (b + c)) || (b > (a + c))) {
    return false;
  }

  // count distance via scalar multiplication
  var distance = Math.sqrt(Math.pow((p1.x - m.x) * (p2.y - m.y) - (p2.x - m.x) * (p1.y - m.y), 2) / c);

  return distance < accuracy ? true : false;
}
224597
public static final double distance(final Point2D a, final Point2D b)
    {
        return Point2DJSO.distance(a.getJSO(), b.getJSO());
    }
827345
private void closestFarthestPoints(LineSegment2D_F32 a, LineSegment2D_F32 b)
	{
		dist[0] = a.a.distance2(b.a);
		dist[1] = a.a.distance2(b.b);
		dist[2] = a.b.distance2(b.a);
		dist[3] = a.b.distance2(b.b);

		// find the two points which are closest together and save which ones those are
		// for future reference
		farthestIndex = 0;
		float closest = dist[0];
		float farthest = dist[0];
		for( int i = 1; i < 4; i++ ) {
			float d = dist[i];
			if( d < closest ) {
				closest = d;
				closestIndex = i;
			}
			if( d > farthest ) {
				farthest = d;
				farthestIndex = i;
			}
		}
	}
1125795
public static boolean disjoint(Geometry geometry1, Geometry geometry2,
			SpatialReference spatialReference) {
		OperatorDisjoint op = (OperatorDisjoint) factory
				.getOperator(Operator.Type.Disjoint);
		boolean result = op.execute(geometry1, geometry2, spatialReference,
				null);
		return result;
	}
819533
@Pure
	public static boolean epsilonEqualsDistance(Point2D<?, ?> p1, Point2D<?, ?> p2) {
		final double distance = p1.getDistance(p2);
		return distance >= -distancePrecision && distance <= distancePrecision;
	}
1345720
static boolean polygonRelateMultiPoint_(Polygon polygon_a,
			MultiPoint multipoint_b, double tolerance, String scl,
			ProgressTracker progress_tracker) {
		RelationalOperationsMatrix relOps = new RelationalOperationsMatrix();
		relOps.resetMatrix_();
		relOps.setPredicates_(scl);
		relOps.setAreaPointPredicates_();

		Envelope2D env_a = new Envelope2D(), env_b = new Envelope2D();
		polygon_a.queryEnvelope2D(env_a);
		multipoint_b.queryEnvelope2D(env_b);

		boolean bRelationKnown = false;
		boolean b_disjoint = RelationalOperations.envelopeDisjointEnvelope_(
				env_a, env_b, tolerance, progress_tracker);

		if (b_disjoint) {
			relOps.areaPointDisjointPredicates_(polygon_a);
			bRelationKnown = true;
		}

		if (!bRelationKnown) {
			// Quick rasterize test to see whether the the geometries are
			// disjoint, or if one is contained in the other.
			int relation = RelationalOperations
					.tryRasterizedContainsOrDisjoint_(polygon_a, multipoint_b,
							tolerance, false);

			if (relation == RelationalOperations.Relation.disjoint) {
				relOps.areaPointDisjointPredicates_(polygon_a);
				bRelationKnown = true;
			} else if (relation == RelationalOperations.Relation.contains) {
				relOps.areaPointContainsPredicates_(polygon_a);
				bRelationKnown = true;
			}
		}

		if (!bRelationKnown) {
			EditShape edit_shape = new EditShape();
			int geom_a = edit_shape.addGeometry(polygon_a);
			int geom_b = edit_shape.addGeometry(multipoint_b);
			relOps.setEditShapeCrackAndCluster_(edit_shape, tolerance,
					progress_tracker);
			relOps.computeMatrixTopoGraphClusters_(geom_a, geom_b);
			relOps.m_topo_graph.removeShape();
		}

		boolean bRelation = relationCompare_(relOps.m_matrix, relOps.m_scl);
		return bRelation;
	}
114343
public boolean overlaps(BoundingBox o, double cutoff) {
		if (this==o) return true;
		// x dimension
		if (!areOverlapping(xmin,xmax,o.xmin,o.xmax,cutoff)) {
			return false;
		}
		// y dimension
		if (!areOverlapping(ymin,ymax,o.ymin,o.ymax,cutoff)) {
			return false;
		}
		// z dimension
		if (!areOverlapping(zmin,zmax,o.zmin,o.zmax,cutoff)) {
			return false;
		}
		return true;
	}
812343
public boolean Equals(OGCGeometry another) {
		if (this == another)
			return !isEmpty();
		
		if (another == null)
			return false;
		
		if (another.geometryType() == OGCConcreteGeometryCollection.TYPE) {
			return another.Equals(this);
		}
		
		com.esri.core.geometry.Geometry geom1 = getEsriGeometry();
		com.esri.core.geometry.Geometry geom2 = another.getEsriGeometry();
		return com.esri.core.geometry.GeometryEngine.equals(geom1, geom2,
				getEsriSpatialReference());
	}
1122494
def __distance_valid(self, g0, g1, p):
        
        dist = np.sqrt((g1.x - g0.x) ** 2 +
                    (g1.y - g0.y) ** 2)
        return dist >= p.min_separation