Construct a spiral by starting at
the origin of a coordinate system,
moving 1 unit to the right to the
point (1, 0), then turning left 45
degrees and moving ½ unit, then
turning left 45 degrees and moving
⅓ unit, turning left 45 degrees and
moving ¼ unit, etc.
What are the
(x, y) coordinates of the limiting
point of this spiral?
uVec=double.empty(0,2);
for angle=0:45:360-45
uVec(end+1,1)=cosd(angle);
uVec(end,2)=sind(angle);
end
pt=[0,0]; modstep=1;
for step=1:400000000
modstep=mod(step+7,8)+1;
pt=pt+uVec(modstep,:)./step;
if step>399999991
disp(pt)
end
end
goes through 400,000,000 iterations. The last 9 locations arrived at are:
x y
1.02212090179111 0.643960195751146
1.02212090429111 0.643960195751146
1.02212090605887 0.643960197518913
1.02212090605887 0.643960200018913
1.02212090429111 0.64396020178668
1.02212090179111 0.64396020178668
1.02212090002334 0.643960200018913
1.02212090002334 0.643960197518913
1.02212090179111 0.643960195751146
so (1.0221209, 0.6439602) is a good approximation.
|
Posted by Charlie
on 2024-12-05 08:15:01 |