TCNVRT

Utility/GeneralConverts translational coordinates between the various supported representations.

Use

This function can be called by any user-defined subroutine.

Format

Fortran Calling Syntax
CALL TCNVRT (SYS1, COORD1, SYS2, COORD2, ISTAT)
C/C++ Calling Syntax
c_tcnvrt(sys1, coord1, sys2, coord2, istat)
Python Calling Syntax
[coord2, istat] = py_tcnvrt(sys1, coord1, sys2)
MATLAB Calling Syntax
[coord2, istat] = m_tcnvrt(sys1, coord1, sys2)

Attributes

SYS1
[Character]
A string specifying the system in which the values are passed in coord1.
COORD1
[double precision]
An array containing the coordinates to be converted. Angles should be input in radians.
SYS2
[Character]
A string specifying the system in which the values are returned as output in coord2.

Output

COORD2
[double precision]
An array containing the converted coordinates. Angles are output in radians.
ISTAT
[integer]
A variable indicating the success or the reason for the failure of the call to TCNVRT.

Comments

The following table lists the valid options you may specify for SYS1 or SYS2 and the corresponding sizes of the input or output arrays COORD1 or COORD2.

SYS1/SYS2 string COORD1/COORD2 size COORD1/COORD2 contents
CARTESIAN 3 [x, y, z]
SPHERICAL 3 [rho, phi, theta]
CYLINDRICAL 3 [r, theta, z]