/// <summary> /// Determines if a Edge is inside the Polygon by comparing /// it's start, end and mid Vertices. /// Note: Prone to error if polygon has Edges intersecting the edge not at mid vertex? /// </summary> /// <param name="edge"></param> /// <returns></returns> public bool ContainsEdge(Edge edge) { // TODO: Check if edge intersects polygon in Vertices different than start/end. return(this.ContainsVertex(edge.StartVertex) && this.ContainsVertex(edge.EndVertex) && this.ContainsVertex(Vertex.MidVertex(edge.StartVertex, edge.EndVertex))); }
//Vector-plane intersection https://math.stackexchange.com/questions/100439/determine-where-a-vector-will-intersect-a-plane #region Public Methods /// <summary> /// Returns the mid point between two points. /// </summary> /// <param name="point1"></param> /// <param name="point2"></param> /// <returns></returns> public static DSPoint MidPoint(DSPoint point1, DSPoint point2) { Vertex midVertex = Vertex.MidVertex(ToVertex(point1), ToVertex(point2)); return(ToPoint(midVertex)); }