({{, (RefLink[ReflectionTransform, paclet:ref/ReflectionTransform])[v] 
gives a (RefLink[TransformationFunction, paclet:ref/TransformationFunction]) that represents a reflection in a mirror through the origin, normal to the vector v.}, {, (RefLink[ReflectionTransform, paclet:ref/ReflectionTransform])[v,p]
gives a reflection in a mirror through the point p, normal to the vector v.}})

OpenersNotesSection(Spacer1)Details

(RefLink[ReflectionTransform, paclet:ref/ReflectionTransform]) gives a (RefLink[TransformationFunction, paclet:ref/TransformationFunction]) that can be applied to vectors.

(RefLink[ReflectionTransform, paclet:ref/ReflectionTransform]) works in any number of dimensions. In 2D it reflects in a line; in 3D it reflects in a plane.

The point p can lie anywhere in the mirror.

OpenersPrimaryExamplesSection(Spacer1)Examples  (16)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Reflection in the y==x line:

rt=ReflectionTransform[{1,-1}]

rt[{x,y}]

Reflection in the z plane:

rt=ReflectionTransform[{0,0,1}]

rt[{x,y,z}]

OpenersExampleSection1(Spacer1)Scope  (3)

Reflection transform for symbolic unit vector {u, v, w}:

rt=ReflectionTransform[{u,v,w}]//Simplify[#,{Element[{u,v,w},Reals],u^2+v^2+w^2==1}]&

Vectors normal to {u, v, w} remain unchanged:

rt[NullSpace[{{u,v,w}}]]==NullSpace[{{u,v,w}}]//Simplify[#,u^2+v^2+w^2==1]&

Transformation applied to a 2D shape:

gr={Rectangle[],AbsolutePointSize[10],Opacity[1],{Magenta,Point[{0,0}]},{Green,Point[{1,1}]}};

Graphics[{{Opacity[.35],Blue,gr},GeometricTransformation[{Opacity[.85],Red,gr},ReflectionTransform[{1,1},{-.2,-.2}]]}]

Transformation applied to a 3D shape:

gr={Cuboid[],AbsolutePointSize[10],Opacity[1],{Magenta,Point[{0,0,0}]},{Green,Point[{1,1,1}]}};

Graphics3D[{{Opacity[.35],Blue,gr},GeometricTransformation[{Opacity[.85],Red,gr},ReflectionTransform[{2,1,0},{-.1,-.1,0}]]},Boxed->False]

OpenersExampleSection3(Spacer1)Applications  (4)

Reflecting a graphic:

gr=Plot[E^x,{x,-3,2}];

Show[gr,Plot[x,{x,-3,7},PlotStyle->Black],gr/.L_Line:>{Red,GeometricTransformation[L,ReflectionTransform[{-1,1}]]},PlotRange->All]

Reflections of a sine wave:

Plot[Sin[x],{x,-2Pi,2Pi},AspectRatio->Automatic,Axes->False,PlotRange->All]/.L_Line:>Table[GeometricTransformation[L,ReflectionTransform[{Cos[u],Sin[u]}]],{u,Pi/14Range[7]}]

Mirror an image:

ImageTransformation[,ReflectionTransform[{1,0},{.5,0}]]

Reflection transform of a 3D image with respect to the x axis:

ImageTransformation[,ReflectionTransform[{1,0,0}],DataRange->{{-.5,.5},Automatic,Automatic}]

OpenersExampleSection4(Spacer1)Properties & Relations  (5)

The reflection transformation is an isometric transform, i.e. preserves distances:

t=ReflectionTransform[{1,2},{3,4}];

{p1,p2}={{10,17},{1,2}};
{tp1,tp2}=t[{p1,p2}];

EuclideanDistance[p1,p2]==EuclideanDistance[tp1,tp2]

The reflection transformation is its own inverse:

t=ReflectionTransform[{1,1,1}];

InverseFunction[t]==t

The determinant of the transformation matrix is -1:

t=ReflectionTransform[{1,2,3}];

Det[TransformationMatrix[t]]

(RefLink[ReflectionTransform, paclet:ref/ReflectionTransform]) can be represented as a scaling transform:

t=ReflectionTransform[{1,1,1}];

t==ScalingTransform[-1,{1,1,1}]

Top-bottom image reflection using (RefLink[ImageTransformation, paclet:ref/ImageTransformation]):

i=;
ImageReflect[i]==ImageTransformation[i,ReflectionTransform[{0,1}],PlotRange->All]

Reflection across the main diagonal:

ImageReflect[i,Left->Top]==ImageTransformation[i,ReflectionTransform[{1,1}],PlotRange->All]

Reflection across the main antidiagonal:

ImageReflect[i,Right->Top]==ImageTransformation[i,ReflectionTransform[{-1,1}],PlotRange->All]

OpenersExampleSection5(Spacer1)Possible Issues  (1)

Reflection changes the orientation of polygons:

gr={FaceForm[Red,Blue],Polygon[{{0,0,0},{1,0,0},{0,1,0}}]};

{Graphics3D[gr,PlotRange->{-.1,.1}],Graphics3D[GeometricTransformation[gr,ReflectionMatrix[{0,0,1}]],PlotRange->{-.1,.1}]}

OpenersExampleSection6(Spacer1)Neat Examples  (1)

Reflect a 3D object about a point p:

cow=ExampleData[{"Geometry3D","Cow"},"GraphicsComplex"];

p={0,0,-0.25161901116371155`};

Along the x axis, about the y z plane:

Graphics3D[{EdgeForm[None],Opacity[0.5],Lighter[ColorData[1,1],0.5],cow, Lighter[ColorData[1,2],0.5],GeometricTransformation[cow,ReflectionTransform[{1,0,0},p]]},Lighting->"Neutral",ImageSize->Large,Boxed->False]

Along the y axis, about the x z plane:

Graphics3D[{EdgeForm[None],Opacity[0.5],Lighter[ColorData[1,1],0.5],cow, Lighter[ColorData[1,2],0.5],GeometricTransformation[cow,ReflectionTransform[{0,1,0},p]]},Lighting->"Neutral",ImageSize->Large,Boxed->False]

Along the z axis, about the x y plane:

Graphics3D[{EdgeForm[None],Opacity[0.5],Lighter[ColorData[1,1],0.5],cow, Lighter[ColorData[1,2],0.5],GeometricTransformation[cow,ReflectionTransform[{0,0,1},p]]},Lighting->"Neutral",ImageSize->Large,Boxed->False]

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

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