plots - Maple Programming Help

Home : Support : Online Help : Graphics : Packages : plots : plots/arrow

plots

 arrow
 plot an arrow or a vector

 Calling Sequence arrow(u, opts) arrow(u, v, opts) arrow(U, opts)

Parameters

 u, v - lists, Vectors, a set (or list) of lists, a set (or list) of Vectors U - set or list containing lists of pairs of Vectors or lists opts - (optional) equation(s) of the form option=value where option is one of shape, length, width, head_width, head_length, or plane; specify options for the arrow

Description

 • The arrow(u) calling sequence plots the arguments in u as arrows with their bases located at the origin.
 • The arrow(u, v) calling sequence plots at each base point in u arrows in the direction of each point in v.
 • The arrow(U) calling sequence plots each pair of points as an arrow with its base at the first point in the direction of the second point.
 • If the arguments have 2 elements, the result is a 2-D plot, whereas if the arguments have 3 elements, the result is a 3-D plot.
 • The properties of the arrow are described by using optional arguments. The opts argument can contain one or more of the following equations.
 shape =harpoon, arrow, double_arrow, or cylindrical_arrow
 This option specifies the appearance of the arrow.  The value harpoon indicates that the arrow is drawn as a line with a single line indicating the head. The value arrow indicates that the arrow is drawn as a line with two lines indicating the head. The value double_arrow indicates that the arrow is drawn as a rectangle and triangle. The value cylindrical_arrow indicates the arrow is drawn as a cylinder and cone.
 The default shape for 2- and 3-D arguments is double_arrow and cylindrical_arrow, respectively.
 Note: The value cylindrical_arrow is not valid if the plot is 2-D.
 length =len or [len, lenopts]
 The argument len is of type algebraic. The optional parameter lenopts is an equation of the form relative=truefalse that specifies whether the length of the arrow len is relative to the distance between the described endpoints, that is, the length of the arrow is the distance between the specified points multiplied by len, or is an absolute length, that is, the length of the arrow is len. The default value is false.
 If this option is not included, the arrow is plotted between the described endpoints.
 width =wid or [wid, widopts]
 The argument wid is of type algebraic. The optional parameter widopts is an equation of the form relative=truefalse that specifies whether the width wid is relative to the length of the arrow or to an absolute width.
 If this option is not included, the width is $\frac{1}{20}$ the length of the arrow.
 The argument hwid is of type algebraic. The optional parameter hwidopts is an equation of the form relative=truefalse that specifies whether the width of the head hwid is relative to the width of the arrow or to an absolute width.
 If this option is not included, the width of the head is twice the width of the arrow.
 The argument hlen is of type algebraic. The optional parameter hlenopts is an equation of the form relative=truefalse that specifies whether the length of the head hlen is relative to the length of the arrow or to an absolute length.
 If this option is not included, the length of the head is $\frac{1}{5}$ the length of the arrow.
 plane =list or Vector
 If this option is included, the resulting arrow lies in the plane containing the arrow itself and the cross product of the arrow and the plane vector.  If the plane vector and the arrow are collinear, this option is ignored. This option is relevant only for 3-D arrows with shape set to either double_arrow, harpoon, or arrow.
 difference =truefalse
 This option, if set to true with both arguments u and v, specifies that the base of the arrow is located at u and the tip of the arrow is located at v.
 The default value is false, in which case u is the location of the base of the arrow and u + v is the location of the tip of the arrow.
 fringe =truefalse, name, or function
 This option adds a "fringe" around the arrow head. It only works if shape = cylindrical_arrow.
 The default value is false. If only fringe is chosen, the default color is black. The prespecified colors for the fringes are black, white, red, green, and blue. They must be input in the form fringe = name. For example, fringe = red, produces a red fringe around the arrow head. Other colors can be specified by using the function COLOR(RGB, a, b, c) where a, b, and c are floats between 0.0 and 1.0 .

Examples

 > $\mathrm{with}\left(\mathrm{plots}\right):$

Plot a sequence of related arrows.

 > $\mathrm{arrow}\left(\left[\mathrm{seq}\left(⟨\mathrm{sin}\left(i\right),\mathrm{cos}\left(i\right)\mathrm{cos}\left(\frac{7i}{23}\right),\mathrm{sin}\left(\frac{7i}{23}\right)⟩,i=1..23\right)\right],\mathrm{axes}=\mathrm{frame}\right)$

