Determine the Transformation from Cylindrical to Rectangular coordinates

Click For Summary

Discussion Overview

The discussion centers on the transformation from cylindrical coordinates to rectangular (Cartesian) coordinates, specifically addressing the determination of the angle \(\varphi\) in cylindrical coordinates and the challenges associated with using the arctangent function to define this angle. The scope includes mathematical reasoning and technical explanations related to coordinate transformations.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant notes that in cylindrical coordinates, \(\varphi\) is typically defined within the range \([0, 2\pi)\) and raises concerns about using \(\text{arctg}(\frac{y}{x})\) due to its limited range of \(-\frac{\pi}{2}\) to \(\frac{\pi}{2}\).
  • Another participant suggests that to obtain the correct \(\varphi\) values, one must avoid the condition where \(x=0\), indicating it as a singular point.
  • A different participant questions the necessity of having \(x=0\) to determine \(\varphi\), expressing confusion over the definition and its limitations.
  • One contributor explains that arctan is periodic with a period of \(\pi\) and suggests using the signs of \(x\) and \(y\) to determine the correct quadrant for \(\varphi\).
  • Another participant elaborates that using \(\arctan(y/x)\) does not uniquely determine \(\varphi\) because both \((x,y)\) and \((-x,-y)\) yield the same value for \(y/x\) but differ in \(\varphi\) by \(\pi\). They provide a piecewise function to define \(\varphi\) based on the signs of \(x\) and \(y\).
  • A participant shares their experience with a rotary encoder design, detailing an algorithm that determines \(\varphi\) based on the magnitudes of \(x\) and \(y\) and emphasizes the importance of handling quadrants based on the signs of these variables, while also mentioning singularities.

Areas of Agreement / Disagreement

The discussion reveals multiple competing views regarding the determination of \(\varphi\) in cylindrical coordinates, with no consensus reached on the best approach to handle the singularities and the limitations of the arctangent function.

Contextual Notes

Participants highlight limitations related to the definitions used for \(\varphi\) and the handling of singular points, particularly when \(x\) or \(y\) equals zero. The discussion does not resolve these mathematical complexities.

LagrangeEuler
Messages
711
Reaction score
22
In physics is usually defined that in cylindrical coordinates ##\varphi \in [0,2 \pi)##. In relation with Deckart coordinates it is usually written that
\varphi=\text{arctg}(\frac{y}{x}).
Problem is of course because arctg takes values from ##-\frac{\pi}{2}## to ##\frac{\pi}{2}##. What is the best way to solve this?
 

Attachments

  • Marej Spiegel cc.png
    Marej Spiegel cc.png
    24.4 KB · Views: 265
Last edited by a moderator:
Physics news on Phys.org
To get those ##\phi## values you'd have to have ##x=0## so avoid that condition ie consider it a singular point.
 
Why do I need to have ##x=0## to get those values of ##\varphi##? I do not understand? I cannot have those values of ##\varphi## with this definition. That is the problem.
 
arctan is periodic with period ##\pi##. To get the correct quadrant, use the signs of x and y. y positive is first or second quadrant and x positive is first or fourth quadrant.
 
  • Like
Likes   Reactions: pasmith
You can't use arctan(y/x) to uniquely determine \phi; both (x,y) and (-x,-y) have the same value of y/x but have \phi values which differ by \pi. You must therefore also consider the signs of x and y:
<br /> \phi(x,y) = \begin{cases}<br /> \arctan\left (\frac yx\right) &amp; x &gt; 0, y \geq 0 \\<br /> \arctan\left (\frac yx\right) + \pi &amp; x &lt; 0 \\<br /> \arctan\left (\frac yx\right) + 2\pi &amp; x &gt; 0, y &lt; 0 \\<br /> \frac{\pi}{2} &amp; x = 0, y &gt; 0 \\<br /> \frac{3\pi}{2} &amp; x = 0 , y &lt; 0 \\<br /> \mbox{undefined} &amp; x = 0, y = 0<br /> \end{cases}<br />
 
  • Like
Likes   Reactions: Delta2
I had the same problem when designing an inexpensive rotary encoder. Since the algorithm had to be implemented in hardware, I used the following algorithm set:\lvert x \rvert &gt; \lvert y\rvert ? \varphi_{0}=\arctan\frac{\lvert y\rvert}{\lvert x\rvert} :\varphi_{0}=\frac{\pi}{2}-\arctan\frac{\lvert x\rvert}{\lvert y\rvert} (sorry for the "C" terminology, but if-then-else looks silly in Tex). From there on it was just a matter of determining the quadrant based on the signs of x and y. And in our case x and y could not be 0 at the same time (but in another case I had to deal with such singularities - and decided not to update anything when passing through a singularity).
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 18 ·
Replies
18
Views
19K