The arrow Object

The arrow object has a straight box-shaped shaft with an arrowhead at one end. The following statement will display an arrow pointing parallel to the x axis:

pointer = arrow(pos=(0,2,1), axis=(5,0,0), shaftwidth=1)

The arrow object has attributes pos, x, y, z, axis, length, color, red, green, blue, and up like those for cylinders. The up attribute is significant for arrow because the shaft and head have square cross sections, and setting the up attribute rotates the arrow about its axis. Additional arrow attributes:

shaftwidth By default, shaftwidth = 0.1*(length of arrow)

headwidth By default, headwidth = 2*shaftwidth

headlength By default, headlength = 3*shaftwidth

Assigning any of these attributes to 0 makes it use defaults based on the size of the arrow. If headlength becomes larger than half the length of the arrow, or the shaft becomes thinner than 1/50 the length, the entire arrow is scaled accordingly.

This default behavior makes the widths of very short arrows shrink, and the widths of very long arrows grow (while displaying the correct total length). If you prefer that shaftwidth and headwidth not change as the arrow gets very short or very long, set fixedwidth = 1. In this case the only adjustment that is made is that headlength is adjusted so that it never gets longer than half the total length, so that the total length of the arrow is correct. This means that very short, thick arrows look similar to a thumbtack, with a nearly flat head.