@Test
public void calculatesSegmentIntercept() {

    final Segment<Double> seg = new PtVectSegment<>(new RandomPoint<>(), new RandomPoint<>());
    final double error = 1.e-6;
    final Decimal dec = new Decimal();
    final Double startx = seg.start().coords()[0].value(dec);
    final Double starty = seg.start().coords()[1].value(dec);
    final Double endx = seg.end().coords()[0].value(dec);
    final Double endy = seg.end().coords()[1].value(dec);
    MatcherAssert.assertThat(
        new Intercept<Double>(seg).value(dec),
        Matchers.closeTo(
            starty - startx * (endy - starty) / (endx - startx), error
        )
    );
}