Class LinearTransform1D

    • Field Detail

      • scale

        public final double scale
        The value which is multiplied to input values.
      • offset

        public final double offset
        The value to add to input values.
    • Constructor Detail

      • LinearTransform1D

        protected LinearTransform1D​(double scale,
                                    double offset)
        Constructs a new linear transform. This constructor is provided for subclasses only. Instances should be created using the factory method, which may returns optimized implementations for some particular argument values.
        Parameters:
        scale - The scale term in the linear equation.
        offset - The offset term in the linear equation.
    • Method Detail

      • create

        public static LinearTransform1D create​(double scale,
                                               double offset)
        Constructs a new linear transform.
        Parameters:
        scale - The scale term in the linear equation.
        offset - The offset term in the linear equation.
      • getParameterValues

        public ParameterValueGroup getParameterValues()
        Returns the matrix elements as a group of parameters values. The number of parameters depends on the matrix size. Only matrix elements different from their default value will be included in this group.
        Overrides:
        getParameterValues in class AbstractMathTransform
        Returns:
        A copy of the parameter values for this math transform.
        See Also:
        Operation.getParameterValues()
      • getMatrix

        public Matrix getMatrix()
        Returns this transform as an affine transform matrix.
        Specified by:
        getMatrix in interface LinearTransform
        Returns:
        A copy of the underlying matrix.
      • isIdentity

        public boolean isIdentity()
        Tests whether this transform does not move any points.
        Specified by:
        isIdentity in interface MathTransform
        Overrides:
        isIdentity in class AbstractMathTransform
        Returns:
        true if this MathTransform is an identity transform; false otherwise.
      • isIdentity

        public boolean isIdentity​(double tolerance)
        Tests whether this transform does not move any points by using the provided tolerance. This method work in the same way than XMatrix.isIdentity(double).
        Specified by:
        isIdentity in interface LinearTransform
        Parameters:
        tolerance - The tolerance factor.
        Returns:
        true if this transform is the identity one
        Since:
        2.3.1
      • derivative

        public double derivative​(double value)
        Gets the derivative of this function at a value.
        Specified by:
        derivative in interface MathTransform1D
        Parameters:
        value - The value where to evaluate the derivative.
        Returns:
        The derivative at the specified point.
      • transform

        public double transform​(double value)
        Transforms the specified value.
        Specified by:
        transform in interface MathTransform1D
        Parameters:
        value - The value to transform.
        Returns:
        the transformed value.
      • transform

        public void transform​(float[] srcPts,
                              int srcOff,
                              float[] dstPts,
                              int dstOff,
                              int numPts)
        Transforms a list of coordinate point ordinal values.
        Specified by:
        transform in interface MathTransform
        Overrides:
        transform in class AbstractMathTransform
        Parameters:
        srcPts - the array containing the source point coordinates.
        srcOff - the offset to the first point to be transformed in the source array.
        dstPts - the array into which the transformed point coordinates are returned. May be the same than srcPts.
        dstOff - the offset to the location of the first transformed point that is stored in the destination array.
        numPts - the number of point objects to be transformed.
      • transform

        public void transform​(double[] srcPts,
                              int srcOff,
                              double[] dstPts,
                              int dstOff,
                              int numPts)
        Transforms a list of coordinate point ordinal values.
        Specified by:
        transform in interface MathTransform
        Parameters:
        srcPts - the array containing the source point coordinates.
        srcOff - the offset to the first point to be transformed in the source array.
        dstPts - the array into which the transformed point coordinates are returned. May be the same than srcPts.
        dstOff - the offset to the location of the first transformed point that is stored in the destination array.
        numPts - the number of point objects to be transformed.
      • hashCode

        public int hashCode()
        Returns a hash value for this transform. This value need not remain consistent between different implementations of the same class.
        Overrides:
        hashCode in class AbstractMathTransform
      • equals

        public boolean equals​(Object object)
        Compares the specified object with this math transform for equality.
        Overrides:
        equals in class AbstractMathTransform
        Parameters:
        object - The object to compare with this transform.
        Returns:
        true if the given object is a transform of the same class and if, given identical source position, the transformed position would be the equals.