Пример #1
0
        protected Point3d search2d(Point3d p)
        {
            int i;

            i = pts[0] == p ? 1 : 0;
            Point3d   cand  = pts[i];
            HalfSpace candh = new HalfSpace(p, cand);

            for (i = i + 1; i < pts.Length; i++)
            {
                if (pts[i] != p && candh.inside(pts[i]))
                {
                    cand  = pts[i];
                    candh = new HalfSpace(p, cand);
                }
            }
            return(cand);
        }
Пример #2
0
        protected Point3d search(Edge3d e)
        {
            int i;

            for (i = 0; pts[i] == e.start || pts[i] == e.end; i++)
            {
                /* nothing */
            }
            Point3d   cand  = pts[i];
            HalfSpace candh = new HalfSpace(e.start, e.end, cand);

            for (i = i + 1; i < pts.Length; i++)
            {
                if (pts[i] != e.start && pts[i] != e.end && candh.inside(pts[i]))
                {
                    cand  = pts[i];
                    candh = new HalfSpace(e.start, e.end, cand);
                }
            }
            return(cand);
        }
Пример #3
0
 public bool inside(Point3d x)
 {
     return(h.inside(x));
 }
Пример #4
0
        public bool inside(Point3d x)
        {
            HalfSpace h = new HalfSpace(start, end);

            return(h.inside(x));
        }