[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
9.3.7 Cont projection sample
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->Box(); gr->ContX(a.Sum("x"),"",-1); gr->ContY(a.Sum("y"),"",1); gr->ContZ(a.Sum("z"),"",-1);
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 box sum s a 'x' contx s '' -1 sum s a 'y' conty s '' 1 sum s a 'z' contz s '' -1
Pure C code
HMDT a = mgl_create_data_size(60,50,40), s; 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_box(gr,1); s=mgl_data_sum(a,"x"); mgl_cont_x(gr,s,0,-1.,7); mgl_delete_data(s); s=mgl_data_sum(a,"y"); mgl_cont_y(gr,s,0,1.,7); mgl_delete_data(s); s=mgl_data_sum(a,"z"); mgl_cont_z(gr,s,0,-1.,7); mgl_delete_data(s); mgl_delete_data(a);
Fortran code
integer a,s, mgl_create_data_size, mgl_data_sum 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_box(gr,1) s=mgl_data_sum(a,'x') call mgl_cont_x(gr,s,'',-1.,7) call mgl_delete_data(s) s=mgl_data_sum(a,'y') call mgl_cont_y(gr,s,'',1.,7) call mgl_delete_data(s) s=mgl_data_sum(a,'z') call mgl_cont_z(gr,s,'',-1.,7) call mgl_delete_data(s) 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.Box(); gr.ContX(a.Sum("x"),"",-1); gr.ContY(a.Sum("y"),"",1); gr.ContZ(a.Sum("z"),"",-1);