How to mirror image in MATLAB.

11 visualizaciones (últimos 30 días)
Cillian
Cillian el 26 de Abr. de 2012
Comentada: HARSH el 17 de Jul. de 2023
I really need help with the task below, can someone give a hint, just how to start solving this problem?
Write a program that makes the following:
Given the plane Ax + By + Cz = D and a point x in space, calculate the mirror image s of x in the plane.
Function script: function s = mirror(x, A, B, C, D)
Input: The point x and the parameters of the plane equation.
Output: The mirror image s
Also, presenting all occuring vectors as column vectors.
At last, test the functions on a suitable planes and points, just to check the results.
Here is my attempt so far;
function s = spegel(x, A, B, C, D)
s = A.*x + B.*y + C.*z - D;
s = x(length(gen):-1:1) % for the general case of a 1D vector (either row or column)
end
I would be very thankful for some help.
Regards
Cillian
  1 comentario
HARSH
HARSH el 17 de Jul. de 2023
Can You explain the plane mirror code in matlab ?

Iniciar sesión para comentar.

Respuestas (1)

Sean de Wolski
Sean de Wolski el 26 de Abr. de 2012
That looks right for the 1d case. You may wish to look at: fliplr, flipud, flipdim.
If you open them up, e.g:
open flipud
You can see how they work.

Categorías

Más información sobre Geometric Transformation and Image Registration en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by