Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local points = {}
- local height = love.graphics.getHeight()
- local width = love.graphics.getWidth()
- local x = 0
- local y = 0
- local R = 110
- local r = 60
- local p = 100
- local iteration = 1/25
- local function Fx(t)
- x = x + iteration
- return ((R-r)*math.cos(t)+p*math.cos((R-r)*t/r)) + width/2
- end
- local function Fy(t)
- y = y - iteration
- return ((R-r)*math.sin(t)-p*math.sin((R-r)*t/r)) + height/2
- end
- function love.draw()
- table.insert(points,{Fx(x),Fy(y),math.sin(x)*(100/2)+255/2})
- for i, v in pairs(points) do
- love.graphics.point(v[1],v[2])
- if points[i-1] ~= nil then
- love.graphics.setColor(v[3],v[3],v[3])
- love.graphics.line(v[1],v[2],points[i-1][1],points[i-1][2])
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement