コード例 #1
0
ファイル: GeoLine.cs プロジェクト: StevePunak/KanoopCommon
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
ファイル: GeoLine.cs プロジェクト: StevePunak/KanoopCommon
 public bool Intersects(GeoCircle circle)
 {
     return(circle.Intersects(this));
 }
コード例 #5
0
 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);
 }