Interface MathTransform2D

All Superinterfaces:
Math­Transform
All Known Implementing Classes:
Abstract­Math­Transform2D, Abstract­Math­Transform2D​.Inverse, Pole­Rotation

public interface MathTransform2D extends MathTransform
Transforms two-dimensional coordinate points. Coordinate­Operation​.get­Math­Transform() may returns instance of this interface when source and destination coordinate systems are both two dimensional. Math­Transform2D extends Math­Transform by adding some methods for easier inter-operability with Java2D.

If the transformation is affine, then Math­Transform shall be an immutable instance of Affine­Transform.

Since:
1.0
  • Method Details

    • transform

      Point2D transform(Point2D ptSrc, Point2D ptDst) throws TransformException
      Transforms the specified pt­Src and stores the result in pt­Dst. If pt­Dst is null, a new Point2D object is allocated and then the result of the transformation is stored in this object. In either case, pt­Dst, which contains the transformed point, is returned for convenience. If pt­Src and pt­Dst are the same object, the input point is correctly overwritten with the transformed point.
      Parameters:
      pt­Src - the coordinate point to be transformed.
      pt­Dst - the coordinate point that stores the result of transforming pt­Src, or null if a new point shall be created.
      Returns:
      the coordinate point after transforming pt­Src and storing the result in pt­Dst or in a new point if pt­Dst was null.
      Throws:
      Transform­Exception - if the point cannot be transformed.
    • createTransformedShape

      Shape createTransformedShape(Shape shape) throws TransformException
      Transforms the specified shape. This method may replace straight lines by quadratic curves when applicable. It may also do the opposite (replace curves by straight lines). The returned shape doesn't need to have the same number of points than the original shape.
      Parameters:
      shape - The Shape to transform.
      Returns:
      The transformed shape. Some implementations may returns shape unmodified if this transform is identity.
      Throws:
      Transform­Exception - if a transform failed.
    • derivative

      Matrix derivative(Point2D point) throws TransformException
      Gets the derivative of this transform at a point. The derivative is the matrix of the non-translating portion of the approximate affine map at the point.
      Parameters:
      point - The coordinate point where to evaluate the derivative. Null value is accepted only if the derivative is the same everywhere. For example affine transform accept null value since they produces identical derivative no matter the coordinate value. But most map projection will requires a non-null value.
      Returns:
      The derivative at the specified point as a 2×2 matrix. This method never returns an internal object: changing the matrix will not change the state of this math transform.
      Throws:
      Null­Pointer­Exception - if the derivative dependents on coordinate and point is null.
      Transform­Exception - if the derivative cannot be evaluated at the specified point.
    • inverse

      Creates the inverse transform of this object.
      Specified by:
      inverse in interface Math­Transform
      Returns:
      The inverse transform.
      Throws:
      Noninvertible­Transform­Exception - if the transform cannot be inverted.
      Since:
      2.2