http://www.mathworks.com/matlabcentral/newsreader/view_thread/246747
MATLAB Central Newsreader  Mirror Point
Feed for thread: Mirror Point
enus
©19942014 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Mon, 16 Mar 2009 07:41:09 +0000
Mirror Point
http://www.mathworks.com/matlabcentral/newsreader/view_thread/246747#635132
John Lee
Hi,<br>
<br>
I'm currenly writing a program to simulate the reflection of light beam using Matlab, basically i have no problem in 2D simulation, however, when i try to make it 3D, the following questions appear:<br>
Let's say I have a time dependent vector traveling in space(in Polar Form, every time step the magnitude will change at assigned angles), and finally it touch on a plane, the problem is how I could find the reflected vector angle from the plane equation. Please kindly assist.<br>
<br>
Johnny

Mon, 16 Mar 2009 08:08:06 +0000
Re: Mirror Point
http://www.mathworks.com/matlabcentral/newsreader/view_thread/246747#635137
Bjorn Gustavsson
"John Lee" <tocy@netvigator.com> wrote in message <gpkvql$a18$1@fred.mathworks.com>...<br>
> Hi,<br>
> <br>
> I'm currenly writing a program to simulate the reflection of light beam using Matlab, basically i have no problem in 2D simulation, however, when i try to make it 3D, the following questions appear:<br>
> Let's say I have a time dependent vector traveling in space(in Polar Form, every time step the magnitude will change at assigned angles), and finally it touch on a plane, the problem is how I could find the reflected vector angle from the plane equation. Please kindly assist.<br>
> <br>
With k_in as the wave vector for the beam before reflection, and n the normal vector of the plane I think it's this simple:<br>
<br>
k_relf = k_in + 2*abs(dot(k_in,n))*n<br>
<br>
HTH,<br>
Bjeorn

Mon, 16 Mar 2009 10:46:10 +0000
Re: Mirror Point
http://www.mathworks.com/matlabcentral/newsreader/view_thread/246747#635163
Roger Stafford
"Bjorn Gustavsson" <bjonr@irf.se> wrote in message <gpl1d6$da1$1@fred.mathworks.com>...<br>
> "John Lee" <tocy@netvigator.com> wrote in message <gpkvql$a18$1@fred.mathworks.com>...<br>
> > Hi,<br>
> > <br>
> > I'm currenly writing a program to simulate the reflection of light beam using Matlab, basically i have no problem in 2D simulation, however, when i try to make it 3D, the following questions appear:<br>
> > Let's say I have a time dependent vector traveling in space(in Polar Form, every time step the magnitude will change at assigned angles), and finally it touch on a plane, the problem is how I could find the reflected vector angle from the plane equation. Please kindly assist.<br>
> > <br>
> With k_in as the wave vector for the beam before reflection, and n the normal vector of the plane I think it's this simple:<br>
> <br>
> k_relf = k_in + 2*abs(dot(k_in,n))*n<br>
> <br>
> HTH,<br>
> Bjeorn<br>
<br>
Bjeorn, shouldn't that be<br>
<br>
k_relf = k_in  2*dot(k_in,n)*n;<br>
<br>
Roger Stafford

Mon, 16 Mar 2009 11:22:13 +0000
Re: Mirror Point
http://www.mathworks.com/matlabcentral/newsreader/view_thread/246747#635172
Bjorn Gustavsson
"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <gplali$ek7$1@fred.mathworks.com>...<br>
> "Bjorn Gustavsson" <bjonr@irf.se> wrote in message <gpl1d6$da1$1@fred.mathworks.com>...<br>
> > "John Lee" <tocy@netvigator.com> wrote in message <gpkvql$a18$1@fred.mathworks.com>...<br>
> > > Hi,<br>
> > > <br>
> > > I'm currenly writing a program to simulate the reflection of light beam using Matlab, basically i have no problem in 2D simulation, however, when i try to make it 3D, the following questions appear:<br>
> > > Let's say I have a time dependent vector traveling in space(in Polar Form, every time step the magnitude will change at assigned angles), and finally it touch on a plane, the problem is how I could find the reflected vector angle from the plane equation. Please kindly assist.<br>
> > > <br>
> > With k_in as the wave vector for the beam before reflection, and n the normal vector of the plane I think it's this simple:<br>
> > <br>
> > k_relf = k_in + 2*abs(dot(k_in,n))*n<br>
> > <br>
> > HTH,<br>
> > Bjeorn<br>
> <br>
> Bjeorn, shouldn't that be<br>
> <br>
> k_relf = k_in  2*dot(k_in,n)*n;<br>
> <br>
Ouch! My eyes hurt with embarrassment...<br>
<br>
Bjoern

