View source: R/interpolatePixels.R
interpolatePixels | R Documentation |
Connects two points in a matrix, array, or an image.
interpolatePixels(row1, col1, row2, col2)
row1 |
row index for the first point |
col1 |
column index for the first point |
row2 |
row index for the second point |
col2 |
column index for the second point |
Matrix containing the coordinates to connect the two input points.
# Simulate two points in a matrix
test <- matrix(0, 4, 4)
test[1, 1] <- 1
test[3, 4] <- 1
as.cimg(test) |> plot()
# Connect them with each other
link <- interpolatePixels(1, 1, 3, 4)
test[link] <- 1
as.cimg(test) |> plot()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.