How to mirror image in MATLAB.
11 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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
Respuestas (1)
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.
0 comentarios
Ver también
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!