2D vector field plot
champ(x,y,fx,fy,[arfact,rect,strf])
champ(x,y,fx,fy,<opt_args>)
:x,y two vectors which define the grid. : :fx a matrix which describes the x component of the vector field.
fx(i,j) is the x component of the vector field at point (x(i),y(j)).
:
champ draws a 2D vector field. The length of the arrows is proportional to the intensity of the field.
If you want colored arrows with the color of the arrows depending on the intensity of the field, use champ1.
Enter the command champ() to see a demo.
// using rect as plot boundaries
champ(-5:5,-5:5,`rand`_(11,11),`rand`_(11,11),rect=[-10,-10,10,10],arfact=2)
// using (x,y) to get boundaries
`clf`_()
champ(-5:5,-5:5,`rand`_(11,11),`rand`_(11,11),2,[-10,-10,10,10],"021")