0

I am currently working on a project on Matlab and I need to find the coordinates of a point which is reflected about a line. I know how to do it in 2D but in 3D things are getting ugly.

So, we have a line which goes through two points A(x1,y1,z1) and B(x2,y2,z2). P1(x0,y0,z0) is reflected about that line and i need an algorithm to find the coordinates of reflection of P1.

1 Answers1

0

At first, find projection L of point P to line AB.

L = A + AB * ScalarProduct(AB, AP) / ScalarProduct(AB, AB)

Then calculate reflection

P' = P + 2*(L-P) = 2*L-P
MBo
  • 77,366
  • 5
  • 53
  • 86