Skip to content

Instantly share code, notes, and snippets.

@cmittendorf
Created June 12, 2016 08:19
Show Gist options
  • Save cmittendorf/e099106ba8efbeda8be27af8a5697cbc to your computer and use it in GitHub Desktop.
Save cmittendorf/e099106ba8efbeda8be27af8a5697cbc to your computer and use it in GitHub Desktop.
Extend CGFloat to calculate the radians from its value.
extension CGFloat {
var radians: CGFloat {
let degree = Double(self)
return CGFloat(degree * M_PI / 180.0)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment