Skip to content

GeometricTransformation

Draw graphics mapped through an affine transformation.

The second argument may be a TransformationFunction, which is normalized to the {matrix, vector} pair of the affine map p ↦ matrix.p + vector.

$ wo 'GeometricTransformation[Line[{{0, 0}, {2, 0}}], ReflectionTransform[{-1, 1}]]'
GeometricTransformation[Line[{{0, 0}, {2, 0}}], {{{0, 1}, {1, 0}}, {0, 0}}]

Inside a Graphics, the enclosed primitives are drawn transformed. Reflecting in the line y = x swaps the coordinates of every point, which is how the graph of a function's inverse is drawn from the graph of the function.

$ wo 'ExportString[Graphics[GeometricTransformation[Line[{{0, 0}, {2, 0}}], ReflectionTransform[{-1, 1}]], PlotRange -> {{-1, 3}, {-1, 3}}], "SVG"] // StringContainsQ[#, "90.00,270.00 90.00,90.00"] &'
True