kill(all)$

maxima  : plot with definitions of 3d vector field,version 1.0
peter.vlasschaert@gmail.com,04/04/2020

1e) x,y,z : variables
=============

fmx:z;
fmy:x;
fmz:y;

2e) conversion :
===========
x → m[1]
y →m[2]
z →m[3]

fx:ev(fmx,x=m[1],y=m[2],z=m[3]);
fy:ev(fmy,x=m[1],y=m[2],z=m[3]);
fz:ev(fmz,x=m[1],y=m[2],z=m[3]);
sc:6.0;

m[1], x variable
m[2],y variable
m[3],z variable

3e) definition of vector
==================

vf3dl(x,y,z,fx,fy,fz,sc):=  vector ([x,y,z],[fx,fy,fz]/sc);

grind(%);

4e) definition of vector (list of vectors)
============================

vect3dfield(x,y,z,fx,fy,fz,sc):=block([],    
coord : setify(makelist(k,k,-2,2)),
points3d: listify(cartesian_product (coord ,coord,coord )),
vect3: makelist(ev(vf3dl(m[1],m[2],m[3],fx,fy,fz,sc),nouns),m,points3d ))$

grind(%);

vect2dfield(x,y,fx,fy,sc);

5e) plot of vector list
===============

plotvect3f(x,y,z,fx,fy,fz):=block([],
    q:vect3dfield(x,y,z,fx,fy,fz,sc),
    apply(draw3d , append ([ head_length =.1,color=blue,grid = true], q ))
);

grind(%);

grind(plotvect3f(x,y,z,fx,fy,fz));

plotvect3f(x,y,z,fx,fy,fz)$