To compute the volume beneath the surface defined by the matrix, starting from zero-level.
double ocmath_2d_integrate( const uint nRows, const uint nCols, const double dXMin, const double dYMin, const double dXMax, const double dYMax, const double * pMat )
Return the integration restult, or cause run time error if pMat is NULL.
EX1
// Assuming the active window is the matrix to be integrated. void ocmath_2d_integrate_ex1() { MatrixLayer ml = Project.ActiveLayer(); MatrixObject mo = ml.MatrixObjects(0); double nRows = mo.GetNumRows(); double nCols = mo.GetNumCols(); double dXMin, dYMin, dXMax, dYMax; mo.GetXY(dXMin, dYMin, dXMax, dYMax); Matrix& mat = mo.GetDataObject(); double dRet = ocmath_2d_integrate(nRows, nCols, dXMin, dYMin, dXMax, dYMax, mat); string strName; ml.GetName(strName); printf("Integration of %s from zero is: %G\n", strName, dRet); }
ocmath_integrate, ocmath_numeric_integral
origin.h