public bool Intersects(GeoCircle circle) { bool intersects = false; foreach (GeoLine line in this) { GeoPoint p1, p2; int intersections; if (circle.Intersects(line, out p1, out p2, out intersections)) { intersects = true; break; } } return(intersects); }
public Double GetMiniumumPossibleDistance(GeoCircle postion) { Double distance = Double.MaxValue; if (postion.Intersects(this)) { distance = 0; } else { distance = DistanceToEdgeFrom(postion.Center as GeoPoint); distance = Math.Max(0, distance - postion.Radius); } return(distance); }
public static Double GetMiniumumPossibleDistanceFromAnyPolygon(GeoCircle postion, IEnumerable <GeoPolygon> polygons) { Double distance = Double.MaxValue; foreach (GeoPolygon polygon in polygons) { if (postion.Intersects(polygon) || polygon.Contains(postion.Center as GeoPoint)) { distance = 0; } else { Double thisDistance = polygon.DistanceToEdgeFrom(postion.Center as GeoPoint); thisDistance = Math.Max(0, thisDistance - postion.Radius); distance = Math.Min(distance, thisDistance); } if (distance == 0) { break; } } return(distance); }
public bool Intersects(GeoCircle circle) { return(circle.Intersects(this)); }
public bool Contains(GeoCircle circle, Double rayLength = DEFAULT_RAY_LENGTH) { /** see if this polygon entirely contains the given circle */ return(this.Contains(circle.Center as GeoPoint) == true && circle.Intersects(this) == false); }