Last active
May 2, 2020 11:27
-
-
Save akshitzaveri/2b27bbd50ce39bb6bac53eb063c3a56b 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
private func getPoint(for angle: Int) -> CGPoint { | |
// 1 | |
let radius = Double(self.circleView.layer.cornerRadius) | |
// 2 | |
let radian = Double(angle) * Double.pi / Double(180) | |
// 3 | |
let newCenterX = radius * cos(radian) | |
let newCenterY = radius * sin(radian) | |
return CGPoint(x: newCenterX, y: newCenterY) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment