@Test
public void calculatesRotation() {

    final Vect<Double> vecta = new DblVect(1., 0.);
    final Degrees<Double> pifourth = new Degrees.Default<>(Math.PI / 4);
    final Dot dot = new Dot();
    final Decimal field = new Decimal();
    final double error = 1.e-6;
    Scalar<Double>[] image = dot.rot(vecta, pifourth).coords();
    MatcherAssert.assertThat(
        field.actual(image[0]), Matchers.closeTo(Math.sqrt(2) / 2, error)
    );
    MatcherAssert.assertThat(
        field.actual(image[1]), Matchers.closeTo(Math.sqrt(2) / 2, error)
    );
    image = dot.rot(vecta, new Degrees.Default<>(0)).coords();
    MatcherAssert.assertThat(
        field.actual(image[0]), Matchers.closeTo(1., error)
    );
    MatcherAssert.assertThat(
        field.actual(image[1]), Matchers.closeTo(0., error)
    );
    image = dot.rot(vecta, new Degrees.Default<>(Math.PI / 2)).coords();
    MatcherAssert.assertThat(
        field.actual(image[0]), Matchers.closeTo(0., error)
    );
    MatcherAssert.assertThat(
        field.actual(image[1]), Matchers.closeTo(1., error)
    );
    image = dot.rot(vecta, new Degrees.Default<>(Math.PI)).coords();
    MatcherAssert.assertThat(
        field.actual(image[0]), Matchers.closeTo(-1., error)
    );
    MatcherAssert.assertThat(
        field.actual(image[1]), Matchers.closeTo(0., error)
    );
}