} else if (c instanceof Line) {
Line l = (Line)c;
- if ( Math.abs(a + b*l.m + this.c*l.n) <= epsilon &&
- Math.abs(b * l.c + this.c * l.d + d) <= epsilon)
+ if (Math.abs(a + b*l.m + this.c*l.n) <= epsilon &&
+ Math.abs(b * l.c + this.c*l.d + d) <= epsilon)
return l;
- throw new RuntimeException("not yet implemented");
+
+ // FIXME: parallel case
+
+ float x = (d - b*l.c - this.c*l.d) / (a + b*l.m + this.c*l.n);
+ float y = l.m*x+l.c;
+ float z = l.n*x+l.d;
+ return new Point(x,y,z);
+ //throw new RuntimeException("not yet implemented");
} else
return c.intersect(this, epsilon);