Last Modified: August 13, 2019

Converts coordinates between the Cartesian, cylindrical, and spherical coordinate systems.

Type of conversion to perform.

Name | Value | Description |
---|---|---|

Cartesian to Spherical | 0 | Converts a coordinate from the Cartesian coordinate system to the spherical coordinate system. |

Spherical to Cartesian | 1 | Converts a coordinate from the spherical coordinate system to the Cartesian coordinate system. |

Cartesian to Cylindrical | 2 | Converts a coordinate from the Cartesian coordinate system to the cylindrical coordinate system. |

Cylindrical to Cartesian | 3 | Converts a coordinate from the cylindrical coordinate system to the Cartesian coordinate system. |

Spherical to Cylindrical | 4 | Converts a coordinate from the spherical coordinate system to the cylindrical coordinate system. |

Cylindrical to Spherical | 5 | Converts a coordinate from the cylindrical coordinate system to the spherical coordinate system. |

**Default: **Cartesian to Spherical

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an **error in** input and an **error out** output so that the node can respond to and communicate errors that occur while code is running. The value of **error in** specifies whether an error occurred before the node runs. Most nodes respond to values of **error in** in a standard, predictable way.

**Default: **No error

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

**error in** input and an **error out** output so that the node can respond to and communicate errors that occur while code is running. The value of **error in** specifies whether an error occurred before the node runs. Most nodes respond to values of **error in** in a standard, predictable way.

The Cartesian, or rectangular, coordinate system is the most widely used coordinate system. The cylindrical coordinate system is a generalization of two-dimensional polar coordinates to three dimensions. The spherical coordinate system is a system of curvilinear coordinates that is natural for describing positions on a sphere.

The following figure show a point *P* in different three-dimensional coordinate systems.

The following equations describe the relationship between a Cartesian coordinate (*x*,*y*,*z*) and a cylindrical coordinate (*ρ*,*θ*,*z*):

$\{\begin{array}{c}x=\rho \cdot \mathrm{cos}\theta \\ y=\rho \cdot \mathrm{sin}\theta \\ z=z\end{array}$

where

- ρ is the radial coordinate
- θ (-π <
*θ*≤ π) is the azimuthal coordinate

The following equations describe the relationship between a Cartesian coordinate (*x*,*y*,*z*) and a spherical coordinate (*r*,*θ*,*φ*):

$\{\begin{array}{c}x=r\cdot \mathrm{sin}\phi \cdot \mathrm{cos}\theta \\ y=r\cdot \mathrm{sin}\phi \cdot \mathrm{sin}\theta \\ z=r\cdot \mathrm{cos}\phi \end{array}$

where

*r*is the distance from point*P*to the origin-
*θ*(-π <*θ*≤ π) is the azimuthal angle in the spherical coordinate system - φ (0 ≤
*φ*≤ π) is the polar angle in the spherical coordinate system

The following equations describe the relationship between a spherical coordinate (*r*,*θ*,*φ*) and a cylindrical coordinate (*ρ*,*θ*,*z*):

$\{\begin{array}{c}r=\sqrt{{\rho}^{2}+{z}^{2}}\\ {\theta}_{\mathrm{spherical}}={\theta}_{\mathrm{cylindrical}}\\ \phi =\mathrm{atan2}(\rho ,\text{\hspace{0.17em}}z)\end{array}$

where

*ρ*is the radial distance*z*is the height-
*θ*_{spherical}(-π <*θ*≤ π) is the azimuthal angle in the spherical coordinate system -
*θ*_{cylindrical}(-π <*θ*≤ π) is the azimuthal angle in the cylindrical coordinate system - φ (0 ≤
*φ*≤ π) is the polar angle in the spherical coordinate system

**Where This Node Can Run: **

Desktop OS: Windows

FPGA: Not supported

Web Server: Not supported in VIs that run in a web application