use of com.revolsys.geometry.model.util.AffineTransformationBuilder in project com.revolsys.open by revolsys.
the class AffineTransformationBuilderTest method run.
void run(final double p0x, final double p0y, final double p1x, final double p1y, final double p2x, final double p2y, final double pp0x, final double pp0y, final double pp1x, final double pp1y, final double pp2x, final double pp2y) {
final Point p0 = new PointDoubleXY(p0x, p0y);
final Point p1 = new PointDoubleXY(p1x, p1y);
final Point p2 = new PointDoubleXY(p2x, p2y);
final Point pp0 = new PointDoubleXY(pp0x, pp0y);
final Point pp1 = new PointDoubleXY(pp1x, pp1y);
final Point pp2 = new PointDoubleXY(pp2x, pp2y);
final AffineTransformationBuilder atb = new AffineTransformationBuilder(p0, p1, p2, pp0, pp1, pp2);
final AffineTransformation trans = atb.getTransformation();
assertEqualPoint(pp0, trans.transform(p0));
assertEqualPoint(pp1, trans.transform(p1));
assertEqualPoint(pp2, trans.transform(p2));
}
use of com.revolsys.geometry.model.util.AffineTransformationBuilder in project com.revolsys.open by revolsys.
the class AffineTransformationBuilderTest method runSingular.
void runSingular(final double p0x, final double p0y, final double p1x, final double p1y, final double p2x, final double p2y, final double pp0x, final double pp0y, final double pp1x, final double pp1y, final double pp2x, final double pp2y) {
final Point p0 = new PointDoubleXY(p0x, p0y);
final Point p1 = new PointDoubleXY(p1x, p1y);
final Point p2 = new PointDoubleXY(p2x, p2y);
final Point pp0 = new PointDoubleXY(pp0x, pp0y);
final Point pp1 = new PointDoubleXY(pp1x, pp1y);
final Point pp2 = new PointDoubleXY(pp2x, pp2y);
final AffineTransformationBuilder atb = new AffineTransformationBuilder(p0, p1, p2, pp0, pp1, pp2);
final AffineTransformation trans = atb.getTransformation();
assertEquals(trans, null);
}
use of com.revolsys.geometry.model.util.AffineTransformationBuilder in project com.revolsys.open by revolsys.
the class AffineTransformationBuilderTest method runTransform.
private void runTransform(final AffineTransformation trans, final Point p0, final Point p1, final Point p2) {
final Point pp0 = trans.transform(p0);
final Point pp1 = trans.transform(p1);
final Point pp2 = trans.transform(p2);
final AffineTransformationBuilder atb = new AffineTransformationBuilder(p0, p1, p2, pp0, pp1, pp2);
final AffineTransformation atbTrans = atb.getTransformation();
assertEqualPoint(pp0, atbTrans.transform(p0));
assertEqualPoint(pp1, atbTrans.transform(p1));
assertEqualPoint(pp2, atbTrans.transform(p2));
}
Aggregations