Mercurial > repos > public > sbplib
annotate +grid/old/triang_map.m @ 99:ecf77a50d4fe feature/arclen-param
The arclength parameter function was slow because it called fzero. Now it is constructed once and for all with splines. Much better performance.
author | Martin Almquist <martin.almquist@it.uu.se> |
---|---|
date | Sun, 06 Dec 2015 15:41:42 +0100 |
parents | 48b6fb693025 |
children |
rev | line source |
---|---|
0 | 1 % Creates a grid [X,Y] from the mapping function S at points in vectors u,v |
2 function [X, Y] = traing_map(S,u,v) | |
3 error('not done') | |
4 if nargin == 2 | |
5 v = u; | |
6 end | |
7 | |
8 if isscalar(u) | |
9 u = linspace(0,1,u); | |
10 end | |
11 | |
12 if isscalar(v) | |
13 v = linspace(0,1,v); | |
14 end | |
15 | |
16 nu = length(u); | |
17 nv = length(v); | |
18 | |
19 X = zeros(nu,nv); | |
20 Y = zeros(nu,nv); | |
21 | |
22 for i = 1:nu | |
23 for j = 1:nv | |
24 [x,y] = S(u(i),v(j)); | |
25 X(i,j) = x; | |
26 Y(i,j) = y; | |
27 end | |
28 end | |
29 end |