Interface InvertibleTransform<T extends InvertibleTransform>

All Superinterfaces:
Serializable
All Known Subinterfaces:
Affine<T>, Homography<T>, SpecialEuclidean<T>
All Known Implementing Classes:
Affine2D_F32, Affine2D_F64, Homography2D_F32, Homography2D_F64, Se2_F32, Se2_F64, Se3_F32, Se3_F64, So3_F32, So3_F64

public interface InvertibleTransform<T extends InvertibleTransform> extends Serializable

Any transform which has an unique inverse. T(u) = v and u = T-1(v).

Functions are provided to determining the dimensionality of the transform, inverting the transform, and concating two transforms.

Design Note: A function to apply the transform has not been provided to any data structures (e.g. GeoTuple). Instead that has been pushed off onto specialized static functions in other classes due to the large number of needed functions.

  • Method Summary

    Modifier and Type
    Method
    Description
    concat(T second, T result)
    Computes a transform which is the equivalent to applying 'this' then the 'second' transform.
    default T
    concatInvert(T second, T result)
    Computes a transform that's equivalent to 'this.concat(second.invert(null), result)'.
    Creates a new instance of the same SpecialEuclidean as this class.
    int
    Returns the dimension of the space which this transform operates on.
    invert(T inverse)
    Computes a transform which is the inverse of this transform.
    default T
    invertConcat(T second, T result)
    Computes a transform that's equivalent to 'invert(null).concat(second, result)'.
    void
    Sets the transform to its initial state of no transform.
    setTo(T target)
    Assigns 'this' to the value of target.
  • Method Details

    • getDimension

      int getDimension()
      Returns the dimension of the space which this transform operates on.
      Returns:
      space's dimension
    • createInstance

      T createInstance()
      Creates a new instance of the same SpecialEuclidean as this class.
      Returns:
      A new instance.
    • setTo

      T setTo(T target)
      Assigns 'this' to the value of target.
      Parameters:
      target - The new value of 'this'.
      Returns:
      A reference to 'this' to enable chaining
    • concat

      T concat(T second, @Nullable T result)

      Computes a transform which is the equivalent to applying 'this' then the 'second' transform.

      For example:

      Point A = tran2( tran1( A ) );
      Point A = tran12( A );

      where tran12 = tran1.concat( tran2 , null );

      NOTE: 'second', 'result', and 'this' must all be unique instances.

      Parameters:
      second - The second transform which is applied. Not modified.
      result - A transform which is equivalent to applying the first then the second. If null then a new instance is declared. Modified.
      Returns:
      The equivalent transform.
    • invert

      T invert(@Nullable T inverse)

      Computes a transform which is the inverse of this transform. The 'this' matrix can be passed in as an input.

      Example:
      Point A = tran(B);
      Point B = inv(A);

      where inv = invert( tran );

      Parameters:
      inverse - Where the inverse will be stored. If null a new instance is created. Modified.
      Returns:
      The inverse transform.
    • invertConcat

      default T invertConcat(T second, @Nullable T result)
      Computes a transform that's equivalent to 'invert(null).concat(second, result)'. The advantage of using this function is that it might have been implemented so that the inversion is implicit, which can result in no memory creation and more stable numerics.
      Parameters:
      second - The second transform which is applied. Not modified.
      result - (Output) storage for rsulting transform. Can be null
      Returns:
      The computed transform. If result isn't null then result is returned.
    • concatInvert

      default T concatInvert(T second, @Nullable T result)
      Computes a transform that's equivalent to 'this.concat(second.invert(null), result)'. The advantage of using this function is that it might have been implemented so that the inversion is implicit, which can result in no memory creation and more stable numerics.
      Parameters:
      second - The second transform which is applied. Not modified.
      result - (Output) storage for rsulting transform. Can be null
      Returns:
      The computed transform. If result isn't null then result is returned.
    • reset

      void reset()
      Sets the transform to its initial state of no transform.