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); }
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); }
public bool inside(Point3d x) { return(h.inside(x)); }
public bool inside(Point3d x) { HalfSpace h = new HalfSpace(start, end); return(h.inside(x)); }