### Question:
Line extends org.apache.sis.math.Line { public Line2D isoscelesTriangleBase(final Point2D summit, double sideLength) { sideLength *= sideLength; if (slope() == 0) { final double x = summit.getX(); final double dy = y0() - summit.getY(); final double dx = Math.sqrt(sideLength - dy*dy); if (isNaN(dx)) { return null; } return new Line2D.Double(x+dx, y0(), x-dx, y0()); } if (isInfinite(slope())) { final double y = summit.getY(); final double dx = x0() - summit.getX(); final double dy = Math.sqrt(sideLength - dx*dx); if (isNaN(dy)) { return null; } return new Line2D.Double(x0(), y+dy, x0(), y-dy); } final double x = summit.getX(); final double y = summit.getY(); final double dy = y0() - y + slope() * x; final double B = -slope() * dy; final double A = slope() * slope() + 1; final double C = Math.sqrt(B*B + A*(sideLength - dy*dy)); if (isNaN(C)) { return null; } final double x1 = (B+C)/A + x; final double x2 = (B-C)/A + x; return new Line2D.Double(x1, slope() * x1 + y0(), x2, slope() * x2 + y0()); } Line();  Line(final double slope, final double y0); Point2D intersectionPoint(final Line line); Point2D intersectionPoint(final Line2D line); Point2D nearestColinearPoint(final Point2D point); Line2D isoscelesTriangleBase(final Point2D summit, double sideLength);  }### Answer:
@Test public void testIsoscelesTriangleBase() { final Line test = new Line(); test.setFromPoints(20,30, 80,95); final double slope = 1.083333333333333333333333; final double offset = 8.333333333333333333333333; assertEquals("slope", slope, test.slope(), EPS); assertEquals("y0", offset, test.y0(), EPS); assertEquals("x0", -offset/slope, test.x0(), EPS); final double distance = 40; final Point2D summit = new Point2D.Double(27, -9); final Line2D base = test.isoscelesTriangleBase(summit, distance); assertEquals("distance P1", distance, base.getP1().distance(summit), EPS); assertEquals("distance P2", distance, base.getP2().distance(summit), EPS); final double x = 10; final double y = 8; assertEquals("nearest colinear point", base.ptLineDist(x,y), test.nearestColinearPoint(new Point2D.Double(x,y)).distance(x,y), EPS); }