PO_matlab
mycyl2sph.m File Reference

Converts cylindrical coordinates to spherical coordinates. More...

Functions

function mycyl2sph (in rho, in phi, in z)

Detailed Description

Converts cylindrical coordinates to spherical coordinates.

This function transforms cylindrical coordinates (rho, phi, z) into spherical coordinates (r, theta, phi). The azimuthal angle phi is preserved. Theta is measured from the positive z-axis.

Parameters
rhoRadial distance in the xy-plane [m]
phiAzimuthal angle [rad]
zHeight coordinate [m]
Return values
rRadial distance from origin [m]
thetaElevation angle from z-axis [rad]
phi_Azimuthal angle [rad] (same as input phi)

Function Documentation

◆ mycyl2sph()

function mycyl2sph ( in rho,
in phi,
in z )