({{, (RefLink[TransformationFunction, paclet:ref/TransformationFunction])[data] 
represents a transformation function that applies geometric and other transformations.}})

OpenersNotesSection(Spacer1)Details

(RefLink[TransformationFunction, paclet:ref/TransformationFunction])[…] objects are generated by constructors such as (RefLink[TranslationTransform, paclet:ref/TranslationTransform]), (RefLink[RotationTransform, paclet:ref/RotationTransform]), etc.

(RefLink[TransformationFunction, paclet:ref/TransformationFunction])[…][x] applies the transformation function to a vector x, returning a transformed vector.

(RefLink[TransformationFunction, paclet:ref/TransformationFunction])[…][{(Subscript[x, 1]),(Subscript[x, 2]),…}] for a list of vectors applies the transformation to each vector (Subscript[x, i]), producing a list of transformed vectors.

(RefLink[TransformationFunction, paclet:ref/TransformationFunction]) works with both numerical and symbolic vectors and represents a linear fractional transformation ((A.x+b)/(c.x+d)), where A∈(RefLink[Matrices, paclet:ref/Matrices])[{m,n}], b∈(RefLink[Matrices, paclet:ref/Matrices])[{m,1}], c∈(RefLink[Matrices, paclet:ref/Matrices])[{1,n}] and d∈(RefLink[Matrices, paclet:ref/Matrices])[{1,1}].

For smaller dimensions, it is typically displayed as an (m+1) ×(n+1) transformation matrix (({{A, b}, {c, d}})). (RefLink[TransformationMatrix, paclet:ref/TransformationMatrix]) can be used to extract the transformation matrix.

(RefLink[Composition, paclet:ref/Composition])[(Subscript[t, 1]),(Subscript[t, 2])] where (Subscript[t, i]) has transformation matrix (({{(Subscript[A, i]), (Subscript[b, i])}, {(Subscript[c, i]), (Subscript[d, i])}})) gives a new (RefLink[TransformationFunction, paclet:ref/TransformationFunction]) object with transformation matrix (({{(Subscript[A, 1]).(Subscript[A, 2])+(Subscript[b, 1]).(Subscript[c, 2]), (Subscript[A, 1]).(Subscript[b, 2])+(Subscript[b, 1]).(Subscript[d, 2])}, {(Subscript[c, 1]).(Subscript[A, 2])+(Subscript[d, 1]).(Subscript[c, 2]), (Subscript[c, 1]).(Subscript[b, 2])+(Subscript[d, 1]).(Subscript[d, 2])}})).

(RefLink[InverseFunction, paclet:ref/InverseFunction])[t] where t has transformation matrix (({{A, b}, {c, d}})) gives a new (RefLink[TransformationFunction, paclet:ref/TransformationFunction]) object with transformation matrix (1/(d-c.(A^(-1)).b))(({{(d-c.(A^(-1)).b).(A^(-1))+(A^(-1)).b.c.(A^(-1)), -(A^(-1)).b}, {-c.(A^(-1)), 1}})) where (A^(-1)) is the matrix inverse.

(RefLink[GeometricTransformation, paclet:ref/GeometricTransformation]) can be used to represent the effect of applying a (RefLink[TransformationFunction, paclet:ref/TransformationFunction]) object to geometrical or graphics objects when restricted to affine transformations.

(RefLink[TransformationFunction, paclet:ref/TransformationFunction])[…][prop] gives the transformation property prop. For a transformation function with transformation matrix (({{A, b}, {c, d}})), properties include:

OpenersPrimaryExamplesSection(Spacer1)Examples  (19)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Create a rotation transform:

r=RotationTransform[θ]

This rotates the vector {x,y} by angle θ:

r[{x,y}]

OpenersExampleSection1(Spacer1)Scope  (15)

OpenersExampleSubsection0(Spacer1)Constructing TransformationFunction  (10)

A translation by the vector {qx,qy,qz}:

t=TranslationTransform[{qx,qy,qz}]

t[{x,y,z}]

A rotation around the z axis:

r=RotationTransform[θ,{0,0,1}]

r[{x,y,z}]

Scaling along the coordinate axes:

ScalingTransform[{sx,sy}]

Shearing in the x direction by an angle θ:

ShearingTransform[θ,{1,0}, {0,1}]

Reflecting in the x-y plane:

ReflectionTransform[{0,0,1}]

Rescaling the box [xmin, xmax]×[ymin, ymax] to the unit square:

RescalingTransform[{{xmin,xmax}, {ymin,ymax}}]

A general (RefLink[TransformationFunction, paclet:ref/TransformationFunction]):