Mon, 16 Mar 2009 12:49:14 +0000
Re: Mirror Point
http://www.mathworks.com/matlabcentral/newsreader/view_thread/246747#635195
John Lee
Thanks a lot to both of you, however, I'm still puzzling about how this equation be applied to my program. For example, I have a plane equation y=0, k_in is traveling from point P1(3,1,0) to P2(2,0,1), then how can I apply your equation to this condition? Sorry for my poor understanding.<br>
<br>
THanks<br>
Johnny<br>
<br>
"Bjorn Gustavsson" <bjonr@irf.se> wrote in message <gplcp4$hsu$1@fred.mathworks.com>...<br>
> "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <gplali$ek7$1@fred.mathworks.com>...<br>
> > "Bjorn Gustavsson" <bjonr@irf.se> wrote in message <gpl1d6$da1$1@fred.mathworks.com>...<br>
> > > "John Lee" <tocy@netvigator.com> wrote in message <gpkvql$a18$1@fred.mathworks.com>...<br>
> > > > Hi,<br>
> > > > <br>
> > > > I'm currenly writing a program to simulate the reflection of light beam using Matlab, basically i have no problem in 2D simulation, however, when i try to make it 3D, the following questions appear:<br>
> > > > Let's say I have a time dependent vector traveling in space(in Polar Form, every time step the magnitude will change at assigned angles), and finally it touch on a plane, the problem is how I could find the reflected vector angle from the plane equation. Please kindly assist.<br>
> > > > <br>
> > > With k_in as the wave vector for the beam before reflection, and n the normal vector of the plane I think it's this simple:<br>
> > > <br>
> > > k_relf = k_in + 2*abs(dot(k_in,n))*n<br>
> > > <br>
> > > HTH,<br>
> > > Bjeorn<br>
> > <br>
> > Bjeorn, shouldn't that be<br>
> > <br>
> > k_relf = k_in  2*dot(k_in,n)*n;<br>
> > <br>
> Ouch! My eyes hurt with embarrassment...<br>
> <br>
> Bjoern

Mon, 16 Mar 2009 13:49:12 +0000
Re: Mirror Point
http://www.mathworks.com/matlabcentral/newsreader/view_thread/246747#635219
Bjorn Gustavsson
"John Lee" <tocy@netvigator.com> wrote in message <gplhsa$g1q$1@fred.mathworks.com>...<br>
> Thanks a lot to both of you, however, I'm still puzzling about how this equation be applied to my program. For example, I have a plane equation y=0, k_in is traveling from point P1(3,1,0) to P2(2,0,1), then how can I apply your equation to this condition? Sorry for my poor understanding.<br>
> <br>
1, determine the vector of propagation of your beam (from p1 to p2) [kx, ky, kz]<br>
2, determine the normal vector of the plane [nx, ny, nz]<br>
3, use Roger's formula.<br>
<br>
HTH,<br>
Bjeorn

Tue, 17 Mar 2009 05:21:02 +0000
Re: Mirror Point
http://www.mathworks.com/matlabcentral/newsreader/view_thread/246747#635414
Roger Stafford
"Bjorn Gustavsson" <bjonr@irf.se> wrote in message <gpllco$6e2$1@fred.mathworks.com>...<br>
> "John Lee" <tocy@netvigator.com> wrote in message <gplhsa$g1q$1@fred.mathworks.com>...<br>
> > Thanks a lot to both of you, however, I'm still puzzling about how this equation be applied to my program. For example, I have a plane equation y=0, k_in is traveling from point P1(3,1,0) to P2(2,0,1), then how can I apply your equation to this condition? Sorry for my poor understanding.<br>
> > <br>
> 1, determine the vector of propagation of your beam (from p1 to p2) [kx, ky, kz]<br>
> 2, determine the normal vector of the plane [nx, ny, nz]<br>
> 3, use Roger's formula.<br>
> <br>
> HTH,<br>
> Bjeorn<br>
<br>
I'll fill in a little on Bjeorn's suggestions. You start with a plane defined by the equation A*x+B*y+C*z+D = 0, a point P0, and direction along the vector V0. You want to know the point P where a ray proceeding from P0 along direction V0 meets the plane. Call N = [A,B,C]. P must satisfy P = P0+t*V0 for some scalar t as well as <br>
<br>
0 = dot(N,P) + D = dot(N,P0) + D + t*dot(N,V0)<br>
<br>
Solving for t gives<br>
<br>
t = (dot(N,P0)+D)/dot(N,V0)<br>
<br>
which gives the point P = P0+t*V0 = P0(dot(N,P0)+D)/dot(N,V0)*V0<br>
<br>
Then you want the new direction V of reflection from the plane. This is<br>
<br>
V = V0  2*dot(V0,N)/dot(N,N)*N<br>
<br>
which is derived from the article above using n = N/norm(N).<br>
<br>
Now you have a new point P and a new direction from it along V and you are ready for reflection from the next plane wherever that may be.<br>
<br>
Of course your problem may be much more complicated than this. You many not know which of several planes the ray from P0 will first encounter and whether the actual finite mirror in the plane extends as far out as that point of intersection. However, with the proper precautions you can trace the ray ad infinitum within the mirrors or until it escapes into outer space.<br>
<br>
You should realize that the above assumes that only geometrical optics are involved. Introducing physical optics with its diffraction effects makes things vastly more complex.<br>
<br>
Roger Stafford

