manpagez: man pages & more
info mathgl
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.4.10 Pipe sample

../png/pipe

C++ code

mglData a(20,30), b(20,30);
a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))");
gr->Light(true);
gr->Box();
gr->Pipe(a,b);

MGL code

new a 20 30
new b 20 30
modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
modify b '0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))'
light on
box
pipe a b

Pure C code

HMDT a = mgl_create_data_size(20,30,1);
HMDT b = mgl_create_data_size(20,30,1);
mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
mgl_set_light(gr,1);
mgl_box(gr,1);
mgl_pipe_2d(gr,a,b,0,0.05,5,1,0.);
mgl_delete_data(a); mgl_delete_data(b);

Fortran code

integer a,b, mgl_create_data_size
a = mgl_create_data_size(20,30,1);
b = mgl_create_data_size(20,30,1);
call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
call mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
call mgl_set_light(gr,1)
call mgl_box(gr,1)
call mgl_pipe_2d(gr,a,b,'',0.05,5,1,0.)
call mgl_delete_data(a)
call mgl_delete_data(b)

Python

a, b = mglData(20,30), mglData(20,30);
a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y)+0.4*cos(3*pi*(x*y))");
gr.Light(True);    gr.Box();
gr.Pipe(a,b);

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.