Advertisement
Guest User

Untitled

a guest
Jun 20th, 2018
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. from math import *
  2. def ptoc(tupla):
  3.     r=tupla[1]
  4.     angulo=tupla[2]
  5.     x=r*cos(angulo)
  6.     y=r*sin(angulo)
  7.     return(('C',x,y))
  8.  
  9. from math import *
  10. def poligono(r,n):
  11.     lista=[]
  12.     angulo=0
  13.     incremento=(2*pi)/n
  14.     for i in range(n):
  15.         angulo=angulo+incremento
  16.         lista.append(('P',r,angulo))
  17.     lista2=[]
  18.     for elemento in lista:
  19.         j=ptoc(elemento)
  20.         lista2.append(j)    
  21.     return(lista2)
  22.    
  23.    
  24. def funcao1(lista):
  25.     lista2=[]
  26.     for i in set(lista):
  27.         lista2.append((i,lista.count(i)))
  28.     return(lista2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement