Latest 1.0.0
Homepage https://github.com/dclelland/Degrad
License MIT
Platforms ios 8.0, requires ARC
Authors

Degrad is a microlibrary for working with angles. It provides functions from converting degrees to radians, and rectangular to polar coordinates.

Degrad works by implementing Degradable and Polrectable protocols on Float, Double, and CGFloat.

Examples

✓ Terse unit syntax


180.degrees
// 3.1415926535897931

Float.pi.radians
// 180

✓ Converter functions


deg2rad(90)
// 1.5707963267948966

rad2deg(π / 2)
// 90

rec2pol(x: 0, y: 1)
// (r = 1, θ = 1.5707963267948966)

pol2rec(r: 1, θ: 90°)
// (x = 0, y = 1)

✓ Fancy unicode degree symbol postfix operator (if you’re into that kind of thing)


45°
// 0.78539816339744828

Latest podspec

{
    "name": "Degrad",
    "version": "1.0.0",
    "summary": "A microlibrary for working with angles. Use the u00b0 symbol in your swift code.",
    "homepage": "https://github.com/dclelland/Degrad",
    "license": {
        "type": "MIT"
    },
    "authors": {
        "Daniel Clelland": "[email protected]"
    },
    "source": {
        "git": "https://github.com/dclelland/Degrad.git",
        "tag": "1.0.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "ios": {
        "source_files": "Degrad.swift"
    },
    "requires_arc": true
}

Pin It on Pinterest

Share This