132133134135136137138139140141142
// y=x-1; Line l2 = new Line(1, -1); CPoint p = new Coordinate2D(-2d / 3d, (-2d / 3d) - 1); assertTrue(p.equals(l1.crossPoint(l2))); assertTrue(p.equals(l2.crossPoint(l1))); } @Test public void testCriticalCrossCoordinate2D() { // y=4x+1;
146147148149150151152153154155156
// y=x-1; Line l2 = new Line(1, -1); CPoint p = new Coordinate2D(1, 0); assertTrue(p.equals(l1.crossPoint(l2))); assertTrue(p.equals(l2.crossPoint(l1))); } @Test public void testDistance() { // y=x+1;