/** * Creates a {@link SingleDimensionTransformation} instance based on the input scale and offset * * @param scale * @param offset * @return */ public static SingleDimensionTransformation create(double scale, double offset) { if (scale == 0) { return new ConstantTransform(offset); } if (scale == 1 && offset == 0) { return IDENTITY; } return new SingleDimensionTransformation(scale, offset); }
/** * Creates a {@link SingleDimensionTransformation} instance based on the input scale and offset * * @param scale * @param offset * @return */ public static SingleDimensionTransformation create(double scale, double offset) { if (scale == 0) { return new ConstantTransform(offset); } if (scale == 1 && offset == 0) { return IDENTITY; } return new SingleDimensionTransformation(scale, offset); }