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

9.3.4 Dens3 sample

../png/densa

C++ code

mglData a(60,50,40);
a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
gr->Rotate(40,60);  gr->Alpha(true);    gr->Org = mglPoint(0,0,0);
gr->Box();
gr->DensA(a);
gr->Axis();

MGL code

new a 60 50 40
modify a '-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)'
rotate 40 60
alpha on
origin 0 0 0
box
densa a
axis

Pure C code

HMDT a = mgl_create_data_size(60,50,40);
mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
mgl_rotate(gr,40.,60.,0.);
mgl_set_alpha(gr,1);
mgl_set_origin(gr,0.,0.,0.);
mgl_box(gr,1);
mgl_dens3_all(gr,a,0);
mgl_axis(gr,"xyz");
mgl_delete_data(a);

Fortran code

integer a, mgl_create_data_size
a = mgl_create_data_size(60,50,40);
call mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0);
call mgl_rotate(gr,40.,60.,0.)
call mgl_set_alpha(gr,1)
call mgl_set_origin(gr,0.,0.,0.);
call mgl_box(gr,1)
call mgl_dens3_all(gr,a,'')
call mgl_axis(gr,"xyz")
call mgl_delete_data(a)

Python

a = mglData(60,50,40);
a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)");
gr.Rotate(40,60);       gr.Alpha(True);
gr.SetOrigin(0,0,0);    gr.Box();
gr.Axis();
gr.DensA(a);

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