Wolfram Research

Function Repository Resource:

ReflectPoints (1.0.1) current version: 1.1.0 »

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

ResourceFunction["ReflectPoints"] works on 2D and 3D points.

Examples

Basic Examples (2) 

Reflect points about a given line:

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

Reflect points about a given plane:

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

Requirements

Wolfram Language 11.3 (March 2018) or above

Version History

  • 1.1.0 – 22 August 2022
  • 1.0.1 – 31 January 2022
  • 1.0.0 – 11 February 2019

License Information