arcLine
This function takes XY coordinates as middle point of arc, starting and ending angles (clockwise), radius and amount of arc segments (optional). It returns the line with given prperties.
Source
local function getArcLine (x, y, radius, angle1, angle2, segments)
local dAngle = (angle2-angle1)%(2*math.pi)
segments = segments or math.floor(dAngle*radius/16)
print ('segments', segments)
dAngle = dAngle / segments
local line = {}
for i = 0, segments do
local x1 = x + radius*math.cos (angle1 + i*dAngle)
local y1 = y + radius*math.sin (angle1 + i*dAngle)
table.insert (line, x1)
table.insert (line, y1)
end
return line
end