Re: Rotate
Posted: Thu Apr 13, 2017 11:55 pm
Simple. With orbit center (cx,cy), orbit radii (rx,ry) and angle, calculate the new location of the object.
Code: Select all
function orbit( cx, cy, rx, ry, an )
local x = rx * math.cos( an ) + cx
local y = ry * math.sin( an ) + cy
return x, y
end