Created
June 22, 2016 18:08
-
-
Save richy486/883f241545b29a20bc823f3d8de85ce9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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