rbmatlab 0.10.01
general/geometry/spline_select.m
00001 function [p_mu] = spline_select(model)
00002 %function [p_mu] = spline_select(model)
00003 %
00004 % This function is a wrapper for spline functions that are used for geometrical
00005 % transformations of the grid.
00006 
00007 if isequal(model.geometry_spline_type, 'cubic')
00008 
00009   x_hill  = model.geometry_transformation_spline_x;
00010   y_hill  = model.geometry_transformation_spline_y;
00011   if model.hill_height >= 0
00012     y_hill(2) = model.hill_height;
00013   end
00014 
00015   p_mu = spline(x_hill, y_hill);
00016 
00017 elseif isequal(model.geometry_spline_type, 'affine')
00018 
00019 %  x_hill  = model.geometry_transformation_spline_x;
00020   y_hill  = model.geometry_transformation_spline_y;
00021   if model.hill_height >= 0
00022     y_hill(2) = model.hill_height;
00023   end
00024 
00025 %  p_mu = mkpp(x_hill, [(y_hill(2)-y_hill(1))/(x_hill(2)-x_hill(1)),y_hill(1);
00026 %                       (y_hill(3)-y_hill(2))/(x_hill(3)-x_hill(2)),y_hill(2)]);
00027    p_mu = mkpp([0 1], [-y_hill(2) y_hill(2)]);
00028 %  plot(ppval(p_mu, linspace(0,1)));
00029 end
00030 
00031 %| \docupdate 
All Classes Namespaces Files Functions Variables