---
url: /dyad/dev/stdlib/BlockComponents/components/Math.PolarToRectangular.md
description: >-
  Dyad Math.PolarToRectangular docs.  Converts polar coordinates to rectangular
  coordinates.
---

# `Math.PolarToRectangular` {#Math.PolarToRectangular}

Converts polar coordinates to rectangular coordinates.

Computes the rectangular (Cartesian) representation from polar inputs:

$$y\_{\text{re}} = u\_{\text{abs}} \cdot \cos(u\_{\text{arg}})$$

$$y\_{\text{im}} = u\_{\text{abs}} \cdot \sin(u\_{\text{arg}})$$

## Usage {#Usage}

`BlockComponents.Math.PolarToRectangular()`

## Connectors {#Connectors}

* `u_abs` - This connector represents a real signal as an input to a component ([`RealInput`](/stdlib/Dyad/connectors/RealInput#RealInput))

* `u_arg` - This connector represents a real signal as an input to a component ([`RealInput`](/stdlib/Dyad/connectors/RealInput#RealInput))

* `y_re` - This connector represents a real signal as an output from a component ([`RealOutput`](/stdlib/Dyad/connectors/RealOutput#RealOutput))

* `y_im` - This connector represents a real signal as an output from a component ([`RealOutput`](/stdlib/Dyad/connectors/RealOutput#RealOutput))

## Behavior {#Behavior}

$$ \begin{align}
\mathtt{y_re}\left( t \right) &= \cos\left( \mathtt{u_arg}\left( t \right) \right) ~ \mathtt{u_abs}\left( t \right) \\
\mathtt{y_im}\left( t \right) &= \sin\left( \mathtt{u_arg}\left( t \right) \right) ~ \mathtt{u_abs}\left( t \right)
\end{align}
$$

## Source {#Source}

````dyad
"""
Converts polar coordinates to rectangular coordinates.

Computes the rectangular (Cartesian) representation from polar inputs:

```math
y_{\\text{re}} = u_{\\text{abs}} \\cdot \\cos(u_{\\text{arg}})
```
```math
y_{\\text{im}} = u_{\\text{abs}} \\cdot \\sin(u_{\\text{arg}})
```
"""
component PolarToRectangular
  "Absolute value (length) of the polar representation"
  u_abs = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -100, "y1": 110, "x2": 0, "y2": 210, "rot": 0}
      },
      "tags": []
    }
  }
  "Angle of the polar representation"
  u_arg = RealInput(units = "rad") {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -100, "y1": 730, "x2": 0, "y2": 830, "rot": 0}
      },
      "tags": []
    }
  }
  "Real part of the rectangular representation"
  y_re = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 1000, "y1": 120, "x2": 1100, "y2": 220, "rot": 0}
      },
      "tags": []
    }
  }
  "Imaginary part of the rectangular representation"
  y_im = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 1000, "y1": 730, "x2": 1100, "y2": 830, "rot": 0}
      },
      "tags": []
    }
  }
relations
  "Computes the real part from polar components"
  y_re = u_abs * cos(u_arg)
  "Computes the imaginary part from polar components"
  y_im = u_abs * sin(u_arg)
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
    "icons": {"default": "dyad://BlockComponents/PolarToRectangular.svg"}
  }
}
end
````

````dyad
"""
Converts polar coordinates to rectangular coordinates.

Computes the rectangular (Cartesian) representation from polar inputs:

```math
y_{\\text{re}} = u_{\\text{abs}} \\cdot \\cos(u_{\\text{arg}})
```
```math
y_{\\text{im}} = u_{\\text{abs}} \\cdot \\sin(u_{\\text{arg}})
```
"""
component PolarToRectangular
  "Absolute value (length) of the polar representation"
  u_abs = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -100, "y1": 110, "x2": 0, "y2": 210, "rot": 0}
      },
      "tags": []
    }
  }
  "Angle of the polar representation"
  u_arg = RealInput(units = "rad") {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -100, "y1": 730, "x2": 0, "y2": 830, "rot": 0}
      },
      "tags": []
    }
  }
  "Real part of the rectangular representation"
  y_re = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 1000, "y1": 120, "x2": 1100, "y2": 220, "rot": 0}
      },
      "tags": []
    }
  }
  "Imaginary part of the rectangular representation"
  y_im = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 1000, "y1": 730, "x2": 1100, "y2": 830, "rot": 0}
      },
      "tags": []
    }
  }
relations
  "Computes the real part from polar components"
  y_re = u_abs * cos(u_arg)
  "Computes the imaginary part from polar components"
  y_im = u_abs * sin(u_arg)
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
    "icons": {"default": "dyad://BlockComponents/PolarToRectangular.svg"}
  }
}
end
````

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses

* Tests
  * [`Constant`](Math.PolarToRectangular.md)

  * [`PolarToRectangular`](Math.PolarToRectangular.md)

  * [`PolarToRectangular`](Math.PolarToRectangular.md)

  * [`Sine`](Math.PolarToRectangular.md)
