1% Copyright (C) 2010  VZLU Prague, a.s., Czech Republic
2%
3% Author: Jaroslav Hajek <highegg@gmail.com>
4%
5% This file is part of NLWing2.
6%
7% NLWing2 is free software; you can redistribute it and/or modify
8% it under the terms of the GNU General Public License as published by
9% the Free Software Foundation; either version 3 of the License, or
10% (at your option) any later version.
11%
12% This program is distributed in the hope that it will be useful,
13% but WITHOUT ANY WARRANTY; without even the implied warranty of
14% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15% GNU General Public License for more details.
16%
17% You should have received a copy of the GNU General Public License
18% along with this software; see the file COPYING.  If not, see
19% <http://www.gnu.org/licenses/>.
20%
21
22% -*- texinfo -*-
23% @deftypefn{Loadable Function} {clq1 =} clqinterp (clq, alfa1)
24% Interpolates the clq structure on a different sequence of angles of attack
25% (in degrees). Uses linear interpolation.
26% @end deftypefn
27
28function clq1 = clqinterp (clq, alfa1)
29
30  if (nargin != 2 || ! isstruct (clq) || ! ismatrix (alfa1))
31    print_usage ();
32  endif
33
34  alfa = clq.alfa;
35  transform = @(q) interp1 (alfa.', q.', alfa1.', "extrap").';
36  clq1 = structfun (transform, clq, "uniformoutput", false);
37  clq1.alfa = alfa1;
38  clq1.al = alfa1 * (pi/180);
39
40  % interpolating zsep makes little sense, so let's remove it.
41  clq1 = rmfield (clq1, "zsep");
42
43endfunction
44
45
46