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