Introduction to Geometrical Optics - a 2D ray tracing Excel model...

4
<www.excelunusual.com> 1 Introduction to Geometrical Optics - a 2D ray tracing Excel model for spherical mirrors - Part 6 by George Lungu - In the previous section we used the custom VBA functions Reflect() and Chart_Reflect() to calculate the data for the incident and the reflected rays and charted all these rays on the mirror chart. - This section simplifies math behind the custom function Chart_Reflect(). - In the next section of the tutorial, the new Chart_Reflect will be incorporated into a new Reflect_7() custom VBA function, which in addition calculates a new end point for the virtual ray. Having the incident point coordinates and the coordinates of the end point for the virtual ray will allow us to plot all three types of rays (incident, reflected and virtual) which is a very useful feature especially for convex mirrors. - Charting line segments determined by two points on 2D scatter charts seems to be fine even when the points are out of the visible range (scale) of the chart. - I had problems though, when one of the points had a very large coordinate out of the chart scale, case in which the slope of the line was severely distorted. Creating a new Reflect()” custom function: A Hubble Space Telescope backup mirror (not flown into space) of correct shape build by Kodak, on display at National Air and Space Museum in Washington DC

Transcript of Introduction to Geometrical Optics - a 2D ray tracing Excel model...

Page 1: Introduction to Geometrical Optics - a 2D ray tracing Excel model …excelunusual.com/.../uploads/2011/05/Mirrors_Tutorial_6.pdf · 2011-05-04 ·  1 Introduction to Geometrical

<www.excelunusual.com> 1

Introduction to Geometrical Optics - a 2D ray tracing Excel model for spherical mirrors - Part 6

by George Lungu

- In the previous section we used the custom VBA functions Reflect() and Chart_Reflect() to

calculate the data for the incident and the reflected rays and charted all these rays on the

mirror chart.

- This section simplifies math behind the custom function Chart_Reflect().

- In the next section of the tutorial, the new Chart_Reflect

will be incorporated into a new Reflect_7() custom VBA

function, which in addition calculates a new end point for

the virtual ray. Having the incident point coordinates and

the coordinates of the end point for the virtual ray will

allow us to plot all three types of rays (incident, reflected

and virtual) which is a very useful feature especially for

convex mirrors.

- Charting line segments determined by two points on 2D

scatter charts seems to be fine even when the points are

out of the visible range (scale) of the chart.

- I had problems though, when one of the points had a

very large coordinate out of the chart scale, case in which

the slope of the line was severely distorted.

Creating a new Reflect()” custom function:

A Hubble Space Telescope backup mirror (not flown

into space) of correct shape build by Kodak, on display

at National Air and Space Museum in Washington DC

Page 2: Introduction to Geometrical Optics - a 2D ray tracing Excel model …excelunusual.com/.../uploads/2011/05/Mirrors_Tutorial_6.pdf · 2011-05-04 ·  1 Introduction to Geometrical

<www.excelunusual.com> 2

- For now, let’s use a the following insight to obtain a second

point for the reflected ray:

- Let’s assume the chart has the scale for the x axis ranging

between x_scale_min and x_scale_max. Also let’s assume that

the y axis ranges between y_scale_min and y_scale_max.

- The reflected ray points backwards ( see angle ae) so if we

choose an arbitrary length PT larger than the chart diagonal,

using the definition of the “sine” and “cos” trigonometric

functions in the PAT straight triangle we can write:

Calculating the end point of the reflected ray-

the new, simplified method:

I

E

C M(xM,yM)

P(x,y)

ia

paP’

P”L

paea

T(xT,yT)

)sin(

)cos(

eT

eT

PTyy

PTxx

a

a

- I encountered the previously mentioned case while plotting the reflected ray.

- Ideally we would like to calculate the exact point where the reflected ray intersects the nearest

border of the visible range on the chart, and make that the end point of the reflected ray.

- After extensive testing I found out that if the end point is farther (even 10-100 times farther

than the length of the diagonal of the visible chart area), things are fine and the reflected ray

still retains the proper slope.

P(x,y)

ea

T(xT,yT)

A(xT,y)PT

yy

PT

xx

Te

Te

)sin(

)cos(

a

a

rearranging a bit we obtain:

Page 3: Introduction to Geometrical Optics - a 2D ray tracing Excel model …excelunusual.com/.../uploads/2011/05/Mirrors_Tutorial_6.pdf · 2011-05-04 ·  1 Introduction to Geometrical

<www.excelunusual.com> 3

- We can calculate PT as the diagonal of the viewing area:

Deciding a value for the PT length:

)sin(____

)cos(____

eT

eT

miny_scaleminx_scalemaxy_scalemaxx_scaleyy

miny_scaleminx_scalemaxy_scalemaxx_scalexx

a

a

22____ miny_scalemaxy_scaleminx_scalemaxx_scalePT

- Since this length is not critical and this operation will happen on every reflection and for every ray, we would like to simplify the formula for PT as follows:

miny_scaleminx_scalemaxy_scalemaxx_scalePT ____

- In this case, the new formulas for the Cartesian coordinates of the terminal point of the reflected ray become much lighter than the old ones:

- In certain situations when either the input beam is very divergent or the mirror is convex, the reflected rays might be divergent and their extensions (virtual rays) might converge in a “virtual focus” behind the mirror. Charting the virtual rays intersecting themselves in a virtual focus behind the mirror would be a very convenient way of assessing optical aberrations in such a mirror.

The Cartesian coordinates of the terminal point of the

virtual reflected ray:

Page 4: Introduction to Geometrical Optics - a 2D ray tracing Excel model …excelunusual.com/.../uploads/2011/05/Mirrors_Tutorial_6.pdf · 2011-05-04 ·  1 Introduction to Geometrical

<www.excelunusual.com> 4

Calculating the Cartesian coordinates of the the end point of the virtual reflected ray

V(xV,yV):

I

E

C M(xM,yM)

P(x,y)

ia

paP’

P”L

paea

T(xT,yT)

ev aa V(xv,yv)

Horizontal (parallel to x-axis)

- Extending the horizontal line that passes through the incidence point and end extending the reflected ray too, we can see that the reflected and the virtual ray both have the same slope:

- The formula for ae was derived before. We can use it to determine the coordinate of the virtual ray end point which will be very similar to the formulas for calculating the (real) reflected ray end point:

R

yy MPie asin2aa

)sin(

)cos(

____

eT

eT

PTyy

PTxx

miny_scaleminx_scalemaxy_scalemaxx_scalePT

a

a

Next, we will combine all the formulas derived in this section with some of the old formulas into a new Reflect_7 custom VBA function.

to be continued…