Mercurial > repos > public > sbplib
annotate +draw/prompt_point.m @ 86:3c39dd714fb6
In Curve: Added numerical FD differentiation if derivative is not supplied. Added arc length computation based on the derivative. Added arc length parameterization (but this function is very slow.). In +util: Added fzero_vec.m and integral_vec.m, which call fzero and integral but take vector arguments.
author | Martin Almquist <martin.almquist@it.uu.se> |
---|---|
date | Sun, 29 Nov 2015 14:28:53 +0100 |
parents | 48b6fb693025 |
children | 00eb5db89da5 |
rev | line source |
---|---|
0 | 1 function [p, button] = prompt_point(s,varargin) |
2 default_arg('s',[]) | |
3 | |
4 set(gcf,'Pointer','crosshair') | |
5 | |
6 if ~isempty(s) | |
7 fprintf(s,varargin{:}); | |
8 end | |
9 | |
10 a = gca; | |
11 | |
12 function get_point(src,event) | |
13 cp = a.CurrentPoint; | |
14 p = cp(1,1:2)'; | |
15 a.ButtonDownFcn = []; | |
16 end | |
17 | |
18 a.ButtonDownFcn = @get_point; | |
19 waitfor(a,'ButtonDownFcn', []) | |
20 | |
21 set(gcf,'Pointer','arrow') | |
22 | |
23 end |