1// 2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 3// Copyright (C) INRIA 4// 5// This file is distributed under the same license as the Scilab package. 6// 7 8// ============================================================================= 9// bh() 10// ============================================================================= 11 12 13function bh(nn) 14 15 exec("SCI/modules/graphics/demos/surface/Macros.sci",-1); 16 17 // a black hole 18 19 x = linspace(0,2*%pi,nn); 20 t = linspace(0,1,20); 21 cosphi = dup(cos(x),length(t)); 22 sinphi = dup(sin(x),length(t)); 23 f = dup((t.*t+0.2)',length(x)); 24 25 my_handle = scf(100001); 26 clf(my_handle,"reset"); 27 my_axe = my_handle.children; 28 demo_viewCode("bh.sce"); 29 30 31 my_handle.immediate_drawing = "off"; 32 plot3d2(f.*cosphi,f.*sinphi,dup(t'.*2-1,length(x))); 33 my_plot = my_axe.children; 34 my_handle.color_map = jetcolormap(128); 35 my_plot.color_flag = 1; 36 my_axe.rotation_angles = [70,20]; 37 my_handle.immediate_drawing = "on"; 38 39endfunction 40 41bh(50); 42clear bh; 43