[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
9.1.19 Tube sample
C++ code
mglData y(50,3); y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0); y.Modify("sin(2*pi*x)",1); y.Modify("cos(2*pi*x)",2); gr->Rotate(40,60); gr->Light(true); gr->Box(); gr->Tube(y,0.05);
MGL code
new y 50 3 modify y '0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)' modify y 'sin(2*pi*x)' 1 modify y 'cos(2*pi*x)' 2 rotate 40 60 light on box tube y 0.05
Pure C code
HMDT y = mgl_create_data_size(50,3,1); mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0); mgl_data_modify(y,"sin(2*pi*x)",1); mgl_data_modify(y,"cos(2*pi*x)",2); mgl_rotate(gr,40.,60.,0.); mgl_set_light(gr,1); mgl_box(gr,1); mgl_tube(gr,y,0.05,NULL); mgl_delete_data(y);
Fortran code
integer y, mgl_create_data_size y = mgl_create_data_size(50,3,1) call mgl_data_modify(y,'0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)',0) call mgl_data_modify(y,'sin(2*pi*x)',1) call mgl_data_modify(y,'cos(2*pi*x)',2) call mgl_rotate(gr,40.,60.,0.) call mgl_set_light(gr,1) call mgl_box(gr,1) call mgl_tube(gr,y,0.05,'') call mgl_delete_data(y)
Python
y = mglData(50,3); y.Modify("0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)",0); y.Modify("sin(2*pi*x)",1); y.Modify("cos(2*pi*x)",2); gr.Rotate(40,60); gr.Light(True); gr.Box(); gr.Tube(y,0.05);