Mercurial > repos > public > sbplib
annotate +draw/prompt_bezier.m @ 1037:2d7ba44340d0 feature/burgers1d
Pass scheme specific parameters as cell array. This will enabale constructDiffOps to be more general. In addition, allow for schemes returning function handles as diffOps, which is currently how non-linear schemes such as Burgers1d are implemented.
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Fri, 18 Jan 2019 09:02:02 +0100 |
parents | 875386d0b2ff |
children |
rev | line source |
---|---|
0 | 1 function [C,h] = prompt_bezier(s,varargin) |
2 default_arg('s',[]) | |
3 if ~isempty(s) | |
4 fprintf(s,varargin{:}); | |
5 end | |
6 | |
7 fprintf('# Draw bezier curve\n') | |
8 a = draw.prompt_point('Enter starting point\n'); | |
9 p = draw.point(a); | |
10 p.Color = Color.green; | |
11 p.MarkerSize = 24; | |
12 b = draw.prompt_point('Enter stopping point\n'); | |
13 p = draw.point(b); | |
14 p.Color = Color.red; | |
15 p.MarkerSize = 24; | |
16 c1 = draw.prompt_point('Enter control point 1\n'); | |
17 p = draw.point(c1); | |
18 p.Color = Color.yellow; | |
19 p.MarkerSize = 16; | |
20 c2 = draw.prompt_point('Enter control point 2\n'); | |
21 p = draw.point(c2); | |
22 p.Color = Color.yellow; | |
23 p.MarkerSize = 16; | |
24 | |
332
875386d0b2ff
Fixed a bug in draw and added a helper function to parametrization.Ti.
Jonatan Werpers <jonatan@werpers.com>
parents:
0
diff
changeset
|
25 C = parametrization.Curve.bezier(a,c1,c2,b); |
875386d0b2ff
Fixed a bug in draw and added a helper function to parametrization.Ti.
Jonatan Werpers <jonatan@werpers.com>
parents:
0
diff
changeset
|
26 fprintf('C = parametrization.Curve.bezier([%.3g; %.3g],[%.3g; %.3g],[%.3g; %.3g],[%.3g; %.3g]);\n',a,c1,c2,b) |
0 | 27 h = C.plot(); |
28 uistack(h,'bottom'); | |
29 | |
30 end |