2.8.18 marea(Pro)
Contents
Menu Information
Analysis: Mathematics: Matrix Surface Area
Brief Information
Calculate matrix surface area
Additional Information
This feature is for OriginPro only, 8.1 SR0 or later versions.
Command Line Usage
marea im:=[mbook1] missing:=1 area:=area;
X-Function Execution Options
Please refer to the page for additional option switches when accessing the x-function from script
Variables
| Display Name |
Variable Name |
I/O and Type |
Default Value |
Description |
|---|---|---|---|---|
| Input Matrix | im |
Input MatrixObject |
|
Specify the input matrix. |
| Interpolate for Missing Value | missing |
Input int |
|
If this parameter is true, Origin will do interpolation for missing value. |
| Area | area |
Output double |
|
Area result output destination. Default is Results Log window. |
Description

This X-Function is used to calculate the area of the matrix surface. You can specify a variable for the result area as well as whether or not to interpolate for the missing value. Also, the result area will be always put to the Results Log Window automatically.
Examples
This example is going to calculate the area of the active matrix.
- Create a new project and import data <Origin Program Directory>\Samples\Matrix Conversion and Gridding\3D XYZ.dat.
- Highlight Column C, Change the type of Column C to be Z by selecting the right-click menu Set As: Z. Then select main menu Worksheet: Convert to Matrix: XYZ Gridding.
- In the XYZ Gridding: Convert Worksheet to Matrix dialog, keep the default settings and click the OK button to convert the worksheet to a matrix.
- Activate the matrix, then run
xyzarea -d;in Command Window to bring up the marea dialog box. - Check the check box behind the Interpolate for Missing Value.
- Click the OK button, then the area of the matrix is put to Results Log Window.
Algorithm
In three dimensions Cartesian space, the area of a general triangle
is
.
To calculate the area of a matrix surface, the matrix surface is divided into many sub-triangles like below. The the area of the matrix surface is the sum of all the area of its sub-triangles.
- Matrix Surface with Boundary
The steps as follow are for calculating the area of matrix surface with boundary.
- Find the intersection.
- Pick up all the points inside or on the boundary of that region.
- Find the Z value on the boundary line by interpolation.
- Perform triangulation.
- Sum the area of each triangle obtained in step 4.




