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$>
References: <gpkvql$a18$> <gpl1d6$da1$> <gplali$ek7$> <gplcp4$hsu$> <gplhsa$g1q$> <gpllco$6e2$> <gpnbvu$9nl$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1237355103 11700 (18 Mar 2009 05:45:03 GMT)
NNTP-Posting-Date: Wed, 18 Mar 2009 05:45:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1757428
Xref: comp.soft-sys.matlab:525769


Thanks again, your information helps a lot!!
Now I have more clear image of the structure of my program.


"Roger Stafford" <> wrote in message <gpnbvu$9nl$>...
> "Bjorn Gustavsson" <> wrote in message <gpllco$6e2$>...
> > "John Lee" <> wrote in message <gplhsa$g1q$>...
> > > 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