kill(all)$

maxima:vector field (2d:F:<,>,3d:F:<,,>),version 1.0
peter.vlasschaert@gmail.com,04/04/2020

load packages
===========

load(draw)$

see: topic ' vector calculus ' 
====================

ref :see: http://gkerns.people.ysu.edu/maxima/maximaintro/maximaintro.pdf

2d: vector fields : F:<,>
============

coord : setify(makelist(k,k,-2,2))$
points2d: listify(cartesian_product (coord ,coord ));
vf2d(x,y):=  vector ([x,y],[cos(y),x]/6);
vect2: makelist(vf2d(m[1],m[2]),m,points2d );
apply(draw2d , append ([ head_length =.1,color=blue,grid = true], vect2 ))$

why : setify , makes a set needed for a :cartesian_product .
conversion : list to set : setify
                  set to list  : listify

how to get :options copy to the clipboard ( Figure 1)
F:vector field :< cos(y),x>, 2d version  'draw2d'

function:vec2dfield  :F: <fx,fy>
-----------------------

fx:cos(m[2]);
fy:m[1];
sc:6.0;

coord : setify(makelist(k,k,-2,2))$
points2d: listify(cartesian_product (coord ,coord ));
vf2dl(x,y,fx,fy,sc):=  vector ([x,y],[fx,fy]/sc);
vect2: makelist(ev(vf2dl(m[1],m[2],fx,fy,sc),nouns),m,points2d );
apply(draw2d , append ([ head_length =.1,color=blue,grid = true], vect2 ))$

3d: vector fields : F:<,,>
============

coord : setify(makelist(k,k,-2,2))$
points3d: listify(cartesian_product (coord ,coord,coord ));
vf3d(x,y,z):=  vector ([x,y,z],[z,x,y]/6);
vect3: makelist(vf3d(m[1],m[2],m[3]),m,points3d );
apply(draw3d , append ([ head_length =.4,color=blue,grid=true], vect3 ))$

how to get :options copy to the clipboard ( Figure 2)
F:vector field :< z,x,y >  ,3d version  'draw3d'