CImage:DistanceWcsStr
The DistanceWcsStr method calculates the distance in WCS units between 2 image points measured in world coordinates and returns the result as a string. The related Distance method computes the Distance for pixel coordinates.
sDistance = CImage:DistanceWcsStr( x1, y1, x2, y2) where |
x1,y1 are world coordinate values for the coordinate of the first point.
x2,y2 are world coordinate values for the coordinate of the first point.
sDistance is a string giving the wold coordinate distance (see below).
On success, this method returns sDistance.
On failure, this method returns nil
The DistanceWcsStr method returns a distance in world coordinate units as a string. Also see the related DistanceWcs method that returns the world coordinate calibrated distance as a number.
Assume an image is displayed and attached to a CImageView named V. The following script measures the Distance between between two points (x1,y1) and (x2,y2) when the coordinates are in distance units (pixels, mm, microns, etc.):
|
-- load the image from a |
|
-- point 1 |
|
-- point 2 |
|
-- make the measurement, returns a string |
Alternatively, the following example supposes an astronomical image with an equatorial calibration and that the points are expressed in angular units:
|
-- load the image from a |
|
-- point 1 |
|
-- point 2 |
|
-- make the measurement, returns a string |