Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Mirror Point

Subject: Mirror Point

From: John Lee

Date: 16 Mar, 2009 07:41:09

Message: 1 of 9

Hi,

I'm currenly writing a program to simulate the reflection of light beam using Matlab, basically i have no problem in 2-D simulation, however, when i try to make it 3-D, the following questions appear:
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.

Johnny

Subject: Mirror Point

From: Bjorn Gustavsson

Date: 16 Mar, 2009 08:08:06

Message: 2 of 9

"John Lee" <tocy@netvigator.com> wrote in message <gpkvql$a18$1@fred.mathworks.com>...
> Hi,
>
> I'm currenly writing a program to simulate the reflection of light beam using Matlab, basically i have no problem in 2-D simulation, however, when i try to make it 3-D, the following questions appear:
> 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.
>
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:

k_relf = k_in + 2*abs(dot(k_in,n))*n

HTH,
Bjeorn

Subject: Mirror Point

From: Roger Stafford

Date: 16 Mar, 2009 10:46:10

Message: 3 of 9

"Bjorn Gustavsson" <bjonr@irf.se> wrote in message <gpl1d6$da1$1@fred.mathworks.com>...
> "John Lee" <tocy@netvigator.com> wrote in message <gpkvql$a18$1@fred.mathworks.com>...
> > Hi,
> >
> > I'm currenly writing a program to simulate the reflection of light beam using Matlab, basically i have no problem in 2-D simulation, however, when i try to make it 3-D, the following questions appear:
> > 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.
> >
> 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:
>
> k_relf = k_in + 2*abs(dot(k_in,n))*n
>
> HTH,
> Bjeorn

  Bjeorn, shouldn't that be

  k_relf = k_in - 2*dot(k_in,n)*n;

Roger Stafford

Subject: Mirror Point

From: Bjorn Gustavsson

Date: 16 Mar, 2009 11:22:13

Message: 4 of 9

"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <gplali$ek7$1@fred.mathworks.com>...
> "Bjorn Gustavsson" <bjonr@irf.se> wrote in message <gpl1d6$da1$1@fred.mathworks.com>...
> > "John Lee" <tocy@netvigator.com> wrote in message <gpkvql$a18$1@fred.mathworks.com>...
> > > Hi,
> > >
> > > I'm currenly writing a program to simulate the reflection of light beam using Matlab, basically i have no problem in 2-D simulation, however, when i try to make it 3-D, the following questions appear:
> > > 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.
> > >
> > 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:
> >
> > k_relf = k_in + 2*abs(dot(k_in,n))*n
> >
> > HTH,
> > Bjeorn
>
> Bjeorn, shouldn't that be
>
> k_relf = k_in - 2*dot(k_in,n)*n;
>
Ouch! My eyes hurt with embarrassment...

Bjoern

Subject: Mirror Point

From: John Lee

Date: 16 Mar, 2009 12:49:14

Message: 5 of 9

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.

THanks
Johnny

"Bjorn Gustavsson" <bjonr@irf.se> wrote in message <gplcp4$hsu$1@fred.mathworks.com>...
> "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <gplali$ek7$1@fred.mathworks.com>...
> > "Bjorn Gustavsson" <bjonr@irf.se> wrote in message <gpl1d6$da1$1@fred.mathworks.com>...
> > > "John Lee" <tocy@netvigator.com> wrote in message <gpkvql$a18$1@fred.mathworks.com>...
> > > > Hi,
> > > >
> > > > I'm currenly writing a program to simulate the reflection of light beam using Matlab, basically i have no problem in 2-D simulation, however, when i try to make it 3-D, the following questions appear:
> > > > 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.
> > > >
> > > 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:
> > >
> > > k_relf = k_in + 2*abs(dot(k_in,n))*n
> > >
> > > HTH,
> > > Bjeorn
> >
> > Bjeorn, shouldn't that be
> >
> > k_relf = k_in - 2*dot(k_in,n)*n;
> >
> Ouch! My eyes hurt with embarrassment...
>
> Bjoern

Subject: Mirror Point

From: Bjorn Gustavsson

Date: 16 Mar, 2009 13:49:12

Message: 6 of 9

"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

Subject: Mirror Point

From: Roger Stafford

Date: 17 Mar, 2009 05:21:02

Message: 7 of 9

"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

Subject: Mirror Point

From: John Lee

Date: 18 Mar, 2009 05:45:03

Message: 8 of 9

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

Subject: Mirror Point

From: Alex K.

Date: 19 Nov, 2010 11:07:04

Message: 9 of 9

Hello!

Currently I'm working on a similar problem.
John, have you finished your program? May I kindly ask you to post it?

Best regards,
Alex.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us