Wed, 18 Mar 2009 05:45:03 +0000
Re: Mirror Point
http://www.mathworks.com/matlabcentral/newsreader/view_thread/246747#635769
John Lee
Dear, <br>
<br>
Thanks again, your information helps a lot!!<br>
Now I have more clear image of the structure of my program.<br>
<br>
Best<br>
John<br>
<br>
"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <gpnbvu$9nl$1@fred.mathworks.com>...<br>
> "Bjorn Gustavsson" <bjonr@irf.se> wrote in message <gpllco$6e2$1@fred.mathworks.com>...<br>
> > "John Lee" <tocy@netvigator.com> wrote in message <gplhsa$g1q$1@fred.mathworks.com>...<br>
> > > Thanks a lot to both of you, however, I'm still puzzling about how this equation be applied to my program. For example, I have a plane equation y=0, k_in is traveling from point P1(3,1,0) to P2(2,0,1), then how can I apply your equation to this condition? Sorry for my poor understanding.<br>
> > > <br>
> > 1, determine the vector of propagation of your beam (from p1 to p2) [kx, ky, kz]<br>
> > 2, determine the normal vector of the plane [nx, ny, nz]<br>
> > 3, use Roger's formula.<br>
> > <br>
> > HTH,<br>
> > Bjeorn<br>
> <br>
> I'll fill in a little on Bjeorn's suggestions. You start with a plane defined by the equation A*x+B*y+C*z+D = 0, a point P0, and direction along the vector V0. You want to know the point P where a ray proceeding from P0 along direction V0 meets the plane. Call N = [A,B,C]. P must satisfy P = P0+t*V0 for some scalar t as well as <br>
> <br>
> 0 = dot(N,P) + D = dot(N,P0) + D + t*dot(N,V0)<br>
> <br>
> Solving for t gives<br>
> <br>
> t = (dot(N,P0)+D)/dot(N,V0)<br>
> <br>
> which gives the point P = P0+t*V0 = P0(dot(N,P0)+D)/dot(N,V0)*V0<br>
> <br>
> Then you want the new direction V of reflection from the plane. This is<br>
> <br>
> V = V0  2*dot(V0,N)/dot(N,N)*N<br>
> <br>
> which is derived from the article above using n = N/norm(N).<br>
> <br>
> Now you have a new point P and a new direction from it along V and you are ready for reflection from the next plane wherever that may be.<br>
> <br>
> Of course your problem may be much more complicated than this. You many not know which of several planes the ray from P0 will first encounter and whether the actual finite mirror in the plane extends as far out as that point of intersection. However, with the proper precautions you can trace the ray ad infinitum within the mirrors or until it escapes into outer space.<br>
> <br>
> You should realize that the above assumes that only geometrical optics are involved. Introducing physical optics with its diffraction effects makes things vastly more complex.<br>
> <br>
> Roger Stafford

Fri, 19 Nov 2010 11:07:04 +0000
Re: Mirror Point
http://www.mathworks.com/matlabcentral/newsreader/view_thread/246747#797635
Alex K.
Hello!<br>
<br>
Currently I'm working on a similar problem.<br>
John, have you finished your program? May I kindly ask you to post it?<br>
<br>
Best regards,<br>
Alex.