public bool Contain(Point2D v_point)
 {
     Edge v_edge_1 = new Edge(v_point, m_pointEnd);
     Edge v_edge_2 = new Edge(m_pointStart, v_point);
     if (Math.Abs(v_edge_1 * v_edge_2 + v_edge_1.GetLength() * v_edge_2.GetLength()) < Math.Pow(10, -8))
     {
         return true;
     }
     return false;
 }
 public bool BoundaryPolygonContain(Point2D v_point)
 {
     List<Edge> v_list_boundaryEdge = GetBoundaryPolygon();
     for (int i = 0; i < v_list_boundaryEdge.Count; i++)
     {
         if(v_list_boundaryEdge[i].Contain(v_point))
         {
             return true;
         }
     }
     return false;
 }
 public bool Contain(Point2D v_point)
 {
     List<Edge> v_list_boundaryEdge = GetBoundaryPolygon();
     for (int i = 0; i < m_list_node.Count; i++)
     {
         int v_int_dem = 0;
         HalfLine v_hafl = new HalfLine(m_list_node[i], v_point);
         foreach (var item in v_list_boundaryEdge)
         {
             if (!v_hafl.Intersected(item))
             {
                 v_int_dem++;
             }
         }
         if(v_int_dem  == v_list_boundaryEdge.Count)
         {
             return false;
         }
     }
     return true;
 }
 public Edge(Point2D v_pointStart, Point2D v_pointEnd)
 {
     m_pointStart = v_pointStart;
     m_pointEnd = v_pointEnd;
 }
Example #5
0
 public void Add(Point2D v_node)
 {
     m_list_node.Add(v_node);
 }
 public void Add(Point2D v_node)
 {
     m_list_node.Add(v_node);
 }
 public HalfLine(Point2D v_point_pStart,Point2D v_point_pEnd)
 {
     m_point_pStart = v_point_pStart;
     m_point_pEnd = v_point_pEnd;
 }