Skip to content

Instantly share code, notes, and snippets.

@richy486
Created June 22, 2016 18:08
Show Gist options
  • Save richy486/883f241545b29a20bc823f3d8de85ce9 to your computer and use it in GitHub Desktop.
Save richy486/883f241545b29a20bc823f3d8de85ce9 to your computer and use it in GitHub Desktop.
// vector to radians
let radian = atan2(vector.y, vector.x)
// difference between two vectors
let difference = CGFloat.pi2 - abs(abs(radian1 - radian2) - CGFloat.pi2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment