11.148 Sample ‘vect3

Function vect3 draw ordinary vector field plot but at slices of 3D data.

MGL code:

call 'prepare3v'
subplot 2 1 0:title 'Vect3 sample':rotate 50 60
origin 0 0 0:box:axis '_xyz'
vect3 ex ey ez 'x':vect3 ex ey ez:vect3 ex ey ez 'z'
subplot 2 1 1:title '"f" style':rotate 50 60
origin 0 0 0:box:axis '_xyz'
vect3 ex ey ez 'fx':vect3 ex ey ez 'f':vect3 ex ey ez 'fz'
grid3 ex 'Wx':grid3 ex 'W':grid3 ex 'Wz'

C++ code:

void smgl_vect3(mglGraph *gr)
{
	mglData ex,ey,ez;	mgls_prepare3v(&ex,&ey,&ez);
	if(big!=3)	{	gr->SubPlot(2,1,0);	gr->Title("Vect3 sample");	}
	gr->Rotate(50,60);	gr->SetOrigin(0,0,0);	gr->Axis("_xyz");	gr->Box();
	gr->Vect3(ex,ey,ez,"x");	gr->Vect3(ex,ey,ez);	gr->Vect3(ex,ey,ez,"z");
	if(big==3)	return;
	gr->SubPlot(2,1,1);	gr->Title("'f' style");
	gr->Rotate(50,60);	gr->SetOrigin(0,0,0);	gr->Axis("_xyz");	gr->Box();
	gr->Vect3(ex,ey,ez,"fx");	gr->Vect3(ex,ey,ez,"f");	gr->Vect3(ex,ey,ez,"fz");
	gr->Grid3(ex,"Wx");	gr->Grid3(ex,"W");	gr->Grid3(ex,"Wz");
}

Sample vect3