R/Class-AffineTransformation.R

### AffineTransformation class ###
## Affine transformations can be written as:
##      x' = ax + by + c
##      y' = dx + ey + f
setClass("AffineTransformation",
	representation(),
	contains = "Cartesian2DCoordinateTransformation",
	validity = function(object) {
		if (length(object@parameters) == 0){
			if (nrow(object@controlPoints) < 3)
				stop("At least 3 control points (rows in the data.frame 'controlPoints') are required for the affine transformation")
		}
		else if (length(object@parameters) != 6){ 
			stop("Affine transformations require 6 parameters!")
		}
		return(TRUE)
	}
)

Try the vec2dtransf package in your browser

Any scripts or data that you put into this service are public.

vec2dtransf documentation built on Aug. 23, 2023, 5:07 p.m.