I have two cross sections: one is a rectangular cross section in cartesian coordinates and the other is a semicircle of radius R (the bottom half of a circle) in cylindrical coordinates. I have an expression representing absolute value of the distance from an arbitrary point inside the rectangular cross section to the top of the rectangle. I am trying to get an analogous expression for my semi circle cross-section. By convention in both cross-sections at the bottom we have a height of $z=0$ and at the top we have the max height (for the rectangle this is $z=H$ and for the semi-circle we have $z=R$).
For the rectangular cross-section in cartesian coordinates:
The $z$-axis is oriented upwards, perpendicular to the bottom border. The $x$-axis is oriented out of the page, and the $y$-axis is parallel to the base directed towards the right. The height of this rectangular cross-section is a constant, $H$. If I take some arbitrary point $k = (x',y',z')$ inside of the rectangle, the absolute distance from the top is $H-z'$.
For the semi-circular cross-section in cylindrical coordinates:
This semi-circle has radius R and is the bottom half of a circle. I took the cylindrical coordinate system to be $(r,\varphi ,x)$, because it is easier to compare to the previous case. The $x$-axis (playing the role of the typical "z" height axis in cylindrical coordinates) is again oriented out of the page. The $r$ is the radial distance from the center point of the top border, and $\varphi$ is the angle that $r$ vector makes with the top border. If we take some arbitrary point inside the semi circle $k = (r',\varphi ', x')$ then the distance from the top border straight down to the point (obtained by using trig and the fact that $\sin(\varphi) = \sin(\pi-\varphi)$) is $r' \sin (\varphi ')$. This means the point $k$ would be $r' \sin (\varphi ')$ away from the top border. Is this the correct way to represent the distance from an arbitrary point to the top of my semi-circle? I know this is a silly question I just wanted to make sure that I didn't make a silly mistake. Cylindrical coordinates are not my strength. Thank you!
