projects
/
anneal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
checkpoint
[anneal.git]
/
src
/
edu
/
berkeley
/
qfat
/
geom
/
Plane.java
diff --git
a/src/edu/berkeley/qfat/geom/Plane.java
b/src/edu/berkeley/qfat/geom/Plane.java
index
fe23b83
..
966eebf
100644
(file)
--- a/
src/edu/berkeley/qfat/geom/Plane.java
+++ b/
src/edu/berkeley/qfat/geom/Plane.java
@@
-79,10
+79,17
@@
public class Plane implements AffineConstraint {
} else if (c instanceof Line) {
Line l = (Line)c;
} 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;
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);
} else
return c.intersect(this, epsilon);