[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model/test LineTest.java, 1.4, 1.5
Status: Pre-Alpha
Brought to you by:
henryml
From: Nordholt <nor...@us...> - 2006-09-18 14:37:02
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28743/src/net/sourceforge/bprocessor/model/test Modified Files: LineTest.java Log Message: added some testing of the intersection method Index: LineTest.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/test/LineTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** LineTest.java 24 Jul 2006 13:18:06 -0000 1.4 --- LineTest.java 18 Sep 2006 14:36:50 -0000 1.5 *************** *** 83,85 **** --- 83,115 ---- assertEquals(Math.toRadians(18.4349), line.degreesAboutZ(), 0.0001); } + /** + * Test the intersection method. + */ + public void testIntersection() { + { + Vertex o1 = new Vertex(0, 1, 0); + Vertex d1 = new Vertex(0, 0, 1); + Line l1 = new Line(o1, d1); + + Vertex o2 = new Vertex(0, 0, 1); + Vertex d2 = new Vertex(0, 1, 0); + Line l2 = new Line(o2, d2); + + Vertex i = new Vertex(0, 1, 1); + assertTrue(l1.intersection(l2).equalEps(i)); + } + { + Vertex o1 = new Vertex(0.5, 0.86734, 0); + Vertex d1 = new Vertex(0, 0, 1); + Line l1 = new Line(o1, d1); + + Vertex o2 = new Vertex(0, 0, 1); + Vertex d2 = new Vertex(0.5, 0.86734, 0); + Line l2 = new Line(o2, d2); + + Vertex iTrue = new Vertex(0.5, 0.86734, 1); + Vertex iActual = l1.intersection(l2); + assertTrue(iTrue.equalEps(iActual)); + } + } } |