Skip to content

Instantly share code, notes, and snippets.

@ifarbod
Created February 20, 2017 21:32
Show Gist options
  • Save ifarbod/6dbdcbda48febd41251e4dc66ef07a21 to your computer and use it in GitHub Desktop.
Save ifarbod/6dbdcbda48febd41251e4dc66ef07a21 to your computer and use it in GitHub Desktop.
function findRotation(x1,y1,x2,y2)
local t = -math.deg(math.atan2(x2-x1,y2-y1))
if t < 0 then t = t + 360 end;
return t;
end
@ifarbod
Copy link
Author

ifarbod commented Feb 20, 2017

From love2d wiki.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment