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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM