Undergrad Determine the Transformation from Cylindrical to Rectangular coordinates

Click For Summary
SUMMARY

The transformation from cylindrical to rectangular coordinates involves determining the angle φ using the arctangent function, specifically φ = arctan(y/x). However, this function is limited to values between -π/2 and π/2, creating ambiguity in quadrant determination. To resolve this, the signs of x and y must be considered, leading to a piecewise function for φ that accounts for all quadrants. This approach is essential for applications such as rotary encoders, where accurate angle calculation is critical.

PREREQUISITES
  • Understanding of cylindrical and rectangular coordinate systems
  • Familiarity with trigonometric functions, particularly arctangent
  • Knowledge of quadrant determination based on Cartesian coordinates
  • Basic programming concepts for implementing algorithms in hardware
NEXT STEPS
  • Study the mathematical properties of the arctangent function and its periodicity
  • Research algorithms for quadrant determination in coordinate transformations
  • Explore the implementation of angle calculation algorithms in embedded systems
  • Learn about handling singularities in mathematical computations
USEFUL FOR

Students and professionals in physics, engineers working with coordinate transformations, and developers designing hardware algorithms for applications like rotary encoders.

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: 250
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 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 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).
 
Relativistic Momentum, Mass, and Energy Momentum and mass (...), the classic equations for conserving momentum and energy are not adequate for the analysis of high-speed collisions. (...) The momentum of a particle moving with velocity ##v## is given by $$p=\cfrac{mv}{\sqrt{1-(v^2/c^2)}}\qquad{R-10}$$ ENERGY In relativistic mechanics, as in classic mechanics, the net force on a particle is equal to the time rate of change of the momentum of the particle. Considering one-dimensional...

Similar threads

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