---
title: "polarToRectangular(_:)"
framework: accelerate
role: symbol
role_heading: Type Method
path: "accelerate/vdsp/polartorectangular(_:)-jgv8"
---

# polarToRectangular(_:)

Returns double-precision rectangular coordinates converted from polar coordinates.

## Declaration

```swift
static func polarToRectangular<U>(_ polarCoordinates: U) -> [Double] where U : AccelerateBuffer, U.Element == Double
```

## Parameters

- `polarCoordinates`: The source polar coordinates.

## Discussion

Discussion The function calls the underlying vDSP_rectD function to convert the input angle-radius pairs to Cartesian x-y pairs. The following code shows how to convert an angle-radius pair (with the angle specified in degress) to its rectangular equivalent:     let angle = Measurement(value: 45,                             unit: UnitAngle.degrees)         .converted(to: UnitAngle.radians)         .value

let radius = sqrt(25.0 + 25.0)

let polarCoordinates = [radius, angle]

let rectangularCoordinates = vDSP.polarToRectangular(polarCoordinates)          // Prints "[5.0, 5.0]".     print(rectangularCoordinates)

## See Also

### Converting polar coordinates to rectangular coordinates

- [polarToRectangular(_:)](accelerate/vdsp/polartorectangular(_:)-8upqj.md)
- [convert(polarCoordinates:toRectangularCoordinates:)](accelerate/vdsp/convert(polarcoordinates:torectangularcoordinates:)-3vpjf.md)
- [convert(polarCoordinates:toRectangularCoordinates:)](accelerate/vdsp/convert(polarcoordinates:torectangularcoordinates:)-22zz0.md)
