/// <summary> /// Returns the closest Vertex of this polygon to a segment. /// </summary> /// <param name="segment"></param> /// <returns>The closest Vertex of this polygon to a segment.</returns> public virtual Vector2 ClosestVertexTo(Segment2D segment) { return(Hedra.ClosestObject(Vertices.ToList(), (vertex => segment.PerpendicularDistance(vertex)))); }
/// <summary> /// Returns the closest Vertex of this polygon to a line. /// </summary> /// <param name="line"></param> /// <returns>The closest Vertex of this polygon to a line.</returns> public virtual Vector2 ClosestVertexTo(Line2D line) { return(Hedra.ClosestObject(Vertices.ToList(), (vertex => line.PerpendicularDistance(vertex)))); }