Wolfram: Apply Transform to Graphics
Apply Geometric Transform to Graphics
GeometricTransformation[graPrims, f]
-
applies f to graPrims.
graPrims should be Graphics Primitives , not
f is typicallyGraphics
object.TransformationFunction[data]
. 〔see Geometric Transformation Functions〕It can be a
matrix
.It can be a
{matrix, vector}
, where the vector is used for translation. 〔see Transformation Matrix〕GeometricTransformation[angs]
return itself unchanged. It display effect when it is insideGraphics
orGraphics3D
. GeometricTransformation[graPrims, listOfTransforms]
-
do copy of multiple transformations.
Example: Basic

(* GeometricTransformation first arg should be graphics primitive or list of *) GeometricTransformation[ {Circle[], Rectangle[{0, 0}]} , RotationTransform[ 10 Degree ] ] (* result is itself, unchanged. *) (* has effect when it in inside Graphics or Graph3D *) Graphics[ GeometricTransformation[ {Circle[], Rectangle[{0, 0}]} , RotationTransform[ 10 Degree ] ], Axes -> True]
Example: Using a Matrix

(* rotate a rectangle *) Graphics[ GeometricTransformation[ {Rectangle[{0, 0}]} , RotationMatrix[ 10 Degree ] ], Axes -> True ]
Example: Using a Matrix and a Vector
(* transform by a matrix, and translate by a vector *) Graphics[ GeometricTransformation[ {Rectangle[{0, 0}]} , {RotationMatrix[ 10 Degree ], {1,1}} ], Axes -> True ]

Example: Error If Not on Graphics Primitive
(* if GeometricTransformation's args is Graphics[...], no transform is done. *) result = GeometricTransformation[ Graphics[{Rectangle[{0, 0}]}], RotationTransform[ 10 Degree ] ] (* if you show result inside Graphics[...], it's an error. *) Show[ result ]

WolframLang, Graphics Programing
- Wolfram: Graphics Programing Index
- Wolfram: Plot and Visualization
- Wolfram: Graphics Primitives
- Wolfram: Graphics Directives
- Wolfram: Extract Graphics from Plot
- Wolfram: Geometric Transformation Functions
- Wolfram: Apply Transform to Graphics
- Wolfram: Compose Transformations
- Wolfram: Translate Copy Graphics
- Wolfram: Transformation Matrix
- Wolfram: GraphicsComplex
- Wolfram: Mesh Region
- Wolfram: Graphics Misc
- Wolfram: Animation