Path: news.mathworks.com!not-for-mail From: <HIDDEN> Newsgroups: comp.soft-sys.matlab Subject: Re: Mirror Point Date: Wed, 18 Mar 2009 05:45:03 +0000 (UTC) Organization: The MathWorks, Inc. Lines: 43 Message-ID: <gpq1ov$bdk$1@fred.mathworks.com> References: <gpkvql$a18$1@fred.mathworks.com> <gpl1d6$da1$1@fred.mathworks.com> <gplali$ek7$1@fred.mathworks.com> <gplcp4$hsu$1@fred.mathworks.com> <gplhsa$g1q$1@fred.mathworks.com> <gpllco$6e2$1@fred.mathworks.com> <gpnbvu$9nl$1@fred.mathworks.com> Reply-To: <HIDDEN> NNTP-Posting-Host: webapp-05-blr.mathworks.com Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Trace: fred.mathworks.com 1237355103 11700 172.30.248.35 (18 Mar 2009 05:45:03 GMT) X-Complaints-To: news@mathworks.com NNTP-Posting-Date: Wed, 18 Mar 2009 05:45:03 +0000 (UTC) X-Newsreader: MATLAB Central Newsreader 1757428 Xref: news.mathworks.com comp.soft-sys.matlab:525769 Dear, Thanks again, your information helps a lot!! Now I have more clear image of the structure of my program. Best John "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <gpnbvu$9nl$1@fred.mathworks.com>... > "Bjorn Gustavsson" <bjonr@irf.se> wrote in message <gpllco$6e2$1@fred.mathworks.com>... > > "John Lee" <tocy@netvigator.com> wrote in message <gplhsa$g1q$1@fred.mathworks.com>... > > > 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. > > > > > 1, determine the vector of propagation of your beam (from p1 to p2) [kx, ky, kz] > > 2, determine the normal vector of the plane [nx, ny, nz] > > 3, use Roger's formula. > > > > HTH, > > Bjeorn > > 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 > > 0 = dot(N,P) + D = dot(N,P0) + D + t*dot(N,V0) > > Solving for t gives > > t = -(dot(N,P0)+D)/dot(N,V0) > > which gives the point P = P0+t*V0 = P0-(dot(N,P0)+D)/dot(N,V0)*V0 > > Then you want the new direction V of reflection from the plane. This is > > V = V0 - 2*dot(V0,N)/dot(N,N)*N > > which is derived from the article above using n = N/norm(N). > > 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. > > 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. > > 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. > > Roger Stafford