t=LinearFractionalTransform[{{1,2,3}, {4,5,6},{7,8,9}}]

t[{x,y}]

A linear transformation:

tl=LinearFractionalTransform[{ Array[(Subscript[a, #1,#2])&,{2,2}] }]

tl[{x,y}]

An affine transformation:

ta=LinearFractionalTransform[{ Array[(Subscript[a, #1,#2])&,{2,2}], Array[(Subscript[b, #])&,{2}] }]

ta[{x,y}]

A linear fractional transformation:

tlft=LinearFractionalTransform[{Array[(Subscript[a, #1,#2])&,{2,2}], Array[(Subscript[b, #])&,{2}],Array[(Subscript[c, #])&,{2}]}]

tlft[{x,y}]

OpenersExampleSubsection1(Spacer1)Working with TransformationFunction as a Function  (4)

Here t is a rotation of π/3 around the z axis:

t=RotationTransform[π/3.,{0,0,1}]

This transforms the x axis:

t[{1,0,0}]

This transforms a list of vectors:

vl=RandomReal[1,{10,3}];

t[vl]

Composing two transformations:

t1=RotationTransform[θ]

t2=RotationTransform[ϕ]

Composition[t1,t2]//Simplify

Computing the inverse:

t=RotationTransform[θ]

it=InverseFunction[t]//Simplify

This shows they are inverses:

Composition[it,t]//Simplify

Computing the partial derivative (∂_x)((∂_y)^2)f[x,y]:

f=TransformationFunction[{{1,2,3}, {4,5,6}, {7,8,9}}]

Derivative[{1,2}][f]

OpenersExampleSubsection2(Spacer1)Working with TransformationFunction as a Formula  (1)

This defines a general transform:

t=LinearFractionalTransform[{ {{1,2},{3,4}}, {1,2}, {3,1} }]

This is the corresponding formula:

f=t[{x,y}]

A derivative:

D[f,{x,2}]

A limit:

Limit[f,x->1]

An integral:

Integrate[f,x]

A plot:

Plot3D[f,{x,-1,1},{y,-1,1},PlotStyle->{Red,Green},Exclusions->{1+3x+y==0}]

OpenersExampleSection3(Spacer1)Applications  (2)

(RefLink[TransformationFunction, paclet:ref/TransformationFunction]) can be used as an argument to (RefLink[GeometricTransformation, paclet:ref/GeometricTransformation]):

t=AffineTransform[{DiagonalMatrix[{2,2,1}],{1,1,1}}]

Graphics3D[GeometricTransformation[Cylinder[],t],Axes->True]

Integrate a function over a rhombic region:

Integrate[(x^3+y^3)Boole[x/2<y<x/2+3/4&&y/2<x<y/2+3/4],{x,0,3/2},{y,0,3/2}]

t defines a change of variables that maps the unit square to the integration region:

t=AffineTransform[{{1,1/2},{1/2,1}}]

The integrand in the new coordinates:

fuv=x^3+y^3/.Thread[{x,y}->t[{u,v}]]

The Jacobian:

jac=Det[TransformationMatrix[t]]

Integrate[fuv Abs[jac],{u,0,1},{v,0,1}]

OpenersExampleSection4(Spacer1)Properties & Relations  (1)

Find the n(^th) power of a transformation:

t=LinearFractionalTransform[{{-3,2,1},{0,1,1},{4,-2,-4}}]

tt[n_]:=LinearFractionalTransform[MatrixPower[TransformationMatrix[t],n]]

Apply t five times:

Nest[Together@t@#&,{x0,y0},5]

Apply tt[5]:

tt[5][{x0,y0}]

%==%%//Simplify

Find the n(^th) iteration using (RefLink[RSolve, paclet:ref/RSolve]):

RSolve[Thread/@{{x[n+1],y[n+1]}==t[{x[n],y[n]}],{x[0],y[0]}=={x0,y0}},{x,y},n]

{x[5],y[5]}/.%[[1]]//Simplify

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[TransformationMatrix, paclet:ref/TransformationMatrix])  ▪  (RefLink[GeometricTransformation, paclet:ref/GeometricTransformation])  ▪  (RefLink[AffineTransform, paclet:ref/AffineTransform])  ▪  (RefLink[RotationTransform, paclet:ref/RotationTransform])  ▪  (RefLink[TranslationTransform, paclet:ref/TranslationTransform])  ▪  (RefLink[ScalingTransform, paclet:ref/ScalingTransform])  ▪  (RefLink[FindGeometricTransform, paclet:ref/FindGeometricTransform])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Geometric Transforms, paclet:guide/GeometricTransforms])}})}})