Associated Topics || Dr. Math Home || Search Dr. Math

### Finding Reflection Points within a Rectangle

```Date: 03/24/2005 at 23:39:47
From: Bill
Subject: Reflections within a rectangle

Given a beginning point and an ending point inside a rectangle, I'm
trying find a formula, algorithum or calculation that would tell me
where on the rectangle I would have to aim a laser from the given
beginning point, to a first contact point (not given) on the rectangle
so that it would reflect and continue to a second point (not given) on
the rectangle and reflect again so that it connects to the given
ending point.

The rectangle is 40 inches by 80 inches.  Basically the laser has to
contact exactly two sides of the rectangle before contacting the end
point.

I've tried using triangles and parallelograms but I'm just not
finding the solution.

```

```
Date: 04/04/2005 at 13:38:36
From: Doctor Douglas
Subject: Re: Reflections within a rectangle

Hi Bill.

There are of course multiple answers:  if the starting point is A
and the ending point is B, and you label the four walls by their
cardinal directions (N,E,S,W), then you can probably intuitively
generate solutions such as A-E-W-B and A-W-E-B.  My guess is that
you want the SHORTEST distance solution of the various choices
that satisfy the two-bounce condition.

Here's what I suggest.  Draw a grid of rectangles that include
the original rectangle, and in each construct the image of "B" by
reflection from each wall.  You will have to construct the
coordinates for each image, but I don't think you will have much
difficulty in doing that.  In the diagram below, PQRS is the
rectangle, with given start A and end B.  Each reflected image of B in
the other rectangles is represented by a numeral:

+---------+---------+---------+---------+---------+
|       4 | 3       |       2 | 3       |       4 |
|         |         |         |         |         |   View this
+---------+---------+---------+---------+---------+   diagram in
|         |         |         |         |         |   a monospaced
|       3 | 2       |       1 | 2       |       3 |   font.
+---------+---------P---------Q---------+---------+
|       2 | 1       |       B | 1       |       2 |
|         |         |A        |         |         |
+---------+---------S---------R---------+---------+
|         |         |         |         |         |
|       3 | 2       |       1 | 2       |       3 |
+---------+---------+---------+---------+---------+
|       4 | 3       |       2 | 3       |       4 |
|         |         |         |         |         |
+---------+---------+---------+---------+---------+

There is one image (B) for which a direct path requires no
reflections.  The four cells immediately adjacent (N/E/S/W) to the
central box require one (and only one) reflection, so that they (1's)
can be ignored for your application.  The next set of surrounding
boxes require exactly two reflections (2's).  It is from these eight
choices of "2" that you have to select the one nearest to the start
point A.  In the above diagram the northwest and southwest choices are
the two logical candidates for the closest point.

If you draw a line from A to the closest image from among the eight
choices, you will see that it crosses exactly two sides.  These
crossings represent the needed reflection points.

- Doctor Douglas, The Math Forum
http://mathforum.org/dr.math/

```

```
Date: 04/06/2005 at 21:14:54
From: Bill
Subject: Re: Reflections within a rectangle

I wanted to say thanks, I appreciate your help.  Your sample was very
easy to follow.

Sincerely,

Bill
```
Associated Topics:
College Euclidean Geometry
High School Euclidean/Plane Geometry

Search the Dr. Math Library:

 Find items containing (put spaces between keywords):   Click only once for faster results: [ Choose "whole words" when searching for a word like age.] all keywords, in any order at least one, that exact phrase parts of words whole words

Submit your own question to Dr. Math
Math Forum Home || Math Library || Quick Reference || Math Forum Search