PV-WAVE Foundation > Reference Guide > C Routines > CONV_FROM_RECT Function
CONV_FROM_RECT Function
Converts rectangular coordinates (points) to polar, cylindrical, or one of two spherical coordinate systems: mathematical or global.
Usage
result = CONV_FROM_RECT(vec1, vec2, vec3)
Input Parameters
vec1A 1D array containing the x rectangular coordinates.
vec2A 1D array containing the y rectangular coordinates.
vec3A 1D array containing the z rectangular coordinates. For polar coordinates, set vec3 to the scalar value 0.
Returned Value
resultBy default, global spherical coordinates are returned with (0, *) containing the longitude, (1, *) containing the latitude, and (2, *) containing the radii. Note that latitude angles are given with respect to the horizontal axis or equator.
*If the Sphere keyword is present and nonzero, mathematical spherical coordinates are returned as in the default case, except that the latitude angles are given with respect to the vertical, or polar, axis.
*If the Polar keyword is present and nonzero, then a FLOAT(2, n) array is returned with (0, *) containing the angles and (1, *) containing the radii.
*If the Cylin keyword is present and nonzero, then a FLOAT(3, n) array is returned with (0, *) containing the angles, (1, *) containing the radii, and (2, *) containing the Z values.
Keywords
CylinSpecifies that cylindrical coordinates are to be returned.
DegreesIf present and nonzero, causes the returned coordinates to be in degrees instead of radians.
Global—If present and nonzero, the function returns global longitude and latitude angles. The longitude angles are the horizontal angles on the Earth’s globe, where the angles east of the Greenwich meridian are positive, and angles to the west are negative. The latitude angles are vertical angles rotated with respect to the equator. They are positive in the northern hemisphere and negative in the southern hemisphere. By default, the function returns these global latitude and longitude values; this keyword can be used, however, to add clarity to the function call.
PolarSpecifies that polar coordinates are to be returned.
Sphere—If present and nonzero, the function returns a spherical coordinate system where the vertical angle is rotated with respect to the vertical (or polar) axis instead of the horizontal axis. The horizontal angles and radii are the same as in the global spherical case. This system is based on the set of conversion equations in the CRC Standard Mathematical Tables.
See Also
For more information, see the PV‑WAVE User’s Guide.