All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Shapes
Bull's eye! (Posted on 2003-11-22) Difficulty: 3 of 5
Two points have polar coordinates as follows: θ=130°,r=.35 (point A) and θ=70°,r=.6 (point B). There is a surrounding circle, r=1, that acts as a mirror, and you wish to send a light ray from point A to point B by bouncing it once off the circle. What two alternative directions could you send it in (use an angular measure paralleling the θ coordinate it would have if directed from the origin)?

No Solution Yet Submitted by Antonio    
Rating: 3.6000 (5 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution A Basic language numerical solution | Comment 10 of 17 |
The following program iterates to the same solutions SilverKnight found with Excel's solver:

DECLARE SUB rect2pol (x#, y#, r#, theta#)
DECLARE FUNCTION norm# (x#)
DECLARE SUB pol2rect (r#, theta#, x#, y#)
DEFDBL A-Z
DIM SHARED pi, dr
pi = ATN(1) * 4
dr = pi / 180

CLS

dir = 90
dir(1) = dir
GOSUB evalu
diff(1) = norm(reflection - incidence)
dir = 88
dir(2) = dir
GOSUB evalu
diff(2) = norm(reflection - incidence)
DO
 slope = (diff(2) - diff(1)) / (dir(2) - dir(1))
 amt = -diff(1) / slope
 dir(3) = dir(1) + amt
 dir = dir(3): GOSUB evalu: diff(3) = norm(reflection - incidence)
 dir(1) = dir(2): diff(1) = diff(2)
 dir(2) = dir(3): diff(2) = diff(3)
LOOP UNTIL ABS(amt / dir(1)) < 1E-14 OR diff(1) = 0
 PRINT \"Aim direction=\"; dirA

dir = 270
dir(1) = dir
GOSUB evalu
diff(1) = norm(reflection - incidence)
dir = 272
dir(2) = dir
GOSUB evalu
diff(2) = norm(reflection - incidence)
DO
 slope = (diff(2) - diff(1)) / (dir(2) - dir(1))
 amt = -diff(1) / slope
 dir(3) = dir(1) + amt
 dir = dir(3): GOSUB evalu: diff(3) = norm(reflection - incidence)
 dir(1) = dir(2): diff(1) = diff(2)
 dir(2) = dir(3): diff(2) = diff(3)
LOOP UNTIL ABS(amt / dir(1)) < 1E-14 OR diff(1) = 0
 PRINT \"Aim direction=\"; dirA

END

evalu:
  pol2rect 1, dir, x, y
' PRINT \"x=\"; x; \"y=\"; y
  pol2rect .35, 130, Ax, Ay
  pol2rect .6, 70, Bx, By
  rect2pol x - Ax, y - Ay, dist, dirA
' PRINT \"Aim direction=\"; dirA
  incidence = dir - dirA
  rect2pol x - Bx, y - By, dist, dirB
  reflection = dirB - dir
' PRINT norm(incidence), norm(reflection)
' PRINT \"--\"
RETURN

FUNCTION norm (x)
  n = x
  DO UNTIL n > -180
    n = n + 360
  LOOP
  DO UNTIL n <= 180
    n = n - 360
  LOOP
  norm = n
END FUNCTION

SUB pol2rect (r, theta, x, y)
 x = r * COS(theta * dr)
 y = r * SIN(theta * dr)
END SUB

SUB rect2pol (x, y, r, theta)
 r = SQR(x * x + y * y)
 IF x = 0 THEN
   theta = 90 * SGN(y)
 ELSE
   theta = ATN(y / x) / dr
 END IF
 IF x < 0 THEN theta = theta + 180
END SUB

which finds
Aim direction= 64.92641251550131
Aim direction=-76.70421326480458
  Posted by Charlie on 2003-11-23 23:03:32
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (0)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information