createFromControlVectorsCL static method

AffineTransformation? createFromControlVectorsCL(
  1. List<Coordinate?> src,
  2. List<Coordinate?> dest
)
  • Creates an AffineTransformation defined by a set of control vectors.
    • Between one and three vectors must be supplied. *
      • @param src
      •      the source points of the vectors
        
      • @param dest
      •      the destination points of the vectors
        
      • @return the computed transformation
      • @throws IllegalArgumentException
      •       if the control vector arrays are too short, long or of different
        
      •       lengths
        

Implementation

static AffineTransformation? createFromControlVectorsCL(
    List<Coordinate?> src, List<Coordinate?> dest) {
  if (src.length != dest.length)
    throw ArgumentError("Src and Dest arrays are not the same length");
  if (src.length <= 0) throw ArgumentError("Too few control points");
  if (src.length > 3) throw ArgumentError("Too many control points");

  if (src.length == 1) return createFromControlVectors(src[0], dest[0]);
  if (src.length == 2)
    return createFromControlVectors2(src[0]!, src[1]!, dest[0]!, dest[1]!);

  return createFromControlVectors3(
      src[0]!, src[1]!, src[2]!, dest[0]!, dest[1]!, dest[2]!);
}