diff options
-rw-r--r-- | main.lua | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -4,13 +4,14 @@ local function plot(f,x0,xn) local n = 30 x0 = x0 or G.inverseTransformPoint(0,0) xn = xn or G.inverseTransformPoint(G.getDimensions(),0) + local h = (xn-x0)/n local ps = {} - for x=x0,xn+h,h do + for i=0,n do + local x = x0 + i*h local y = f(x) table.insert(ps,x) table.insert(ps,y) - print(x,xn) end G.line(ps) end @@ -33,7 +34,7 @@ local function solve_for_A(r) return A end -local L = 20 +local L = 3 function love.wheelmoved(x,y) L = L + (y/5) end |