diff options
-rw-r--r-- | catenary.lua | 5 | ||||
-rw-r--r-- | main.lua | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/catenary.lua b/catenary.lua index abe18e1..70e128c 100644 --- a/catenary.lua +++ b/catenary.lua @@ -71,6 +71,11 @@ local function catenary(x1,y1, x2,y2, L) y1,y2 = y2,y1 end + if math.abs(x1-x2) < 0.0001 then + x1 = x1 - 0.01 + x2 = x2 + 0.01 + end + local f = catenary0(x1,y1,x2,y2,L) return plot(f, x1,x2) end @@ -44,7 +44,6 @@ end ports[3].wires = {ports[6]} ports[5].wires = {ports[7],ports[2]} - local function wire_color(n) local phi = (1+math.sqrt(5))/2 local h = (360*phi*n)%360 |