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

9.2.12 ContF sample

../png/contf

C++ code

mglData a(50,40);
a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
gr->Rotate(40,60);  gr->Light(true);
gr->Box();
gr->ContF(a);

MGL code

new a 50 40
modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))'
rotate 40 60
light on
box
contf a

Pure C code

HMDT a = mgl_create_data_size(50,40,1);
mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0);
mgl_rotate(gr,40.,60.,0.);
mgl_set_light(gr,1);
mgl_box(gr,1);
mgl_contf(gr,a,0,7,NAN);
mgl_delete_data(a);

Fortran code

integer a, mgl_create_data_size
real zero, nan
! I don't know the NaN symbol in Fortran. So I produce it as zero/zero
zero = 0; nan = zero/zero
a = mgl_create_data_size(50,40,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_rotate(gr,40.,60.,0.)
call mgl_set_light(gr,1)
call mgl_box(gr,1)
call mgl_contf(gr,a,'',7,nan)
call mgl_delete_data(a)

Python

a = mglData(50,40);
a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
gr.Rotate(40,60);   gr.Light(True);
gr.Box();
gr.ContF(a);

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