python 描點畫圓

#!/usr/bin/env python

#dawf a cirle and print the x,y

import math

center = [10.0,10.0]       #center point
rad = 10
sep = 2*math.pi/360    #sep use 1 angle

point = []

for angle in range(181):
    x =center[0] + rad * math.cos(sep*angle)
    y =center[1] + rad * math.sin(sep*angle)
    point.append((round(x,3),round(y,3))) #round function  save float with  x.xxx

print point
相關文章
相關標籤/搜索