Source

wd_pys60 / wd_illusion_func.py

from graphics import *
import e32
import appuifw
canvas=appuifw.Canvas()
appuifw.app.body=canvas
img=Image.new((320,240))
import math
def draw_arc_point(R,alpha,center=(0,0)):
    a=R*math.cos(alpha)
    b=R*math.sin(alpha)
    return (int(center[0]+a),int(center[1]+b))
print draw_arc_point(100,math.pi)
piece=36
for i in range(-piece,piece):
    img.clear(0)
    img.line(((120,160),draw_arc_point(50,math.pi*i/piece,(120,160))),0x00ff00,width=2)
    canvas.blit(img)
    e32.ao_sleep(0.02)
L=e32.Ao_lock()
appuifw.app.exit_key_handler=L.signal
#L.wait()