1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2 // Copyright (C) 2011 - INRIA - Serge Steer <serge.steer@inria.fr>
4 // This file must be used under the terms of the CeCILL.
5 // This source file is licensed as described in the file COPYING, which
6 // you should have received as part of this distribution. The terms
7 // are also available at;
8 // http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
12 my_handle = scf(100001);
13 clf(my_handle,"reset");
16 title(_("datatips on 3D curves"),"fontsize",3);
21 t=linspace(-40,40,1000);
22 x=r*cos(t)./cosh(k*t);
23 y=r*sin(t)./cosh(k*t);
25 param3d(x,y,z);c=gce();c.thickness=2;C.foreground=color("blue")
27 ax=gca();ax.rotation_angles=[70 50];ax.axes_visible="off";
30 datatipInitStruct(c,"t",t)
31 datatipSetStyle(c,2,%f) //directional arrow no box
33 function s=mydisp(curve,pt,index),
34 ud=datatipGetStruct(curve);
38 [d,ptp,i,c]=orthProj(curve.data,pt);
39 t=ud.t(i)+(ud.t(i+1)-ud.t(i))*c;
41 s=msprintf("%.2g", t);
44 for k=[350 400 450 500 520 550 600]
45 dt=datatipCreate(c,k);
47 //datatipSetDisplay(c,mydisp) // Change the default datatip label
49 demo_viewCode("datatip2.sce");