CGPoint
public extension CGPoint
                - 
                  
                  
Rotate this point around a given point, by an angle given in degrees.
Declaration
Swift
func rotated(around inCenter: CGPoint, byDegrees inDegrees: CGFloat, precisionInDecimalPlaces inPrecision: UInt8? = nil) -> CGPointParameters
aroundAnother point, that is the “fulcrum” of the rotation.
byDegreesThe rotation angle, in degrees. 0 is no change. - is counter-clockwise, + is clockwise.
precisionInDecimalPlacesThe precision, in decimal places to the right of the decimal. This is optional, and, if omitted, uses full precision.
Return Value
The transformed point.
 - 
                  
                  
This was inspired by this SO answer. Rotate this point around a given point, by an angle given in radians.
Declaration
Swift
func rotated(around inCenter: CGPoint, byRadians inRadians: CGFloat, precisionInDecimalPlaces inPrecision: UInt8? = nil) -> CGPointParameters
aroundAnother point, that is the “fulcrum” of the rotation.
byRadiansThe rotation angle, in radians. 0 is no change. - is counter-clockwise, + is clockwise.
precisionInDecimalPlacesThe precision, in decimal places to the right of the decimal. This is optional, and, if omitted, uses full precision. The range is 0…14.
Return Value
The transformed point.
 
            View on GitHub