summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2024-01-04 19:50:04 +0000
committerubq323 <ubq323@ubq323.website>2024-01-04 19:50:04 +0000
commit74dd8b6b857edcbeb12cbeca8c559b2ebbc2e79e (patch)
tree8a0a4445adcbf0294fcc009d10c8c65cf1b2c801
parent0814d3731bce2270f3471570f1f3bdb4f54c5495 (diff)
fix edges
-rw-r--r--main.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/main.lua b/main.lua
index ae9595c..0f224d2 100644
--- a/main.lua
+++ b/main.lua
@@ -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