sphtri
Introduced in 1.0
Synopsis

Delaunay triangulation of standard triangular grid.

tri = sphtri(Symmetry,n)
Description

Computes the Delaunay triangulation of the orientational grid constructed by the function sphgrid(Symmetry,n). The argument Symmetry specifies on of the centrosymmetric point groups, see sphgrid for details. n is the number of orientations (knots) over a quarter of a meridian.

tri is a Nx3 array containing the indices for the triangles along the rows. If a row is [4 8 3], this means that that triangle is formed by orientations 4, 8 and 3 as returned by sphgrid.

The output of this function can be used to plot orientationally dependent data generated with resfields, endorfrq or any other function. The orientations should be generated by sphgrid, the plotting can be done using trisurf or trimesh.

Examples

It is very easy to compute the orientation dependence of the effective g value for a g tensor of [1.9 2 2.1] and display the result. First we compute orientations and g values.

x = sphgrid('D2h',30);
g2 = [1.9*x(1,:); 2*x(2,:); 2.1*x(3,:)].^2;
g = sqrt(sum(g2));

Next we compute the triangulation and use MATLAB's trisurf function to plot the g values.

tri = sphtri('D2h',30);
trisurf(tri,x(1,:),x(2,:),x(3,:),g);
view(135,39); colorbar
Algorithm

This functions does not rely on MATLAB's general triangulation functions like delaunay, but computes the triangle indices in a way tailored to the special grids constructed by sphgrid.

See also

sphgrid, sphrand