Reflective paths in an ellipse
Preliminary discussion : More on reflecting from lines and planes and the analytic expression of the principle of reflection.
Although reflection is usually introduced as "the angle of reflection is equal to the angle of reflection" this is often difficult to work with. If we think of a line in space reflecting or the plane reflecting off of F, a plane or another line, then P is the point on the plane or line of reflection and L = P +t*DIR is the parametric form of the line the we know that the reflected line will also go through P so its parametric form will be:
=
. That is, what is important is the reflected direction. Now if we consider the special case when the line L is perpendicular to F then the reflected direction is obviously the opposite of the direction. That is
if L is perpendicular to F
then
Additionally, if L is parallel to F then the reflected line is L itself. Now all we have to do is recall that every direction, DIR, can be thought of (reslved) into two directions: parallel to F and one perpendicular to F. That is
.
Now if we think of reflecting DIR through F the parallel ocmponent will remain unchanged and the perpendicular component will be reversed. That is
Thus the problem of calculating the reflected line boils down to determining the component of DIR perpendicular to F.
Let
be the unit normal to F. That is
has length 1 and is perpendicular to F. Then we can calculate the normal component of F by a simple formula which is implemented in Maple.
Here "dotproduct" , sometimes called scalar product of the vectors [p,q,r], and [s,d,f] is ps+qd+rf ( or [p,q] dot [s,d] = ps+dq in two dimensions). Im Maple this is "linalg[dotproduct]"
This is an extremely easy to use formula. Recall, for instance that if the plane F in space is given by the equation ax+by+c=d then [a,b,c] is perpendicular to F and hence
. In Maple this can be calculated as
. Thus for instance if DIR = [3,1,-2] and we want its reflected direction from the plane 7x+2y-4z=10 then
> linalg[dotprod]([7,2,-4],[3,1,-2])/sqrt(7^2+2^2+(-4)^2)*[3,1,-2];
Whenever we have a way to calculate the unit normal to a plane or line at a point we can readily use Maple to calculate how lines reflect off of it. This i s even possible in the case of curved geometric figures that have tangent lines since the line simply acts as if it is reflecting off the tangent line.
QUESTION: Given points A and B on the unit circle, a ray of light moves from A to B and reflects off the tangent, reflecting thereafter. Trace the path through n bounces.
Discussion
: There are many ways to solve this problem. We recall from geometry that the tangent to a circle is always perpendicular to the radius. This with a circle centered at the origin the normal direction to the tangent line at a point is simply the direction of the radius. This would make it easy to calculate the reflected line, then find where that line meets the circle, calculate its reflected line, etc. We will do the next set of calculations this way but the circle has such a rich geometry that there is an easier way. First we look at an example:
reflect1
Let B* be the point where the reflected line meets the circle. The critical observation is that the point at which the reflected chord AB* meets the circle is exactly the reflection of B through the radius to A. AB * will have the same length as AB and therfore the angle ABO is exactly the angle OBB*. If we call that angle
then we get to B by going
from A, to B* by going
from B (or
from A), etc. Thus the nth point of reflection will be the result of rotating
Example: By rotation we can assume A is at [1,0] and b is at a point "d" from B. We find the angle by letting d=distance(A,B), say d=3/4 then we can calculate the angle subtended by the arc AB. The critical obserevation is that the point at which the reflected chord AB' meets the circle is exactly the reflection of A through the radius to B and it will subtend exactly the same
> restart;
> distance:=1.99;
>
ang:=solve({
(x-1)^2+y^2 = (distance)^2, x^2+y^2=1},{x,y});
> theta:=arccos(subs(ang,x));
> theta:=evalf(5*2*Pi/19);
>
>
pts:=NULL: for n from 0 to 200 do
pts:=pts,[cos(n*theta),sin(n*theta)]; od:
> chords:=plot([pts],scaling=constrained):
> chords;
>
circl:=plot(
[cos(t),sin(t),t=0..2*Pi]):
> plots[display]([chords,circl],scaling=constrained);
>
Exercises
EXERCISE: Build a Maple word (procedure) which inputs a distance from [0,1] to the the point of reflection and an number n of iterations and returns a plot of the path of the reflected ray through n bounces.
EXERCISE: Observe the figures made by the iterations of the reflections of the ray - it they seem to create another circle. Is this an artifact or is there really a circle there?
EXERCISE: If there always is a circle there then it is determined completely by the distance d (and the fact that we start at [0,1] and are in the unit circle). Find a formula or a way to calculate the radius of the circle in terms of d.
EXERCISE: If d= sqrt(2) the figure is a square for all n greater than 4. Thus there are finite, closed, reflective paths of this type. Find others, describe all such paths. What are the values of "distance" which produce them?
An eliptical reflector
Bouncing a ray around in a circle determined another circle which can be calculated. In this section we initiate an exploaration of what happens in the case of an ellipse. First we need an elliptical bouncer. We concentrate on standard ellipses of the form
where
. Such an ellipse will have focii at [-c,0] and [0,c] where
.
> restart:
> ELLIPSEEQN:=(x/a)^2 + (y/b)^2 = 1;
> focus1:=[-c,0]; focus2:=[c,0];
P is a point on the ellipse
> P:=[p1,p2];
n1 and n2 are unit vectors from the point P to each of the focii. Each of these makes the same angle with the tangent by the reflective property of the ellipse.
reflect2
Thus the normal line to the ellipse is the bisector of the angle they make with the ellipse. Since they are both of unit length this line is simply their average
> n1:=[c,0]-P;n1:=n1/linalg[norm](n1,2);
> n2:=[-c,0]-P;n2:=n2/linalg[norm](n2,2);
note also n2 = subs(c=-c,n1);
> perp:=1/2*(n1+n2);
This is not a unit normal but it is a normal. To get a unit normal we must divide by its length:
> unitperp:=perp/linalg[norm](perp,2);
line:=P + t*DIR is the parametric form of a line with direction DIR going through P then its reflection through the tangent line is found by reversing the component of DIR in the direction normal to the tangent line, i.e. reversing the component in the direction of perp. The components are easy to calculate with standard formulas: LINE is the current line
>
> ellipsebouncer:=proc(A,B,pt,dir,n)
>
local DIR,DIR1,DIR2,a,b,PTSEQUENCE,LINE,s,nonzeroroot,
REFLECTEDDIR, NEXTPT, ELLIPSEEQN, ELLIPSEPIC,
LINEPICS, UNITPERP, SLNS, PARAMETRICELLIPSE,
PT,w,normalcomponentofDIR,sWHERELINEHITSELLIPSE:
global unitperp:
DIR:=dir;a:=A; b:=B: PT:=pt;
ELLIPSEEQN:=(x/a)^2+(y/b)^2=1:
PARAMETRICELLIPSE:=[a*cos(t),b*sin(t)]:
>
PTSEQUENCE:=NULL;PTSEQUENCE:=PTSEQUENCE,PT;
for w from 1 to n do
LINE:=expand(PT+s*DIR):
sWHERELINEHITSELLIPSE:=subs({x=LINE[1],y=LINE[2]},ELLIPSEEQN):
> SLNS:=[solve(sWHERELINEHITSELLIPSE,s)]:
> nonzeroroot:=SLNS[1]+SLNS[2]:
> NEXTPT:=subs(s=nonzeroroot, LINE):
> PT:=NEXTPT:
> UNITPERP:=evalf(subs({c=sqrt(a^2-b^2),p1=PT[1],p2=PT[2]},unitperp)):
> normalcomponentofDIR:=evalf(linalg[dotprod](DIR,UNITPERP)*UNITPERP):
>
REFLECTEDDIR:=DIR-2*normalcomponentofDIR:
DIR:=REFLECTEDDIR:
PTSEQUENCE:=PTSEQUENCE,PT;
od:
>
> ELLIPSEPIC:=plot([op(PARAMETRICELLIPSE), t=0..2*Pi],scaling=constrained):
> LINEPICS:=plot([PTSEQUENCE]):
> plots[display]([ELLIPSEPIC, LINEPICS]);
> end:
Exercises
EXERCISE: In the circle there all paths defined regular n-gons or smaller circles. Experiment to see what happens in the case of an ellipse.
EXERCISE: The ellipsebouncer requires the starting point to be on the ellipse. This is an unnecessary restriction. Modify or adapt ellipsebouncer so that one can start anywhere within the ellipse. EB2, below, does this.
> LIPS:=ellipsebouncer(2,1,[2,0 ],[-1,-.4],50):
> LIPS;
EXERCISE: Make a movie which closes the lips.
The following movie has a frame which appears to indicate a closed path.
EXERCISE: Are there closed reflective paths in the ellipse?
>
movie:=NULL: for i from 1 to 10 do
movie:=movie,ellipsebouncer(2,1,[2,0],[-1,-.4/i],10) od:
>
> plots[display]([movie],insequence=true);
>
> EB2:=proc(A,B,pt,dir,n)
>
local DIR,DIR1,DIR2,a,b,PTSEQUENCE,LINE,s,nonzeroroot,
REFLECTEDDIR, NEXTPT, ELLIPSEEQN, ELLIPSEPIC,
LINEPICS, UNITPERP, SLNS, PARAMETRICELLIPSE,
PT,w,normalcomponentofDIR,sWHERELINEHITSELLIPSE, TMP:
global unitperp:
DIR:=dir;a:=A; b:=B: PT:=pt;
ELLIPSEEQN:=(x/a)^2+(y/b)^2=1:
PARAMETRICELLIPSE:=[a*cos(t),b*sin(t)]:
#change pt to a point on ellipse
LINE:=expand(PT+s*DIR):
sWHERELINEHITSELLIPSE:=subs({x=LINE[1],y=LINE[2]},ELLIPSEEQN):
>
SLNS:= solve(sWHERELINEHITSELLIPSE,s) :
if member(0, {SLNS})='true' then PT:=pt else
TMP:=[SLNS]:
> PT:=subs(s=TMP[1], LINE): fi:
>
PTSEQUENCE:=NULL;PTSEQUENCE:=PTSEQUENCE,PT;
for w from 1 to n do
LINE:=expand(PT+s*DIR):
sWHERELINEHITSELLIPSE:=subs({x=LINE[1],y=LINE[2]},ELLIPSEEQN):
> SLNS:=[solve(sWHERELINEHITSELLIPSE,s)]:
> nonzeroroot:=SLNS[1]+SLNS[2]:
> NEXTPT:=subs(s=nonzeroroot, LINE):
> PT:=NEXTPT:
> UNITPERP:=evalf(subs({c=sqrt(a^2-b^2),p1=PT[1],p2=PT[2]},unitperp)):
> normalcomponentofDIR:=evalf(linalg[dotprod](DIR,UNITPERP)*UNITPERP):
>
REFLECTEDDIR:=DIR-2*normalcomponentofDIR:
DIR:=REFLECTEDDIR:
PTSEQUENCE:=PTSEQUENCE,PT;
od:
> ELLIPSEPIC:=plot([op(PARAMETRICELLIPSE), t=0..2*Pi],scaling=constrained):
> LINEPICS:=plot([PTSEQUENCE]):
> plots[display]([ELLIPSEPIC, LINEPICS]);
> end:
> printlevel:=1;
> EB2(5,4,[5 ,2],[2,1],4);
The following is an interesting figure.
EXERCISE: Create more figures like the one below and formulate a conjecture about such figures.
> EB2(5,4,[3 ,1],[2,1],40);
> EB2(5,4,[0 ,0],[.5,3],20);
> EB2(5,1,[4.87 ,0],[1,.72],20);
While we are at it we should make a kalidoscope
>
>
movie:=NULL: for k from 1 to 10 do
movie:=movie,EB2(5,1,[5,0],[1,1-k/20],40); od:
> nops([movie]);
> plots[display]([movie],insequence=true);
> EB2(5, 1,[2,0 ],[-1,-.4],50);