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: 
The most efficient and accurate way to convert a Double between degrees and radians:

```
import Foundation

extension Double {
    var radians: Double { return Measurement(value: self, unit: UnitAngle.degrees).converted(to: UnitAngle.radians).value }
    var degrees: Double { return Measurement(value: self, unit: UnitAngle.radians).converted(to: UnitAngle.degrees).value }
}

```

The Foundation team at Apple addressed this problem long ago by developing a solution that surpasses all others:

[Measurements and Units - WWDC 2016, Session 238](https://devstreaming-cdn.apple.com/videos/wwdc/2016/238eemv232k9lp2px30/238/238_hd_measurements_and_units.mp4?dl=1)
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`.