Package org.geotools.referencing.operation.matrix

Examples of org.geotools.referencing.operation.matrix.Matrix2


    /**
     * Tests matrix inversion and multiplication using {@link Matrix2}.
     */
    @Test
    public void testMatrix2() {
        final Matrix2 m = new Matrix2();
        assertTrue(m.isAffine());
        assertTrue(m.isIdentity());
        final Random random = new Random(8447482612423035360L);
        final GeneralMatrix identity = new GeneralMatrix(2);
        for (int i=0; i<100; i++) {
            m.setElement(0,0, 100*random.nextDouble());
            m.setElement(0,1, 100*random.nextDouble());
            m.setElement(1,0, 100*random.nextDouble());
            m.setElement(1,1, 100*random.nextDouble());
            final Matrix2 original = m.clone();
            final GeneralMatrix check = new GeneralMatrix(m);
            m.invert();
            check.invert();
            assertTrue(check.equals(m, 1E-9));
            m.multiply(original);
View Full Code Here


    /**
     * Gets the derivative of this transform at a point. For an affine transform,
     * the derivative is the same everywhere.
     */
    public Matrix derivative(final Point2D point) {
        return new Matrix2(getScaleX(), getShearX(),
                           getShearY(), getScaleY());
    }
View Full Code Here

    /**
     * Returns this transform as an affine transform matrix.
     */
    public Matrix getMatrix() {
        return new Matrix2(scale, offset, 0, 1);
    }
View Full Code Here

     */
    @Override
    public Matrix derivative(final Point2D point) {
        final AffineTransform tr = new AffineTransform();
        getAffineTransform(point.getX(), point.getY(), tr);
        return new Matrix2(tr.getScaleX(), tr.getShearX(),
                           tr.getShearY(), tr.getScaleY());
    }
View Full Code Here

TOP

Related Classes of org.geotools.referencing.operation.matrix.Matrix2

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.