Plot three points with various shapes.

 > $\mathrm{a1}≔\mathrm{arrow}\left(⟨0,0,1⟩,\mathrm{shape}=\mathrm{harpoon}\right):$
 > $\mathrm{a2}≔\mathrm{arrow}\left(⟨0,1,0⟩,\mathrm{shape}=\mathrm{arrow}\right):$
 > $\mathrm{a3}≔\mathrm{arrow}\left(⟨1,0,0⟩,\mathrm{shape}=\mathrm{double_arrow}\right):$
 > $\mathrm{a4}≔\mathrm{arrow}\left(⟨1,1,1⟩,\mathrm{shape}=\mathrm{cylindrical_arrow}\right):$
 > $\mathrm{display}\left(\mathrm{a1},\mathrm{a2},\mathrm{a3},\mathrm{a4},\mathrm{scaling}=\mathrm{constrained},\mathrm{axes}=\mathrm{frame}\right)$

Plot three points using various options.

 > $\mathrm{b1}≔\mathrm{arrow}\left(⟨1,2,3⟩,⟨3,-4,5⟩,\mathrm{width}=\left[0.2,\mathrm{relative}\right],\mathrm{head_length}=\left[0.4,\mathrm{relative}\right],\mathrm{color}=\mathrm{red}\right):$
 > $\mathrm{b2}≔\mathrm{arrow}\left(⟨1,2,3⟩,⟨3,-4,5⟩,\mathrm{difference},\mathrm{color}=\mathrm{blue}\right):$
 > $\mathrm{b3}≔\mathrm{arrow}\left(⟨1,2,3⟩,⟨-3,4,-5⟩,\mathrm{width}=0.2,\mathrm{head_length}=0.4,\mathrm{color}=\mathrm{green}\right):$
 > $\mathrm{display}\left(\mathrm{b1},\mathrm{b2},\mathrm{b3},\mathrm{scaling}=\mathrm{constrained},\mathrm{axes}=\mathrm{frame},\mathrm{lightmodel}=\mathrm{light3}\right)$
 > $\mathrm{c1}≔\mathrm{arrow}\left(⟨1,1,1⟩,\mathrm{shape}=\mathrm{cylindrical_arrow},\mathrm{fringe}\right):$
 > $\mathrm{c2}≔\mathrm{arrow}\left(⟨0,0,1⟩,\mathrm{shape}=\mathrm{cylindrical_arrow},\mathrm{fringe}='\mathrm{red}'\right):$
 > $\mathrm{c3}≔\mathrm{arrow}\left(⟨0,1,0⟩,\mathrm{shape}=\mathrm{cylindrical_arrow},\mathrm{fringe}='\mathrm{COLOR}\left(\mathrm{RGB},0.6,0.1,0.7\right)'\right):$
 > $\mathrm{display}\left(\mathrm{c1},\mathrm{c2},\mathrm{c3},\mathrm{scaling}=\mathrm{constrained},\mathrm{axes}=\mathrm{frame}\right)$

Plot a sequence of arrows of differing sizes.

 > $\mathrm{arrow}\left(\left\{\mathrm{seq}\left(⟨\mathrm{sin}\left(i\right),\mathrm{cos}\left(0.31i\right),\mathrm{sin}\left(1.033i\right)⟩,i=1..10\right)\right\},\mathrm{scaling}=\mathrm{constrained},\mathrm{axes}=\mathrm{frame}\right)$

Display the eigenvectors of a given 3x3 matrix.

 > $A≔⟨⟨-1,-3,-6⟩|⟨3,5,6⟩|⟨-3,2,-6⟩⟩:$
 > $\mathrm{vals},\mathrm{vects}≔\mathrm{LinearAlgebra}[\mathrm{Eigenvectors}]\left(A\right):$
 > $\mathrm{arrow}\left(\left\{\mathrm{seq}\left({\mathrm{vects}}_{1..-1,i},i=1..3\right)\right\},\mathrm{scaling}=\mathrm{constrained},\mathrm{axes}=\mathrm{frame}\right)$

Produce a directional plot for a given vector-valued function.

 > $\mathrm{arrow}\left(\left\{\mathrm{seq}\left(\mathrm{seq}\left(\left[\left[i,j\right],\left[{ⅇ}^{i}\mathrm{sin}\left(i\right),{ⅇ}^{j}\mathrm{cos}\left(j\right)\right]\right],i=-5..5\right),j=-5..5\right)\right\},\mathrm{length}=0.4,\mathrm{scaling}=\mathrm{constrained}\right)$

Display triads at a number of points.

 > $\mathrm{arrow}\left(\left\{\left[1,2,3\right],\left[-2,3,1\right],\left[2,-3,4\right],\left[4,0,-1\right]\right\},\left\{\left[0,0,1\right],\left[0,1,0\right],\left[1,0,0\right]\right\}\right)$