Search in sources :

Example 26 with AffineTransformation

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

the class AffineTransformationTest method testCompose1.

public void testCompose1() {
    final AffineTransformation t0 = AffineTransformation.translationInstance(10, 0);
    t0.rotate(Math.PI / 2);
    t0.translate(0, -10);
    final AffineTransformation t1 = AffineTransformation.translationInstance(0, 0);
    t1.rotate(Math.PI / 2);
    checkTransformation(t0, t1);
}
Also used : AffineTransformation(com.revolsys.geometry.model.util.AffineTransformation)

Example 27 with AffineTransformation

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

the class AffineTransformationTest method testTranslate1.

public void testTranslate1() throws IOException, ParseException {
    final AffineTransformation t = AffineTransformation.translationInstance(2, 3);
    checkTransformation(1, 0, t, 3, 3);
    checkTransformation(0, 0, t, 2, 3);
    checkTransformation(-10, -5, t, -8, -2);
}
Also used : AffineTransformation(com.revolsys.geometry.model.util.AffineTransformation)

Example 28 with AffineTransformation

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

the class AffineTransformationTest method testScale1.

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

Example 29 with AffineTransformation

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

the class AffineTransformationTest method testRotateAroundPoint1.

public void testRotateAroundPoint1() throws IOException, ParseException {
    final AffineTransformation t = AffineTransformation.rotationInstance(Math.PI / 2, 1, 1);
    checkTransformation(1, 1, t, 1, 1);
    checkTransformation(10, 0, t, 2, 10);
    checkTransformation(0, 10, t, -8, 0);
    checkTransformation(-10, -10, t, 12, -10);
}
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