From 3b4e975acfd7701c422a800896d39287e0871c96 Mon Sep 17 00:00:00 2001 From: Alexandre B A Villares Date: Sun, 22 Apr 2018 23:41:40 -0300 Subject: [PATCH] readme 112 --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 559128c7..77c32ed8 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,15 @@ If you enjoy this, make a small donation [here](https://www.paypal.com/cgi-bin/w Hexagons! ```python - +def hexagon(x, y, r): + with pushMatrix(): + translate(x, y) + beginShape() + for i in range(6): + vx = cos(i * TWO_PI /6) * r + vy = sin(i * TWO_PI /6) * r + vertex(vx, vy) + endShape(CLOSE) ``` ----