From 0c3cf4395c350b37a19da299e3ad286a2c3397e6 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Fri, 5 Jan 2024 18:49:34 +0000 Subject: positions --- main.lua | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/main.lua b/main.lua index 3ffd33b..ccb8100 100644 --- a/main.lua +++ b/main.lua @@ -280,21 +280,21 @@ function PortGraph.remove_conn(self,p1,p2) end local pg = PortGraph:make() -local i = 1 -local S = math.sqrt(3) -for q = -3,2 do - for r = -3,3 do - local x = q*S + r*S/2 - local y = r*3/2 - pg:add(x/4,y/4,i) - i=i+1 - end -end --- local n = 10 --- for i = 1,n do --- local theta = tau * i/n --- pg:add(math.cos(theta), math.sin(theta), i) +-- local i = 1 +-- local S = math.sqrt(3) +-- for q = -3,2 do +-- for r = -3,3 do +-- local x = q*S + r*S/2 +-- local y = r*3/2 +-- pg:add(x/4,y/4,i) +-- i=i+1 +-- end -- end +local n = 10 +for i = 1,n do + local theta = tau * i/n + pg:add(math.cos(theta), math.sin(theta), i) +end function love.mousepressed(x,y,b) local ok, err = pcall(pg.click, pg, b) -- cgit v1.2.3