ParaMonte MATLAB 3.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
getBorder.m
Go to the documentation of this file.
1%> \brief
2%> Return a matrix of MATLAB doubles of shape ``[npnt, 2]``
3%> containing the coordinates of a set of points on the boundary
4%> of a 2D ellipsoid whose Gramian matrix is specified as input
5%> and whose center is also optionally specified.<br>
6%>
7%> \param[in] gramian : The input square matrix of MATLAB doubles of shape ``[2, 2]`` containing the
8%> Gramian of the target 2D ellipsoid whose boundary points are to be returned.<br>
9%> (**optional**. If not present or empty, the default is ``eye(2, 2)``.)
10%> \param[in] center : The input vector of MATLAB doubles of size ``2`` containing the 2D coordinates
11%> of the center of the target 2D ellipsoid whose boundary points are to be returned.<br>
12%> (**optional**. If not present or empty, the default is ``zeros(2, 1)``.)
13%> \param[in] npnt : The input scalar MATLAB whole number containing the number of points to
14%> return on the boundary of the target 2D ellipsoid.<br>
15%> (**optional**, default = ``50``.)
16%>
17%> \return
18%> ``bcrd`` : The output matrix of MATLAB doubles of shape ``[npnt, 2]``
19%> containing the coordinates of a set of ``npnt`` points on
20%> the boundary of the target 2D ellipsoid.<br>
21%>
22%> \interface{getBorder}
23%> \code{.m}
24%>
25%> bcrd = pm.geom.ell2.getBorder();
26%> bcrd = pm.geom.ell2.getBorder(gramian);
27%> bcrd = pm.geom.ell2.getBorder(gramian, center);
28%> bcrd = pm.geom.ell2.getBorder(gramian, center, npnt);
29%> bcrd = pm.geom.ell2.getBorder([], [], []);
30%>
31%> \endcode
32%>
33%> \see
34%> [pm.geom.ell2.getBorders](@ref getBorders)<br>
35%> [pm.vis.CascadeEllipse](@ref CascadeEllipse)<br>
36%> [pm.vis.SubplotEllipse](@ref SubplotEllipse)<br>
37%> [pm.vis.PlotEllipse](@ref PlotEllipse)<br>
38%> [pm.vis.TileEllipse](@ref TileEllipse)<br>
39%>
40%> \example{getBorder}
41%> \include{lineno} example/geom/ell2/getBorder/main.m
42%> \vis{getBorder}
43%> \image html example/geom/ell2/getBorder/getBorder.2d.png width=700
44%> \image html example/geom/ell2/getBorder/getBorder.3d.png width=700
45%> \image html example/geom/ell2/getBorder/getBorder.wavy.png width=700
46%>
47%> \final{getBorder}
48%>
49%> \author
50%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin<br>
51function bcrd = getBorder(gramian, center, npnt)
52 if nargin < 3
53 npnt = [];
54 end
55 if nargin < 2
56 center = [];
57 end
58 if nargin < 1
59 gramian = [];
60 end
61 if isempty(npnt)
62 npnt = 50;
63 end
64 if isempty(center)
65 center = zeros(2, 1);
66 end
67 if isempty(gramian)
68 gramian = eye(2);
69 end
70 independentVariable = linspace(0, 2 * pi, npnt)';
71 xval = cos(independentVariable);
72 yval = sin(independentVariable);
73 ap = [xval(:) yval(:)]';
74 [eigvec, eigval] = eig(gramian);
75 eigval = sqrt(eigval); % convert variance to std.
76 bcrd = transpose(eigvec * eigval * ap + repmat(center(:), 1, npnt));
77end
This is the CascadeEllipse class for generating instances of 2-dimensional Ellipse Cascade visualizat...
This is the PlotEllipse class for generating instances of 2-dimensional Ellipse Plot visualizations b...
Definition: PlotEllipse.m:30
This is the SubplotEllipse class for generating instances of 2-dimensional Ellipse Subplot visualizat...
This is the TileEllipse class for generating instances of 2-dimensional Ellipse Tile visualizations b...
Definition: TileEllipse.m:7
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...