Guest User

Untitled

a guest
Jan 17th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. N <- 6 # Cantidad de lados
  2. n <- 1:N # Vértices
  3. r <- 1 # radio (tamaño del polígono)
  4. theta <- 0 # Angulo de inclinación
  5. centro <- 0 # Coordenadas del centro
  6.  
  7. x = r * cos(2*pi*n/N + theta) + centro
  8. y = r * sin(2*pi*n/N + theta) + centro
  9.  
  10. plot(x, y, type="l")
  11. polygon(x, y, col="blue")
Add Comment
Please, Sign In to add comment