Contents Previous Next Subchapters

Plotting Vectors
Syntax garrow(arrow)
See Also contour , mesh and surface

Description
Plots a sequence of arrows in the current viewport , where arrow is an integer, real, or double-precision matrix. Each row of arrow corresponds to an arrow in the plot. The first element of a row specifies the x coordinate of the starting point of the arrow, the second element specifies the y coordinate of the starting point, the third element specifies the angle of the arrow in radians, and the fourth element specifies the length of the arrow. Both the angle and length are in (x,y) coordinates; that is, an angle of pi/4 and a length of sqrt(2) correspond to an x difference of 1 and a y difference of 1. The angle on the screen depends on the window size and graphing limits.

Each arrow is plotted using as a separate call to gplot , and thus the colors progress through the color sequence which can be modified using the gcolor function.

Example
     x      = {1., 2.}
     y      = {1., 2.}
     angle  = {pi/6., pi/3}
     length = {.2, .2}
     arrow  = [x, y, angle, length]
     garrow(arrow) 
     
returns the following plot