From 23cdd58faa0f9fe99a1ff3fdc1e8b4783f5293a7 Mon Sep 17 00:00:00 2001 From: Alexandre B A Villares <3694604+villares@users.noreply.github.com> Date: Mon, 25 Jan 2021 21:33:29 -0300 Subject: [PATCH] recovered from image I probably forgot to save and commit :( at least I had the image this time :) --- 2019/sketch_190130a/sketch_190130a.pyde | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/2019/sketch_190130a/sketch_190130a.pyde b/2019/sketch_190130a/sketch_190130a.pyde index e82f436e..75a533a8 100644 --- a/2019/sketch_190130a/sketch_190130a.pyde +++ b/2019/sketch_190130a/sketch_190130a.pyde @@ -3,12 +3,16 @@ def setup(): def draw(): background(200) - r = 200 + r = 100 p1 = PVector(200, 250) - p2 = PVector(mouseX, mouseY) - ellipse(p1.x, p1.y, r, r) + p2 = PVector(mouseX, 250) + ellipse(p1.x, p1.y, r * 2, r * 2) line(p1.x, p1.y, p2.x, p2.y) d = dist(p1.x, p1.y, p2.x, p2.y) theta = asin(r / d) beta = TWO_PI - HALF_PI - theta print(degrees(theta)) + x = cos(beta) * r + y = sin(beta) * r + line(p1.x, p1.y, p1.x - x, p1.y - y) + line(p2.x, p2.y, p1.x - x, p1.y - y)