Question: I am trying to convert this `Obj-C` code to `Swift` code but I don't know what the equivalent of this code should be ?

```
#define DEGREES_TO_RADIANS(degrees)((M_PI * degrees)/180)

```

I googled and found [this](https://stackoverflow.com/questions/24325477/how-to-use-a-objective-c-define-from-swift)

But I don't understand how to convert that in Swift in my case?

Answer: 
You're no longer limited to ASCII characters when creating variable names, so how about this using π (alt-p):

```
typealias RadianAngle = CGFloat

let π = RadianAngle(M_PI)
let π_x_2 = RadianAngle(M_PI * 2)
let π_2 = RadianAngle(M_PI_2)
let π_4 = RadianAngle(M_PI_4)

extension RadianAngle {
    var degrees: CGFloat {
        return self * 180 / π
    }
    init(degrees: Int) {
        self = CGFloat(degrees) * π / 180
    }
}

```

Example usage:

```
let quarterCircle = RadianAngle(degrees: 90)
print("quarter circle = \(quarterCircle) radians")
// quarter circle = 1.5707963267949 radians

let halfCircle = π
print("half circle = \(halfCircle.degrees) degrees")
// half circle = 180.0 degrees

```
If it is ok to import `SwiftUI` or if you are already using it you could use the `Angle` type to convert between angle units, eg.:

```
import SwiftUI

let radians = Angle(degrees: 45).radians

```

This will convert from `Double` to `Double`.