--- /dev/null
+package edu.berkeley.qfat.geom;
+import javax.media.opengl.*;
+
+public final class HalfSpace extends Plane {
+
+ public HalfSpace(Point p, Vec norm) { super(p, norm); }
+
+ /*
+ public Segment clip(Segment s) {
+ // FIXME: return null if segment is entirely excluded
+ throw new Error();
+ }
+
+
+ public Point intersect(Segment s) {
+ }
+
+ public HalfPlane intersect(Plane p) {
+ if (norm.minus(hs.norm).mag() < 0.001)
+ throw new Error("half-spaces are nearly parallel");
+
+ }
+ */
+
+ public boolean contains(Point p) {
+ float checker = p.x*norm.x+p.y*norm.y+p.z*norm.z + dvalue;
+ //System.out.println(norm+" "+dvalue+" contains " + p + " => " + checker);
+ return checker <= 0.00001;
+ }
+
+ public boolean contains(HalfSpace hs) {
+ // FIXME
+ return false;
+ }
+
+}