Wolfram Research

Function Repository Resource:

ReflectPoints

Source Notebook

Reflect a set of points using a line or plane defined by two or three points

Contributed by: Wolfram Staff

ResourceFunction["ReflectPoints"][mirror,pts]

reflects pts across mirror.

Details and Options

ReflectPoints works on 2D and 3D.

Examples

Basic Examples

Reflect points about a given line:

In[1]:=
mirror2 = {{3, 2}, {2, -1}};
pts2 = Subsets[Range[0, 4], {2}];
In[2]:=
ResourceFunction["ReflectPoints"][mirror2, pts2]
Out[2]=
In[3]:=
Graphics[{Point /@ pts2, Green, InfiniteLine[mirror2], Red, Point /@ ResourceFunction["ReflectPoints"][mirror2, pts2]}]
Out[3]=

Reflect points about a given plane:

In[4]:=
mirror3 = {{3, 2, 0}, {2, -1, 0}, {1, 1, 1}};
pts3 = Subsets[Range[0, 4], {3}];
In[5]:=
ResourceFunction["ReflectPoints"][mirror3, pts3]
Out[5]=
In[6]:=
Graphics3D[{Point /@ pts3, Green, InfinitePlane[mirror3], Red, Point /@ ResourceFunction["ReflectPoints"][mirror3, pts3]}]
Out[6]=

Requirements

Wolfram Language 11.3 (March 2018) or above

Resource History

License Information