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)?
(In reply to
solution (solved numerically) by SilverKnight)
The following program verifies SilverKnight's solution. As it only verifies a found solution, it would be interesting to see AgN's program that actually iterates to the solution.
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(1) = 83.43201955000001#
dir(2) = -85.75353466#
FOR d = 1 TO 2
dir = dir(d)
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 "--"
NEXT
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
with the results:
x= .114381989608504 y= .993436842709792
Aim direction= 64.92641431087746
18.50560523912254 18.5056072763774
--
x= .0740469682395594 y=-.997254755062381
Aim direction=-76.70421283029224
-9.049321829707765 -9.049322178724935
--
|
Posted by Charlie
on 2003-11-23 12:07:20 |