Reflect all points across a line axis, without modifying the input points array
Array of points to reflect
reflection axis as [start, end]
[start, end]
reflected points
Axis is the infinite line through axis[0] and axis[1].
axis[0]
axis[1]
const points = [[0, 0], [2, 2], [3, 1]];geomReflect(points, [[0, 1], [2, 1]]); // returns [[0, 2], [2, 0], [3, 1]] Copy
const points = [[0, 0], [2, 2], [3, 1]];geomReflect(points, [[0, 1], [2, 1]]); // returns [[0, 2], [2, 0], [3, 1]]
Reflect all points across a line axis, without modifying the input points array