ParaMonte MATLAB 3.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
getBorders.m File Reference

Go to the source code of this file.

Functions

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 present) containing the 2D (or 3D) coordinates of a set of points on the boundary of a set of 2D ellipsoids whose Gramian matrices and centers are specified as input argument.
More...
 

Function Documentation

◆ getBorders()

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 present) containing the 2D (or 3D) coordinates of a set of points on the boundary of a set of 2D ellipsoids whose Gramian matrices and centers are specified as input argument.

Here nell refers to the number of ellipsoids which is equal to 2 * max(1, size(gramian, 3), size(center, 2)).

Parameters
[in]gramian: The input matrix of MATLAB doubles of shape [2, 2, nell] containing the Gramian matrices of the nell 2D ellipsoids whose boundary points are to be returned.
(optional, default = eye(2, 2, 1))
[in]center: The input matrix of MATLAB doubles of shape [2, nell] containing the 2D coordinates of the centers of the nell 2D ellipsoids whose boundary points are to be returned.
(optional, default = zeros(2, 1))
[in]zval: The input scalar (or matrix of shape [npnt, nell] of) MATLAB double(s) containing the z-axis coordinates of the points on the borders of the nell 2D ellipsoids.
If present, the specified value(s) will occupy the [1 : 2 : 3 * nell] columns of the output bcrd.
This argument is present for the sake of convenience and better performance of the algorithm to avoid further reallocations.
(optional. If not present or empty, it will not be present in the output.)
[in]npnt: The input scalar MATLAB whole number containing the number of points to return on the boundary of the target 2D ellipsoid.
(optional, default = 50)
Returns
bcrd : The output matrix of MATLAB doubles of shape [npnt, 2 * nell] (or [npnt, 3 * nell] if the input argument zval is present) containing the coordinates of a set of npnt points on the boundary of the target 2D ellipsoid.


Possible calling interfaces

pm.geom.ell2.getBorders()
pm.geom.ell2.getBorders(gramian)
pm.geom.ell2.getBorders(gramian, center)
pm.geom.ell2.getBorders(gramian, center, zval)
pm.geom.ell2.getBorders(gramian, center, zval, npnt)
Warning
The condition npnt == size(zval, 1) must hold for the corresponding input arguments.


Example usage

1cd(fileparts(mfilename('fullpath'))); % Change working directory to source code directory.
2addpath('../../../../'); % Add the ParaMonte library root directory to the search path.
3
4figure("color", "white"); hold on; box on;
5bcrd = pm.geom.ell2.getBorders();
6h = plot(bcrd(:, 1), bcrd(:, 2), '-');
7pm.vis.figure.savefig("getBorders.2d.png", "-m3");
8
9npnt = 50;
10figure("color", "white"); hold on; box on; view(3);
11bcrd = pm.geom.ell2.getBorders([], [], repmat([1 : 20], npnt, 1));
12for iell = 1 : 2 : size(bcrd, 2) / 3
13 icol = (iell - 1) * 3 + 1;
14 plot3(bcrd(:, icol), bcrd(:, icol + 1), bcrd(:, icol + 2), '-');
15end
16pm.vis.figure.savefig("getBorders.3d.png", "-m3");
function root()
Return a scalar MATLAB string containing the root directory of the ParaMonte library package.

Visualization of the example output


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Joshua Alexander Osborne, May 21 2024, 5:33 PM, University of Texas at Arlington
Amir Shahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin