# Wolfram Function Repository

Instant-use add-on functions for the Wolfram Language

Function Repository Resource:

Plot a list of vectors in space

Contributed by:
Dennis M Schneider

ResourceFunction["PlotVector3D"][{{ plots the vectors { | |

ResourceFunction["PlotVector3D"][{{ plots the vectors { | |

ResourceFunction["PlotVector3D"][{{{ plots the vectors { | |

ResourceFunction["PlotVector3D"][{{ plots the vectors { |

The following options are supported:

"ArrowSize" | Large | specifies the size of the arrowhead |

"LocatedVector" | False | whether to draw vectors from the initial point (the first point of the list) |

VectorStyle | RGBColor[.3,.4,.7] | specifes the style of the vector |

A located vector is one whose initial point is the first point in the list, and whose terminal point is the second point in the list. ResourceFunction["PlotVector3D"][{{{*x*,*y*,*z*},{*p*,*q*,*r*}}}] uses {*p*,*q*,*r*} as the initial point and moves off in the direction given by {*x*,*y*,*z*}. Thus the terminal point is {*p*+*x*,*q*+*y*,*r*+*z*}.

Plot the vector (1,1,1) located at the origin:

In[1]:= |

Out[1]= |

Plot a list of vectors located at the origin:

In[2]:= |

Out[2]= |

Plot the vector (2,2,2) located at the point {-1,1,1}:

In[3]:= |

Out[3]= |

Plot a list of vectors located at the point {1,2,2}:

In[4]:= |

Out[4]= |

Plot a list of vectors located at different points. The first list is a list of vectors and the second is a list of initial points:

In[5]:= |

Out[5]= |

The length of the list of vectors must be the same as the length of the list of initial points:

In[6]:= |

Change the arrow size of each vector:

In[7]:= |

Out[7]= |

A located vector from the first point to the second point:

In[8]:= |

Out[8]= |

Setting "LocatedVector" to False draws the vector located at the origin:

In[9]:= |

Out[9]= |

A list of lists of pairs of vectors with the option "LocatedVector"→True draws located vectors from the first point in each sublist to the second point in each sublist:

In[10]:= |

Out[10]= |

Without the option being set, the second tuple in each list gives the located point, and the first tuple gives the direction:

In[11]:= |

Out[11]= |

Change the style of the vectors:

In[12]:= |

Out[12]= |

Set both the arrow size and style for each vector:

In[13]:= |

Out[13]= |

You can specify a vector located at a point using the second, third and fourth templates:

In[14]:= |

Out[14]= |

Use Arrow to produce any of these plots:

In[15]:= |

Out[15]= |

- 1.0.0 – 24 September 2019

This work is licensed under a Creative Commons Attribution 4.0 International License