and the forum entry on how to apply it to 3 dimensions. My question is can this method be used to plot the field over a predefined point set rather than the automatically generated rectangular grid defined by a and b in the example. For example if I wished to plot the field at point on a circle that I define. Essentially, define an array
triple [] xyz;
and plot the vector field at the points defined by xyz?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It would help to include a usage example. Ideally one would would like analogues to the vectorfield routine in graph3.asy, with similar function signatures.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am plotting the magnetic field produced by a three phase power cable. I found this in the Asymptote examples -
**import graph;
size(100);
pair a=(0,0);
pair b=(2pi,2pi);
path vector(pair z) {return (0,0)--(sin(z.x),cos(z.y));}
add(vectorfield(vector,a,b));**
and the forum entry on how to apply it to 3 dimensions. My question is can this method be used to plot the field over a predefined point set rather than the automatically generated rectangular grid defined by a and b in the example. For example if I wished to plot the field at point on a circle that I define. Essentially, define an array
triple [] xyz;
and plot the vector field at the points defined by xyz?
I wrote routines to do what I wanted after looking at the arguments to "vectorfield." The routines are attached
It would help to include a usage example. Ideally one would would like analogues to the vectorfield routine in graph3.asy, with similar function signatures.
As you suggested I am coding some examples. I want to generalize my code to 3d but getting an error from the statement -
void vectorfield3d(triple [] xyz,triple f(triple xyz),real scale=0.0, arrowbar arrow = Arrow3)
The error is -
VectorField.asy: 51.88: cannot cast expression to 'bool(picture, path, pen, marginT(path, pen))'
I think I am using the wrong data type for Arrow3 but I can't find the datatype for Arrow3 in the documentation. Is that my problem?
As you suggested I am coding some examples. I want to generalize my code to 3d but getting an error from the statement -
void vectorfield3d(triple [] xyz,triple f(triple xyz),real scale=0.0, arrowbar arrow = Arrow3)
The error is -
VectorField.asy: 51.88: cannot cast expression to 'bool(picture, path, pen, marginT(path, pen))'
I think I am using the wrong data type for Arrow3 but I can't find the datatype for Arrow3 in the documentation. Is that my problem?
Disregard previous post. I found arrowbar3!