Matrix::GetXValue

Description

Get the X coordinate associated with the specified column of the matrix.

Syntax

double GetXValue( int iColumn )

Parameters

iColumn
[input] Input column number (0 based offset)

Return

Returns the X coordinate value of the specified column on success and NANUM on failure.

Examples

EX1

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

    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.SetXMin(0);   // Set the X coordinate of 1st row
    Mat1.SetXMax(100);   // Set the X coordinate of last row
    dXValue = Mat1.GetXValue(1); // Get X coordinate of 2nd column (arg is 0-based)
    printf("  X value at 2nd column is %g. (Min=0, Max=100)\n", 
        dXValue); // Print out the X 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 GetXValue function gets the X coordinate associated with the specified column of the matrix. An error will result if the matrix coordinate map or column number is not valid.

See Also

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

header to Include

origin.h