LIBRARY
Math.PolarToRectangular
Converts polar coordinates to rectangular coordinates.
Computes the rectangular (Cartesian) representation from polar inputs:
Usage
BlockComponents.Math.PolarToRectangular()
Connectors
u_abs- This connector represents a real signal as an input to a component (RealInput)u_arg- This connector represents a real signal as an input to a component (RealInput)y_re- This connector represents a real signal as an output from a component (RealOutput)y_im- This connector represents a real signal as an output from a component (RealOutput)
Behavior
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"}
}
}
endFlattened 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"}
}
}
endTest Cases
No test cases defined.
Related
Examples
Experiments
Analyses
Tests