Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Cylindrical coordinate system
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Coordinate system conversions== The cylindrical coordinate system is one of many three-dimensional coordinate systems. The following formulae may be used to convert between them. ===Cartesian coordinates=== For the conversion between cylindrical and Cartesian coordinates, it is convenient to assume that the reference plane of the former is the Cartesian {{mvar|xy}}-plane (with equation {{math|''z'' {{=}} 0}}), and the cylindrical axis is the Cartesian {{mvar|z}}-axis. Then the {{mvar|z}}-coordinate is the same in both systems, and the correspondence between cylindrical {{math|(''ρ'', ''φ'', ''z'')}} and Cartesian {{math|(''x'', ''y'', ''z'')}} are the same as for polar coordinates, namely <math display="block"> \begin{align} x &= \rho \cos \varphi \\ y &= \rho \sin \varphi \\ z &= z \end{align} </math> in one direction, and <math display="block">\begin{align} \rho &= \sqrt{x^2+y^2} \\ \varphi &= \begin{cases} \text{indeterminate} & \text{if } x = 0 \text{ and } y = 0\\ \arcsin\left(\frac{y}{\rho}\right) & \text{if } x \geq 0 \\ -\arcsin\left(\frac{y}{\rho}\right) + \pi & \mbox{if } x < 0 \text{ and } y \ge 0\\ -\arcsin\left(\frac{y}{\rho}\right) - \pi & \mbox{if } x < 0 \text{ and } y < 0 \end{cases} \end{align}</math> in the other. The [[arcsine]] function is the inverse of the [[sine]] function, and is assumed to return an angle in the range {{math|[−{{sfrac|π|2}}, +{{sfrac|π|2}}]}} = {{math|[−90°, +90°]}}. These formulas yield an azimuth {{mvar|φ}} in the range {{math|[−180°, +180°]}}. By using the [[arctangent]] function that returns also an angle in the range {{math|[−{{sfrac|π|2}}, +{{sfrac|π|2}}]}} = {{math|[−90°, +90°]}}, one may also compute <math>\varphi</math> without computing <math>\rho</math> first <math display="block">\begin{align} \varphi &= \begin{cases} \text{indeterminate} & \text{if } x = 0 \text{ and } y = 0\\ \frac\pi2\frac y{|y|} & \text{if } x = 0 \text{ and } y \ne 0\\ \arctan\left(\frac{y}{x}\right) & \mbox{if } x > 0 \\ \arctan\left(\frac{y}{x}\right)+\pi & \mbox{if } x < 0 \text{ and } y \ge 0\\ \arctan\left(\frac{y}{x}\right)-\pi & \mbox{if } x < 0 \text{ and } y < 0 \end{cases} \end{align}</math> For other formulas, see the article [[Polar coordinate system]]. Many modern programming languages provide a function that will compute the correct azimuth {{mvar|φ}}, in the range {{math|(−π, π)}}, given ''x'' and ''y'', without the need to perform a case analysis as above. For example, this function is called by {{mono|[[atan2]](''y'', ''x'')}} in the [[C (programming language)|C]] programming language, and {{mono|(atan ''y'' ''x'')}} in [[Common Lisp]]. ===Spherical coordinates=== [[Spherical coordinates]] (radius {{mvar|r}}, elevation or inclination {{mvar|θ}}, azimuth {{mvar|φ}}), may be converted to or from cylindrical coordinates, depending on whether {{mvar|θ}} represents elevation or inclination, by the following: {| class="wikitable plainrowheaders" style="text-align: center;" |+ Conversion between spherical and cylindrical coordinates |- ! scope="col" | Conversion to: ! scope="col" | Coordinate ! scope="col" | {{mvar|θ}} is elevation ! scope="col" | {{mvar|θ}} is inclination |- ! scope="row" rowspan=3 style="font-weight: bold; text-align: center;" | Cylindrical ! scope="row" style="text-align: center;" | {{mvar|ρ}} = | {{math|''r'' cos ''θ''}} | {{math|''r'' sin ''θ''}} |- ! scope="row" style="text-align: center;" | {{mvar|φ}} = | colspan= 2 | {{mvar|φ}} |- ! scope="row" style="text-align: center;" | {{mvar|z}} = | {{math|''r'' sin ''θ''}} | {{math|''r'' cos ''θ''}} |- ! scope="row" rowspan=3 style="font-weight: bold; text-align: center;" | Spherical ! scope="row" style="text-align: center;" | {{mvar|r}} = | colspan= 2 | <math display="inline">\sqrt{\rho^2+z^2}</math> |- ! scope="row" style="text-align: center;" | {{mvar|θ}} = | <math display="inline">\arctan\left(\frac{z}{\rho}\right)</math> | <math display="inline">\arctan\left(\frac{\rho}{z}\right)</math> |- ! scope="row" style="text-align: center;" | {{mvar|φ}} = | colspan= 2 | {{mvar|φ}} |}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)