PolarToCartesian (FB)ΒΆ
FUNCTION_BLOCK PolarToCartesian
This function block will change the polar coordinates of the two dimensional space \((r, \varphi) \in \mathbb{R_{0}^{+}} \times \left( -\pi, \pi\right]\) to Cartesian coordinates \((x,y) \in \mathbb{R^{2}}\), which are connected via:
\[ \begin{align}\begin{aligned}x = \cos(\varphi) \cdot r\\y = \sin(\varphi) \cdot r\end{aligned}\end{align} \]
- InOut:
Scope
Name
Type
Comment
Input
lrAngleLREALAngular coordinate \(\varphi\) (azimuth)
lrDistanceLREALRadius \(r\)
Output
lrXLREALX coordinate \(x\)
lrYLREALY coordinate \(y\)