Search in sources :

Example 6 with AffineTransformation

use of com.revolsys.geometry.model.util.AffineTransformation in project com.revolsys.open by revolsys.

the class AffineTransformationTest method testTranslateRotate1.

public void testTranslateRotate1() throws IOException, ParseException {
    final AffineTransformation t = AffineTransformation.translationInstance(3, 3).rotate(Math.PI / 2);
    checkTransformation(10, 0, t, -3, 13);
    checkTransformation(-10, -10, t, 7, -7);
}
Also used : AffineTransformation(com.revolsys.geometry.model.util.AffineTransformation)

Example 7 with AffineTransformation

use of com.revolsys.geometry.model.util.AffineTransformation in project com.revolsys.open by revolsys.

the class AffineTransformationTest method testComposeRotation1.

public void testComposeRotation1() {
    final AffineTransformation t0 = AffineTransformation.rotationInstance(1, 10, 10);
    final AffineTransformation t1 = AffineTransformation.translationInstance(-10, -10);
    t1.rotate(1);
    t1.translate(10, 10);
    checkTransformation(t0, t1);
}
Also used : AffineTransformation(com.revolsys.geometry.model.util.AffineTransformation)

Example 8 with AffineTransformation

use of com.revolsys.geometry.model.util.AffineTransformation in project com.revolsys.open by revolsys.

the class AffineTransformationTest method testShear1.

public void testShear1() throws IOException, ParseException {
    final AffineTransformation t = AffineTransformation.shearInstance(2, 3);
    checkTransformation(10, 0, t, 10, 30);
}
Also used : AffineTransformation(com.revolsys.geometry.model.util.AffineTransformation)

Example 9 with AffineTransformation

use of com.revolsys.geometry.model.util.AffineTransformation in project com.revolsys.open by revolsys.

the class AffineTransformationTest method testRotate1.

public void testRotate1() throws IOException, ParseException {
    final AffineTransformation t = AffineTransformation.rotationInstance(Math.PI / 2);
    checkTransformation(10, 0, t, 0, 10);
    checkTransformation(0, 10, t, -10, 0);
    checkTransformation(-10, -10, t, 10, -10);
}
Also used : AffineTransformation(com.revolsys.geometry.model.util.AffineTransformation)

Example 10 with AffineTransformation

use of com.revolsys.geometry.model.util.AffineTransformation in project com.revolsys.open by revolsys.

the class AffineTransformationTest method testReflectXY2.

public void testReflectXY2() throws IOException, ParseException {
    final AffineTransformation t = AffineTransformation.reflectionInstance(1, -1);
    checkTransformation(10, 0, t, 0, -10);
    checkTransformation(0, 10, t, -10, 0);
    checkTransformation(-10, -10, t, 10, 10);
    checkTransformation(-3, -4, t, 4, 3);
}
Also used : AffineTransformation(com.revolsys.geometry.model.util.AffineTransformation)

Aggregations

AffineTransformation (com.revolsys.geometry.model.util.AffineTransformation)29 Point (com.revolsys.geometry.model.Point)13 PointDoubleXY (com.revolsys.geometry.model.impl.PointDoubleXY)4 AffineTransformationBuilder (com.revolsys.geometry.model.util.AffineTransformationBuilder)3 Geometry (com.revolsys.geometry.model.Geometry)2 BoundingBox (com.revolsys.geometry.model.BoundingBox)1 NoninvertibleTransformationException (com.revolsys.geometry.model.util.NoninvertibleTransformationException)1