@Test
public void calculatesAngle() {

    final Vect<Double> vecta = new DblVect(1., 0.);
    final double pifourth = Math.PI / 4;
    final Dot dot = new Dot();
    final double error = 1.e-6;
    MatcherAssert.assertThat(
        dot.angle(vecta, new DblVect(0., -1.)).resolve(dot).doubleValue(),
        Matchers.closeTo(-Math.PI / 2, error)
    );
    MatcherAssert.assertThat(
        dot.angle(vecta, new DblVect(-1., 0.)).resolve(dot).doubleValue(),
        Matchers.closeTo(Math.PI, error)
    );
    MatcherAssert.assertThat(
        dot.angle(vecta, new DblVect(0., 1.)).resolve(dot).doubleValue(),
        Matchers.closeTo(Math.PI / 2, error)
    );
    MatcherAssert.assertThat(
        dot.angle(vecta, new DblVect(1., 1.)).resolve(dot).doubleValue(),
        Matchers.closeTo(pifourth, error)
    );
    MatcherAssert.assertThat(
        dot.angle(vecta, new DblVect(0., 0.)).resolve(dot).doubleValue(),
        Matchers.closeTo(0., error)
    );
}