* {@link chunmap.model.elem.LineSegment#intersection(chunmap.model.elem.LineSegment)}
* 的测试方法。
*/
@Test
public void testIntersection() {
CPoint p1 = new Coordinate2D(10, 10);
CPoint p2 = new Coordinate2D(0, 0);
CPoint p3 = new Coordinate2D(0, 10);
CPoint p4 = new Coordinate2D(10, 0);
CPoint p5 = new Coordinate2D(5, 5);
CPoint p6 = new Coordinate2D(-1, -1);
CPoint p7 = new Coordinate2D(-1, 7);
LineSegment lseg1 = new LineSegment(p1, p2);
LineSegment lseg2 = new LineSegment(p3, p4);
CPoint p = (CPoint) lseg1.intersection(lseg2);
CPoint ep = new Coordinate2D(5, 5);
assertTrue(p.equals(ep));
LineSegment lseg3 = new LineSegment(p5, p6);
LineString l = new LineString((CPoint[]) lseg1.intersection(lseg3));