Reflection in a Circle

inref[pt1_,pt2_,k_]:={Re[#],Im[#]}&[#2 ((#2/#1)^k)&[pt1.{1,I},pt2.{1,I}]]

Manipulate[
Dynamic[p=N[Chop[p/(1-Unitize[#]+#)]&[Norm[p]]];q=N[Chop[q/(1-Unitize[#]+#)]&[Norm[q]]];With[{inrefs=inref[p,q,#]&/@Range[-1,s]},Graphics[Flatten@{GrayLevel[.6],Disk[],White,Line[inrefs]},PlotRange->3/2,Background->GrayLevel[.3]]]],{{p,{-1/2,1/3},"first"},Locator},
{{q,{1,0},"second"},Locator},
{{s,1,"step"},0,120,1,Appearance->"Labeled"},
AutorunSequencing->{3},SaveDefinitions->True]

CAPTION

A ray is reflected inside a circle. The angle between chords is constant. The rays are tangent to a central circle.

THIS NOTEBOOK IS THE SOURCE CODE FROM

"Reflection in a Circle" from the Wolfram Demonstrations Project
 http://demonstrations.wolfram.com/ReflectionInACircle/

Contributed by: Michael Schreiber

A full-function Wolfram Mathematica system (Version 6 or higher) is required to edit this notebook.
GET WOLFRAM MATHEMATICA »

© Wolfram Demonstrations Project & Contributors   |   Terms of Use   |   Make a new version of this Demonstration »