0001 classdef PURBFInterpolant < Interpolant
0002
0003
0004 properties
0005 coverCenters;
0006 coverRadius;
0007 weightFun;
0008 end
0009
0010 methods
0011 function obj = PURBFInterpolant(x, y, z, varargin)
0012
0013
0014 obj@Interpolant(x, y, z);
0015
0016 [centers, radius] = PURBFInterpolant.circleCover2D(x, y, 10, 0.75, 10);
0017
0018 figure;
0019 plot(x, y, '.');
0020 for i = 1:size(centers, 1)
0021 plotCircle(centers(i, 1), centers(i, 2), radius(i));
0022 end
0023
0024 end
0025
0026 function z = interpolate(obj, x, y)
0027 z = [];
0028 end
0029 end
0030 methods (Static)
0031 function [centers, radius] = circleCover2D(x, y, m, overlap, minSamples)
0032
0033
0034
0035 if ~isvector(x) || ~isvector(y)
0036 error('x and y inputs must be vectors');
0037 end
0038 if numel(x) ~= numel(y)
0039 error('x and y inputs must have the same number of elements');
0040 end
0041
0042
0043 minX = min(x);
0044 minY = min(y);
0045 maxX = max(x);
0046 maxY = max(y);
0047
0048
0049
0050 delta = (maxX-minX)/m;
0051 [cx, cy] = meshgrid(minX+0.5*delta:delta:maxX+0.5*delta, minY-0.5*delta:delta:maxY+0.5*delta);
0052 centers = [cx(:), cy(:)];
0053 radius = overlap*delta*ones(numel(cx), 1);
0054
0055
0056
0057 end
0058 end
0059 end
0060