Rotational Calculator project

This commit is contained in:
Xevion
2019-10-17 13:33:43 -05:00
parent 4291b89d08
commit c707d83ced
3 changed files with 34 additions and 1 deletions

View File

@@ -18,4 +18,6 @@ Other sketches without any specific purpose. If enough fit into a specific categ
- **Graph-Theory** - A simple project closely mimicing the particle.js library.
- **Old_Lines** - A short script connecting your current mouse position to that of yours moments ago.
- **Old_Lines** - A short script connecting your current mouse position to that of yours moments ago.
- **Rotating_Calculator** - Displays how Processing.py calculates the final position of an object given a rotational value. Mostly a test for me, trying to understand why some of my projects would rotate in strange and confusing ways.

View File

@@ -0,0 +1,29 @@
def setup():
size(500, 500)
def drawLine(i):
stroke(0)
fill(0)
translate(width/2, height/2)
rotate(radians(i))
line(0, 0, 240, 0)
textSize(15)
text(i, 240, 0)
resetMatrix()
i = 0
def draw():
background(204)
global i
i += 1
i = i % 360
if i % 90 == 0:
fill(255, 0, 0)
else:
fill(0)
textAlign(CENTER, CENTER)
textSize(40)
text(str(i), 500-40, 500-20)
drawLine(i)
for x in range(0, 360, 15):
drawLine(x)

View File

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