CONVERT_COORD Function
Converts coordinates from one coordinate system to another.
Usage
result = CONVERT_COORD(points)
result = CONVERT_COORD(x, y[, z])
Input Parameters
points—A (2, n) or (3, n) array of points (or vertices) to convert.
x—A scalar or vector parameter providing the x-coordinates to be converted.
y—A scalar or vector parameter providing the y-coordinates to be converted.
z—(optional) If present, a scalar or vector parameter providing the z-coordinates of the points to be converted.
Returned Value
result—An array of the converted coordinates.
Keywords
T3d—If set, the conversion uses T3d coordinates.
One of the following keywords may be used to specify the input coordinate system. If no input keyword is used, the function defaults to the data coordinate system.
Data—Specifies that the input coordinates are based on the data coordinate system.
Device—Specifies that the input coordinates are based on the device coordinate system.
Normal—Specifies that the input coordinates are based on the normal coordinate system.
One of the following keywords may be used to specify the output coordinate system. If no output keyword is used, the coordinates are converted to the data coordinate system.
To_Data—Converts to the data coordinate system.
To_Device—Converts to the device coordinate system.
To_Normal—Converts to the normal coordinate system.
Discussion
The CONVERT_COORD procedure converts among the data, device, and normalized coordinate systems for the currently active window and plot.
A valid data coordinate system must be established before you can convert to or from data coordinates; you may use the PLOT procedure to establish this coordinate system.
Example
; Establish data coordinate system
xdata = [.1, .2, .5, .8, .9, .5]
ydata = [.3, .6, .9, .6, .3, .1]
PLOT, xdata, ydata
; Find data coordinate for the center of the window.
point = CONVERT_COORD(0.5, 0.5, /Normal, /To_Data)
; Print coordinates and plot “+” symbol at center of the window.
PRINT, 'X coord = ', point(0)
PRINT, 'Y coord = ', point(1)
PLOTS, point(0), point(1), Symsize=5.0, Psym=-1
See Also
For more information, see the PV‑WAVE User’s Guide.
Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.