/** * Returns a linear transform with the supplied scale and offset values. * * @param scale The scale factor. May be 0 for a constant transform. * @param offset The offset value. May be NaN. */ public static MathTransformation createLinearTransform1D(final double scale, final double offset) { return SingleDimensionTransformation.create(scale, offset); }
/** * Returns a linear transform with the supplied scale and offset values. * * @param scale The scale factor. May be 0 for a constant transform. * @param offset The offset value. May be NaN. */ public static MathTransformation createLinearTransform1D(final double scale, final double offset) { return SingleDimensionTransformation.create(scale, offset); }
public MathTransformation inverseTransform() { if (inverse == null) { if (isIdentity()) { inverse = this; } else if (scale != 0) { final SingleDimensionTransformation inverse; inverse = create(1 / scale, -offset / scale); inverse.inverse = this; this.inverse = inverse; } else { throw new UnsupportedOperationException("Unable to invert such transformation"); } } return inverse; }
public MathTransformation inverseTransform() { if (inverse == null) { if (isIdentity()) { inverse = this; } else if (scale != 0) { final SingleDimensionTransformation inverse; inverse = create(1 / scale, -offset / scale); inverse.inverse = this; this.inverse = inverse; } else { throw new UnsupportedOperationException("Unable to invert such transformation"); } } return inverse; }
/** * The transformation we are specifying here is not always invertible, well, to be honest, strictly speaking it never really is. However when the * underlying transformation is a 1:1 mapping we can invert it. */ public MathTransformation inverse() throws NoninvertibleTransformException { if (this.getInputMinimum() == getInputMaximum()) return SingleDimensionTransformation.create(0, getInputMinimum()); throw new UnsupportedOperationException( "Inverse operation is unsupported for Constant Transform"); }
/** * The transformation we are specifying here is not always invertible, well, to be honest, strictly speaking it never really is. However when the * underlying transformation is a 1:1 mapping we can invert it. */ public MathTransformation inverse() throws NoninvertibleTransformException { if (this.getInputMinimum() == getInputMaximum()) return SingleDimensionTransformation.create(0, getInputMinimum()); throw new UnsupportedOperationException( "Inverse operation is unsupported for Constant Transform"); }
setTransform(SingleDimensionTransformation.create(0, outputMinimum)); setInverse(SingleDimensionTransformation.create(outputMinimum, 0)); return; } else if (Math.abs(scale) < 1E-6) if (PiecewiseUtilities.compare(getInputMaximum(), getInputMinimum()) == 0) setInverse(SingleDimensionTransformation.create(0, getInputMinimum())); else setInverse(null);
setTransform(SingleDimensionTransformation.create(0, outputMinimum)); setInverse(SingleDimensionTransformation.create(outputMinimum, 0)); return; } else if (Math.abs(scale) < 1E-6) if (PiecewiseUtilities.compare(getInputMaximum(), getInputMinimum()) == 0) setInverse(SingleDimensionTransformation.create(0, getInputMinimum())); else setInverse(null);
return SingleDimensionTransformation.create(0, minDestination);
return SingleDimensionTransformation.create(0, minDestination);