!linkpres0a1.bas animation
option arithmetic native
set window -400,800,-100,1100

set line width 2
let cr=100
let cL=600
let P=300
let k=100
let r=280
let L=300
let Lr=380

let alpha=170*pi/180
let beta=150*pi/180
for i=0 to 10
for zz=0 to 2*pi step pi/180
set draw mode hidden
clear

let Lz=zz+beta
let x=Lr*sin(Lz)
let y=Lr*cos(Lz)
let LL=sqr(x^2+(y+k)^2)
let d=acos((r^2+LL^2-L^2)/2/r/LL)
let e=acos((Lr^2+LL^2-k^2)/2/Lr/LL)
set line color 3
plot lines:x,y+cL+k;0,cL+k

if x>=0 then let z=Lz+d-e
if x<0 then let z=Lz+d+e
let xr=r*sin(z)
let yr=r*cos(z)
plot lines:xr,yr+cL;0,cL
set line color 4
plot lines:xr,yr+cL;x,y+cL+k
set line color 1
let th=z+alpha
let xc=cr*sin(th)
let yc=cr*cos(th)+cL
let g=asin(cr/cL*sin(th))
let yy=cr+cL+cr*cos(th)-cL*cos(g)
draw slide with scale(4)*shift(0,yy)
plot lines:xc,yc;0,cL
plot lines:xc,yc;0,yy
plot points:zz*100,sqr((xr-x)^2+(yr-k-y)^2)
set draw mode explicit

next zz
next i
END
external picture slide
set area color 8
OPTION ARITHMETIC NATIVE
plot area:-20,-20;20,-20;20,+20;-20,+20;-20,-20
end picture