Ejemplo n.º 1
0
        // Revisar
        #region FurthestPointFrom
        /// <summary>
        /// Returns the furthest point of this polygon to a point.
        /// </summary>
        /// <param name="point"></param>
        /// <returns>The furthest point of this polygon to another point.</returns>
        public virtual Vector2 FurthestPointFrom(Vector2 point)
        {
            Line2D         line          = new Line2D(Center, point);
            List <Vector2> intersections = IntersectionPoints(line);

            return(Hedra.FurthestPoint(point, intersections));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns the furthest edge of this box to a point.
        /// </summary>
        /// <param name="point"></param>
        /// <returns>The furthest edge of this box to a point.</returns>
        public virtual Segment2D FurthestEdgeFrom(Vector2 point)
        {
            List <Vector2> perpendicularPoints = PerpendicularPointsTo(point);
            Vector2        closestPoint        = Hedra.FurthestPoint(point, perpendicularPoints);
            int            closestEdgeIndex    = perpendicularPoints.IndexOf(closestPoint);

            return(Edges[closestEdgeIndex]);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Returns the deepest Vertex of this box in another box.
        /// </summary>
        /// <param name="other"></param>
        /// <returns>The closest Vertex of this box to another box.</returns>
        public virtual Vector2 DeepestVertexIn(Polygon other)
        {
            Vector2 furthestVertex = FurthestVertexFrom(other);

            return(Hedra.FurthestPoint(furthestVertex, Vertices.ToList()));
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Returns the furthest Vertex of this polygon to another polygon.
 /// </summary>
 /// <param name="other"></param>
 /// <returns>The furthest Vertex of this polygon to another polygon.</returns>
 public virtual Vector2 FurthestVertexFrom(Polygon other)
 {
     return(Hedra.FurthestPoint(other.Center, Vertices.ToList()));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Returns the furthest Vertex of this polygon to a point.
 /// </summary>
 /// <param name="point"></param>
 /// <returns>The furthest Vertex of this polygon to a point.</returns>
 public virtual Vector2 FurthestVertexFrom(Vector2 point)
 {
     return(Hedra.FurthestPoint(point, Vertices.ToList()));
 }