コード例 #1
0
        /// <summary>
        /// Retourne la liste des points de croisement avec la forme donnée
        /// </summary>
        /// <param name="shape">Forme à tester</param>
        /// <returns>Liste des points de croisement</returns>
        public List <RealPoint> GetCrossingPoints(IShape shape)
        {
            List <RealPoint> output = new List <RealPoint>();

            if (shape is RealPoint)
            {
                output = CircleWithRealPoint.GetCrossingPoints(this, shape as RealPoint);
            }
            else if (shape is Segment)
            {
                output = CircleWithSegment.GetCrossingPoints(this, shape as Segment);
            }
            else if (shape is Polygon)
            {
                output = CircleWithPolygon.GetCrossingPoints(this, shape as Polygon);
            }
            else if (shape is Circle)
            {
                output = CircleWithCircle.GetCrossingPoints(this, shape as Circle);
            }
            else if (shape is Line)
            {
                output = CircleWithLine.GetCrossingPoints(this, shape as Line);
            }

            return(output);
        }
コード例 #2
0
        /// <summary>
        /// Teste si le cercle courant croise la forme donnée
        /// </summary>
        /// <param name="shape">Forme testéé</param>
        /// <returns>Vrai si le cercle courant croise la forme donnée</returns>
        public bool Cross(IShape shape)
        {
            bool output = false;

            if (shape is RealPoint)
            {
                output = CircleWithRealPoint.Cross(this, shape as RealPoint);
            }
            else if (shape is Segment)
            {
                output = CircleWithSegment.Cross(this, shape as Segment);
            }
            else if (shape is Polygon)
            {
                output = CircleWithPolygon.Cross(this, shape as Polygon);
            }
            else if (shape is Circle)
            {
                output = CircleWithCircle.Cross(this, shape as Circle);
            }
            else if (shape is Line)
            {
                output = CircleWithLine.Cross(this, shape as Line);
            }

            return(output);
        }
コード例 #3
0
        /// <summary>
        /// Retourne la distance minimale entre le cercle courant et la forme donnée
        /// </summary>
        /// <param name="shape">Forme testée</param>
        /// <returns>Distance minimale</returns>
        public double Distance(IShape shape)
        {
            double output = 0;

            if (shape is RealPoint)
            {
                output = CircleWithRealPoint.Distance(this, shape as RealPoint);
            }
            else if (shape is Segment)
            {
                output = CircleWithSegment.Distance(this, shape as Segment);
            }
            else if (shape is Polygon)
            {
                output = CircleWithPolygon.Distance(this, shape as Polygon);
            }
            else if (shape is Circle)
            {
                output = CircleWithCircle.Distance(this, shape as Circle);
            }
            else if (shape is Line)
            {
                output = CircleWithLine.Distance(this, shape as Line);
            }

            return(output);
        }