2.2.3.8.9 Matrix::GetYMaxGetYMax
Description
Get the Y coordinate associated with the last row of the matrix.
Syntax
double GetYMax( )const
Parameters
Return
Returns the Y coordinate associated with the last row of the matrix.
Examples
EX1
// Set and get the Y coordinate of the last row of a matrix
void Matrix_GetYMax_ex1()
{
// This sample code will print a message like below:
// Target matrix is Matrix1.
// Setting Y max value succeeded.
// Obtained Y max value is 1.23457e+008
// Check Y max value by Matrix:Set Dimensions menu command if it is 1.234570e+008.
//
BOOL rc;
double dYMax;
matrix<double> mat1 = {
{1, 2},
{3, 4},
{5, 6}
};
MatrixPage MatPg1;
MatPg1.Create("Origin");
MatrixLayer MatLy1 = MatPg1.Layers(0);
Matrix Mat1(MatLy1);
Mat1 = mat1;
printf(" Target matrix is %s.\n",Mat1.GetName());
rc=Mat1.SetYMax(123.4567E6); // Use SetYMax to set the Y coordinate of last row
if(!rc) {
printf(" Error: SetYMax failed.\n");
return;
}
else printf(" Setting Y max value succeeded.\n");
dYMax = Mat1.GetYMax(); // Use GetYMax to get the Y coordinate of last row
printf(" Obtained Y max value is %g\n", dYMax); // Print out coordinate
printf(" Check Y max value by Matrix:Set Dimensions menu command if it is %e.\n",dYMax);
}
Remark
In addition to the values displayed in the cells of an internal Origin matrix (nominally Z values), Origin matrices map X coordinate values to the columns and Y coordinate values to the rows of the matrix. The GetYMax function gets the Y coordinate associated with the last row of the matrix.
See Also
Matrix::GetXMin, Matrix::GetXMax, Matrix::GetYMin, Matrix::SetXMin, Matrix::SetYMin, Matrix::SetXMax, Matrix::SetYMax, Matrix::GetXValue, Matrix::GetYValue
Header to Include
origin.h
|