2%> Return a matrix of MATLAB doubles of shape ``[npnt, 2 * nell]``
3%> (or ``[npnt, 3 * nell]``
if the input ``zval`` is present)
4%> containing the 2D (or 3D) coordinates of a set of points on the boundary
5%> of a set of 2D ellipsoids whose Gramian matrices and centers are specified
6%> as input argument.<br>
9%> Here ``nell`` refers to the number of ellipsoids
which
10%> is equal to ``2 * max(1, size(gramian, 3), size(center, 2))``.
12%> \param[in] gramian : The input matrix of MATLAB doubles of shape ``[2, 2, nell]``
13%> containing the Gramian matrices of the ``nell`` 2D ellipsoids
14%> whose boundary points are to be returned.<br>
15%> (**optional**,
default = ``eye(2, 2, 1)``)
16%> \param[in] center : The input matrix of MATLAB doubles of shape ``[2, nell]`` containing
17%> the 2D coordinates of the centers of the ``nell`` 2D ellipsoids
18%> whose boundary points are to be returned.<br>
19%> (**optional**,
default = ``zeros(2, 1)``)
20%> \param[in] zval : The input scalar (or matrix of shape ``[npnt, nell]`` of) MATLAB double(s)
21%> containing the z-axis coordinates of the points on the borders of the ``nell`` 2D ellipsoids.<br>
22%> If present, the specified value(s) will occupy the ``[1 : 2 : 3 * nell]`` columns of the output ``bcrd``.<br>
23%> This argument is present
for the sake of convenience and better performance of the algorithm to avoid further reallocations.<br>
24%> (**optional**. If not present or empty, it will not be present in the output.)
25%> \param[in] npnt : The input scalar MATLAB whole number containing the number of points to
return on the boundary of the target 2D ellipsoid.<br>
26%> (**optional**,
default = ``50``)
29%> ``bcrd`` : The output matrix of MATLAB doubles of shape ``[npnt, 2 * nell]``
30%> (or ``[npnt, 3 * nell]``
if the input argument ``zval`` is present)
31%> containing the coordinates of a set of ``npnt`` points on
32%> the boundary of the target 2D ellipsoid.
37%> pm.geom.ell2.getBorders()
38%> pm.geom.ell2.getBorders(gramian)
39%> pm.geom.ell2.getBorders(gramian, center)
40%> pm.geom.ell2.getBorders(gramian, center, zval)
41%> pm.geom.ell2.getBorders(gramian, center, zval, npnt)
46%> The condition ``npnt == size(zval, 1)`` must hold
for the corresponding input arguments.
49%> \include{lineno} example/geom/ell2/
getBorders/main.m
57%> \JoshuaOsborne, May 21 2024, 5:33 PM, University of Texas at Arlington<br>
58%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
84 gramian = zeros(2, 2, 1);
85 gramian(:, :, 1) = eye(2);
88 nell = max(size(gramian, 3), size(center, 2));
89 asserted = size(gramian, 3) == size(center, 2) || size(gramian, 3) == 1 || size(center, 2) == 1;
97 + "The condition ``size(gramian, 3) == size(center, 2) || size(gramian, 3) == 1 || size(center, 2) == 1`` must hold." + newline ...
98 + "For more information, see the documentation displayed above." + newline ...
104 %%%% Make the 2D ellipsoid boundaries.
108 bcrd = zeros(npnt, 2);
110 icol = (iell - 1) * 2 + 1;
111 bcrd(:, icol : icol + 1) = pm.geom.ell2.
getBorder(gramian(:, :, min(iell, size(gramian, 3))), center(:, min(iell, size(center, 2))), npnt);
114 asserted = nell == size(zval, 2) || size(zval, 2) == 1 || (size(gramian, 3) == 1 || size(center, 2) == 1);
117 disp("size(gramian, 3)")
118 disp( size(gramian, 3) )
119 disp("size(canter, 2)")
120 disp( size(canter, 2) )
124 + "The specified number of ellipsoids must be either the same or one in the input ``gramian``, ``center``, and ``zval``." + newline ...
125 + "For more information, see the documentation displayed above." + newline ...
129 zvalScalar = numel(zval) == 1;
130 nell = max(nell, size(zval, 2));
131 bcrd = zeros(npnt, 3 * nell);
133 icol = (iell - 1) * 3 + 1;
134 bcrd(:, icol : icol + 1) = pm.geom.ell2.
getBorder(gramian(:, :, min(iell, size(gramian, 3))), center(:, min(iell, size(center, 2))), npnt);
136 bcrd(:, icol + 2) = zval;
138 bcrd(:, icol + 2) = zval(:, min(iell, size(zval, 2)));
function getBorder(in gramian, in center, in npnt)
Return a matrix of MATLAB doubles of shape [npnt, 2] containing the coordinates of a set of points on...
function getBorders(in gramian, in center, in zval, in npnt)
Return a matrix of MATLAB doubles of shape [npnt, 2 * nell] (or [npnt, 3 * nell] if the input zval is...
function which(in vendor)
Return the a MATLAB string containing the path to the first mpiexec executable binary found in system...