Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27776/src/net/sourceforge/bprocessor/model
Modified Files:
Edge.java
Log Message:
method to determine if two edges are parrallel
Index: Edge.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v
retrieving revision 1.79
retrieving revision 1.80
diff -C2 -d -r1.79 -r1.80
*** Edge.java 28 Mar 2007 09:00:47 -0000 1.79
--- Edge.java 29 Mar 2007 13:50:44 -0000 1.80
***************
*** 1064,1066 ****
--- 1064,1078 ----
return null;
}
+
+ /**
+ * Tells is this edge is parrallel to an other edge
+ * @param e the other edge
+ * @return wherther or not the edges are parrallel
+ */
+ public boolean parrallel(Edge e) {
+ Vertex thisDir = this.getDirection();
+ Vertex otherDir = e.getDirection();
+ Vertex cross = thisDir.cross(otherDir);
+ return cross.length() < 0.000001;
+ }
}
|