({{, (RefLink[ReflectionMatrix, paclet:ref/ReflectionMatrix])[v] 
gives the matrix that represents reflection of points in a mirror normal to the vector v.}})

OpenersNotesSection(Spacer1)Details

The reflection is in a mirror that goes through the origin.

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

OpenersPrimaryExamplesSection(Spacer1)Examples  (12)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Reflect along the x axis, or equivalently reflect in the y axis:

ReflectionMatrix[{1,0}]//MatrixForm

%.{1,0}

Reflect along the vector (1,1,1) or equivalently in the plane given by (1,1,1).p==0:

ReflectionMatrix[{1,1,1}]//MatrixForm

OpenersExampleSection1(Spacer1)Scope  (4)

Reflect along the vector (1,1,1,1) or equivalently in the plane given by (1,1,1,1).p==0:

r=ReflectionMatrix[{1,1,1,1}]

Points in the reflection plane remain fixed:

r.{1,-1,0,0}

Points outside the reflection plane get reflected in the plane:

r.{1,1,1,1}

Reflection matrix for symbolic unit vector {u,v}:

Simplify[ReflectionMatrix[{u,v}],Element[{u,v},Reals]&&u^2+v^2==1]//MatrixForm

Vectors normal to {u,v} remain unchanged:

%.Cross[{u,v}]==Cross[{u,v}]//Simplify[#,u^2+v^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},ReflectionMatrix[{2,1}]]}]

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},ReflectionMatrix[{2,1,0}]]},Boxed->False]

OpenersExampleSection3(Spacer1)Applications  (1)

Flipping a surface:

g=Plot3D[x^2+y^2,{x,-1,1},{y,-1,1},PlotRange->All];

{g,g/.gc_GraphicsComplex:>GeometricTransformation[gc,ReflectionMatrix[{0,0,1}]]}

OpenersExampleSection4(Spacer1)Properties & Relations  (3)

The determinant of a reflection matrix is -1:

Det[ ReflectionMatrix[{1,1,1}]]

The inverse of a reflection matrix is the matrix itself:

ReflectionMatrix[{1,1,1}].ReflectionMatrix[{1,1,1}]

Reflection can be thought of as a special case of scaling:

ReflectionMatrix[{1,1,1}]==ScalingMatrix[-1,{1,1,1}]

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)

Reflections of a cuboid in vertical planes:

Graphics3D[Table[GeometricTransformation[Cuboid[{2,2,2}],ReflectionMatrix[{Cos[a],Sin[a],0}]],{a,0,15Pi/16,Pi/16}],Boxed->False]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[ReflectionTransform, paclet:ref/ReflectionTransform])  ▪  (RefLink[RotationMatrix, paclet:ref/RotationMatrix])}})}})

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