CONVERT_COORD

The CONVERT_COORD function transforms one or more sets of coordinates to and from the coordinate systems supported by IDL. The result of the function is a (3, n ) vector containing the ( x, y, z ) components of the n output coordinates.

The input coordinates X and, optionally, Y and/or Z can be given in data, device, or normalized form by using the DATA, DEVICE, or NORMAL keywords. The default input coordinate system is DATA. The keywords TO_DATA, TO_DEVICE, and TO_NORMAL specify the output coordinate system.

If the input points are in 3D data coordinates, be sure to set the T3D keyword.

Calling Sequence

Result = CONVERT_COORD(, X [, Y [, Z]] )

Arguments

X

A vector or scalar argument providing the X components of the input coordinates. If only one argument is specified, X must be an array of either two or three vectors (i.e., ``` (2,*)``` or ``` (3,*)``` ). In this special case, ``` X[0,*]``` are taken as the X values, ``` X[1,*]``` are taken as the Y values, and, if present, ``` X[2,*]``` are taken as the Z values.

Y

An optional argument providing the Y input coordinate(s).

Z

An optional argument providing the Z input coordinate(s).

Keywords

DATA

Set this keyword if the input coordinates are in data space (the default).

DEVICE

Set this keyword if the input coordinates are in device space.

NORMAL

Set this keyword if the input coordinates are in normalized space.

T3D

Set this keyword if the 3D transformation !P.T is to be applied.

TO_DATA

Set this keyword if the output coordinates are to be in data space.

TO_DEVICE

Set this keyword if the output coordinates are to be in device space.

TO_NORMAL

Set this keyword if the output coordinates are to be in normalized space.

Example

Convert, using the currently established viewing transformation, 11 points along the parametric line x = t , y = 2 t , z = t 2 , along the interval [0, 1] from data coordinates to device coordinates:

X = FINDGEN(11)/10. ; Make a vector of X values.

D = CONVERT_COORD(X, 2*X, X^2, /T3D, /TO_DEVICE)
; Convert the coordinates. D will be an (3,11) element array.