diff --git a/other/README.md b/other/README.md index b9b8f4b..5695dd0 100644 --- a/other/README.md +++ b/other/README.md @@ -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. \ No newline at end of file +- **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. \ No newline at end of file diff --git a/other/Rotation_Calculator/Rotation_Calculator.pyde b/other/Rotation_Calculator/Rotation_Calculator.pyde new file mode 100644 index 0000000..3d5c636 --- /dev/null +++ b/other/Rotation_Calculator/Rotation_Calculator.pyde @@ -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) diff --git a/other/Rotation_Calculator/sketch.properties b/other/Rotation_Calculator/sketch.properties new file mode 100644 index 0000000..2456b0a --- /dev/null +++ b/other/Rotation_Calculator/sketch.properties @@ -0,0 +1,2 @@ +mode=Python +mode.id=jycessing.mode.PythonMode