Shows what matrices \(A, b\) look like as the system of linear equations, \(A x = b\) with three unknowns, x1, x2, and x3, by plotting a plane for each equation.
plotEqn3d(
A,
b,
vars,
xlim = c(-2, 2),
ylim = c(-2, 2),
zlim,
col = 2:(nrow(A) + 1),
alpha = 0.9,
labels = FALSE,
solution = TRUE,
axes = TRUE,
lit = FALSE
)
nothing; used for the side effect of making a plot
either the matrix of coefficients of a system of linear equations, or the matrix cbind(A,b)
The A
matrix must have three columns.
if supplied, the vector of constants on the right hand side of the equations, of length matching
the number of rows of A
.
a numeric or character vector of names of the variables.
If supplied, the length must be equal to the number of unknowns in the equations.
The default is paste0("x", 1:ncol(A)
.
axis limits for the first variable
axis limits for the second variable
horizontal axis limits for the second variable; if missing, zlim
is calculated from the
range of the set of equations over the xlim
and ylim
scalar or vector of colors for the lines, recycled as necessary
transparency applied to each plane
logical, or a vector of character labels for the equations; not yet implemented.
logical; should the solution point for all equations be marked (if possible)
logical; whether to frame the plot with coordinate axes
logical, specifying if lighting calculation should take place on geometry; see rgl.material
Michael Friendly, John Fox
Fox, J. and Friendly, M. (2016). "Visualizing Simultaneous Linear Equations, Geometric Vectors, and Least-Squares Regression with the matlib Package for R". useR Conference, Stanford, CA, June 27 - June 30, 2016.
# three consistent equations in three unknowns
A <- matrix(c(13, -4, 2, -4, 11, -2, 2, -2, 8), 3,3)
b <- c(1,2,4)
plotEqn3d(A,b)
Run the code above in your browser using DataLab