|
CPlotView:GetPtX
The GetPtX method returns the x value of a
point in the class data matrix.
Syntax
|
x = CPlotView:GetPtX( n )
|
n is the index of the point in the plot data.
x is the x
coordinate.
On success,
this method returns the x coordinate.
On failure,
this method returns 0.
Remarks
This method returns the x value of the specified point at index
n. If n is
out of range, the value 0 is returned. To remove ambiguity about
whether the point truly has a value of 0 or is out of bounds, check
the index before calling this method.
Example
The following script adds some points, then finds
the nearest point and prints its x value:
|
P = new_plotview()
|
|
|
P:Add( 11.82, 70.5, 10.25,
12.5)
|
|
|
P:Add( 4.62, 90.5, 11.5,
10.2)
|
|
|
n = P:FindPoint( 4, 72)
|
|
|
Printf("n=%d, x=%lg\n", n,
P:GetPtX(n))
|
|
Related Topics
CPlotView class
GetPtY
Mira Pro x64 Script User's Guide, v.8.76 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.
|