Last active
April 16, 2024 10:27
-
-
Save bittz/a618c95edd78de5d59d3 to your computer and use it in GitHub Desktop.
Convert degrees to radians / radians to degrees in Swift.
This file contains 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
import CoreGraphics | |
func degreesToRadians(degrees: CGFloat) -> CGFloat { | |
return degrees * CGFloat(M_PI) / 180 | |
} | |
func radiansToDegress(radians: CGFloat) -> CGFloat { | |
return radians * 180 / CGFloat(M_PI) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there any limits to input of these functions?