Question: Is it possible to change a setting, property, etc in Swift for iOS so that it assumes degrees for trigonometry calculations rather than radians?

For example `sin(90)` would be evaluated to `1`.

I have:

```
let pi = 3.14 
var r2d = 180.0/pi
var d2r = pi/180

```

... but the conversions are getting really involved for some of the long trig equations.

Answer: 
As already said in the other answers, there are no trigonometric functions in the standard library that take the arguments in degrees.

If you define your own function then you can use `__sinpi()`,
`__cospi()`, etc ... instead of multiplying by π:

```
// Swift 2:
func sin(degrees degrees: Double) -> Double {
    return __sinpi(degrees/180.0)
}

// Swift 3:
func sin(degrees: Double) -> Double {
    return __sinpi(degrees/180.0)
}

```

From the [`__sinpi` manual page](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/__sinpi.3.html) (emphasis added):

> 
> The 
>  \_\_sinpi()
>  function returns the sine of pi times x (measured in
>  radians). This can be computed **more accurately** than sin(M\_PI \* x), because it can implicitly use as many bits of pi as are necessary to
>  deliver a well-rounded result, instead of the 53-bits to which M\_PI is limited. For large x it may
>  also be **more efficient,** as the argument reduction involved is significantly simpler.
> 
> 
> 

`__sinpi()` and the related functions are non-standard, but
 available on iOS 7/OS X 10.9 and later.

**Example:**

```
sin(degrees: 180.0)       // 0

```

gives an exact result, in contrast to:

```
sin(180.0 * M_PI/180.0) // 1.224646799147353e-16

```

---

And just for fun: This is how you can define the degree-based sine function for all floating point types, including `CGFloat` with
function overloading (now updated for Swift 3):

```
func sin(degrees: Double) -> Double {
    return __sinpi(degrees/180.0)
}

func sin(degrees: Float) -> Float {
    return __sinpif(degrees/180.0)
}

func sin(degrees: CGFloat) -> CGFloat {
    return CGFloat(sin(degrees: degrees.native))
}

```

In the last variant, the compiler automatically infers from the 
actual type of `degrees.native` which function to call, so that this
works correctly on both 32-bit and 64-bit platforms.
Seeing as I use trig a lot. I found the best way was to define some functions outside of the `class ViewController`. 

If you define them in any one of your .swift files just below the `imports` and just above the `class ViewController:UIViewController { }` then you can call them throughout the whole project.

So for the sin function, I named it `sindeg()` standing for "sin degrees".

```
func sindeg(degrees: Double) -> Double {
    return sin(degrees * M_PI / 180.0)
    }

```

So this takes your degrees number converts it, solves it and returns as degrees.
So all you need to do is type `sindeg(45.5)` and the result would = `0.71325045.`

Here is the others:

```
func cosdeg(degrees: Double) -> Double {
    return cos(degrees * M_PI / 180.0)
}
func tandeg(degrees: Double) -> Double {
    return tan(degrees * M_PI / 180.0)
}

```

arcTan here is very similar, only difference is the return formula

```
 func atanDegree(degrees: Double) -> Double {
        return atan(degrees) * 180 / M_PI
    }

```

This one is just to convert a radian value to degrees. Takes in radians, converts, returns back degrees.

```
func Convert(radians: Double) -> Double {
    return radians * 180.0 / M_PI
}

```