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

 

posted @ 2017-09-17 17:01  学习时光  阅读(2123)  评论(0)    收藏  举报