Module:Sandbox/Flarn2006/circle

local p = {}

function p.circle(frame) local output = ' \n' local r = tonumber(frame.args[1]) / 2 for i=-r,r do		local y = i/r for j=-r,r do			local x = j/r if x*x + y*y > 1 then output = output..' ' else output = output..'' end end output = output..'\n' end output = output..' ' return output end

function p.circles(frame) local start_diameter = tonumber(frame.args[1]) local end_diameter = tonumber(frame.args[2]) local step = tonumber(frame.args[3] or 1) local output = '' for d=start_diameter,end_diameter,step do		output = output..'$$d='..tostring(d)..'$$' output = output..p.circle({args={d}}) end return output end

return p