CGFloat

struct CGFloat
  • Mechanica

    Example:

    CGFloat(180).degreesToRadians -> π
    

    Declaration

    Swift

    public var degreesToRadians: CGFloat { get }
  • Mechanica

    Example:

    CGFloat(π).radiansToDegrees -> 180
    

    Declaration

    Swift

    public var radiansToDegrees: CGFloat { get }
  • Mechanica

    Returns the shortest angle between two angles. The result is always between -π and π.

    Example:

    CGFloat.shortestAngleInRadians(from: 0, to: 3π/2) -> -π/2
    

    Declaration

    Swift

    public static func shortestAngleInRadians(from first: CGFloat, to second: CGFloat) -> CGFloat