equilateral triangle sketch

This commit is contained in:
Xevion
2019-10-21 13:42:10 -05:00
parent d68bd1988a
commit b14d7d703e
3 changed files with 36 additions and 1 deletions

View File

@@ -0,0 +1,31 @@
def setup():
size(750, 750)
noLoop()
def equiTriangle(center, side):
altitude = side * (sqrt(3) / 2.0)
AM = (2.0/3.0) * altitude
BF = (1.0 / 2.0) * side
FM = (1.0 / 3.0) * altitude
a = (center[0], center[1] + AM)
b = (center[0] - BF, center[1] - FM)
c = (center[0] + BF, center[1] - FM)
return a, b, c
i = 0
def draw():
global i
i += 1
# background(204)
translate(width / 2.0, height / 2.0)
rotate(radians(i))
a, b, c = equiTriangle((0, 0), i)
triangle(a[0], a[1], b[0], b[1], c[0], c[1])
def mouseClicked():
loop()

View File

@@ -0,0 +1,2 @@
mode=Python
mode.id=jycessing.mode.PythonMode

View File

@@ -6,4 +6,6 @@ All my projects attempting to create vivid or interesting visuals using the Proc
## Sketches
- **CircleIntersection** Plots circles in places where others aren't, expoonentially becoming slower and slower with each successfully located spot. Somewhat buggy and needs tuning to become much faster using a better algorithm, and probably better methods for deciding where spots are (less random, more organized manner).
- **CircleIntersection** Plots circles in places where others aren't, expoonentially becoming slower and slower with each successfully located spot. Somewhat buggy and needs tuning to become much faster using a better algorithm, and probably better methods for deciding where spots are (less random, more organized manner).
- **EquilateralTriangle** Places squares in increasing size whilst rotating.