Just for curiosity - why do you use so many local keywords in your code? Shouldn't be better to write it like this?
screen (640,480,0,"Rotation")
setframetimer (120)
local v3, v4 = 0, 0
local x, y, x2, y2, x3, y3, x4, y4, x5, y5
while 1 do
for v=0,2*math.pi,0.008 do
cls()
key = getkey()
v3 = v3+0.003
v4 = v4 +0.01
if v3 >= 2*math.pi then
v3=0.003
end
if v4 >= 2*math.pi then
v4=0.01
end
x= cos (v3) * 180 + (cos(v) * -20 +320)
y= sin (v3) * 180 + (sin(v) * -20+240)
x2= cos (v3) * 180 + (cos(v) * 20 +320)
y2= sin (v3) * 180 + (sin(v) * 20+240)
x3= cos (v3) * 180 + (cos(v) * 0 +320)
y3= sin (v3) * 180 + (sin(v) * 0 +240)
x4 = cos (v) * 20+320
y4 = sin (v) * 20+240
x5 = cos (v4) * 80 + 320
y5 = sin (v4) * 80 +240
colour (0,0,255)
fillcircle (x3,y3,20)
colour (0,0,0)
line (x,y,x2,y2)
colour (255,255,0)
fillcircle (x4,y4,40)
colour (200,200,200)
fillcircle (x5,y5,10)
if key==27 then
os.exit()
end
sync()
end
end
EDIT: There is also no need to check key pressed twice.