2.2.3.8.20 Matrix::SetYMin

Description

Set the Y coordinate associated with the first row of the matrix.

Syntax

BOOL SetYMin( double dYMin )

Parameters

dYMin
[input] Input Y coordinate of first row

Return

Returns TRUE on success and FALSE on failure.

Examples

EX1

// Set and get the Y coordinate of the first row of a matrix
void Matrix_SetYMin_ex1()
{
// This sample code will print a message like below:
// Target matrix is Matrix1.
// Setting Y min value succeeded.
// Obtained Y min value is -1.23457e+008
// Check Y min value by Matrix:Set Dimensions menu command if it is -1.234570e+008.
//
    BOOL rc;
    
    double dYMin;
    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.SetYMin(-123.4567E6);  // Use SetYMin to set the Y coordinate of last row
    if(!rc) {
        printf("  Error: SetYMin failed.\n");
        return;
    }
    else printf("  Setting Y min value succeeded.\n");
    dYMin = Mat1.GetYMin();   // Use GetYMin to get the Y coordinate of last row
    printf("  Obtained Y min value is %g\n", dYMin); // Print out coordinate
    printf("  Check Y min value by Matrix:Set Dimensions menu command if it is %e.\n",dYMin);
}

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 SetYMin function sets the Y coordinate associated with the first row of the matrix.

See Also

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

Header to Include

origin.h