Description Usage Arguments Author(s) See Also Examples
Plots one or two 2-dimensional vectors along with their vector sum.
1 2 3 |
x1 |
Value on the x-axis of the first vector. |
y1 |
Value on the y-axis of the first vector. |
x2 |
Value on the x-axis of the second vector. |
y2 |
Value on the y-axis of the second vector. |
add.vectors |
Logical; if |
col |
A vector of size four, specifying the colors of the first vector, the second vector,
the vector sum, and parallel lines, respectively. Type |
lwd |
The line width of the vectors. |
font |
An integer specifying which font to use for text. |
font.lab |
The font to be used for |
las |
Numeric in (0,1,2,3); the style of axis labels. |
cex.lab |
The magnification to be used for |
cex.axis |
The magnification to be used for axis annotation. |
usr |
A vector of the form |
... |
Optional arguments to be passed to the |
Steven T. Garren, James Madison University, Harrisonburg, Virginia, USA
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | par( mfrow=c(2,2) )
# Vectors (2,8) and (4,-3) and their vector sum.
plotVector( 2, 8, 4, -3 )
# Colinear vectors (-3,6) and (-1,2).
plotVector( -3, 6, -1, 2, add=FALSE, col=c("red","black") )
# Colinear vectors (-1,2) and (3,-6).
plotVector( -1, 2, 3, -6, add=FALSE )
# Vectors (2,3) and (5,-4)
plotVector( 2, 3, 5, -4, add=FALSE, usr=c( -5, 5, -4, 7) )
par( mfrow=c(1,1) )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.