2.2.3.8.11 Matrix::GetYValue

Description

Get the Y coordinate associated with the specified row of the matrix.

Syntax

double GetYValue( int iRow )

Parameters

iRow
[input] Input row number (0 based offset)

Return

Returns the Y coordinate value of the specified row on success and NANUM on failure.

Examples

EX1

// Get the Y coordinate of a specific row of a matrix
void Matrix_GetYValue_ex1()
{
// This sample code will print a message like below:
//     Target matrix is Matrix1.
//     Y value at 2nd row is 50. (Min=0, Max=100);
//
    double dYValue;

    matrix<double> mat1 = {
        {1, 1},
        {1, 1},
        {1, 1}
    };

    MatrixPage MatPg1;
    MatPg1.Create("Origin");
    MatrixLayer MatLy1 = MatPg1.Layers(0);
    Matrix Mat1(MatLy1);
    Mat1 = mat1;
    printf("  Target matrix is %s.\n",Mat1.GetName());

    Mat1.SetYMin(0);   // Set the Y coordinate of 1st row
    Mat1.SetYMax(100);   // Set the Y coordinate of last row
    dYValue = Mat1.GetYValue(1); // Get Y coordinate of 2nd column (arg is 0-based)
    printf("  Y value at 2nd row is %g. (Min=0, Max=100)\n", 
        dYValue); // Print out the Y coordinate
}

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 GetYValue function gets the Y coordinate associated with the specified row of the matrix. An error will result if the matrix coordinate map or row number is not valid.

See Also

Matrix::GetXValue, Matrix::GetXMin, Matrix::GetXMax, Matrix::GetYMin, Matrix::GetYMax, Matrix::SetXMin, Matrix::SetXMax, Matrix::SetYMin, Matrix::SetYMax

Header to Include

origin.h