| linesTorus3d | R Documentation | 
Joins the corresponding points with line segments or arrows that
exhibit wrapping in [-\pi,\pi) in the horizontal and vertical axes.
linesTorus3d(x, y, z, col = 1, arrows = FALSE, ...)
| x,y | vectors with horizontal coordinates, wrapped in  | 
| z | vector with vertical coordinates, wrapped in  | 
| col | color vector of length  | 
| arrows | flag for drawing arrows instead of line segments. | 
| ... | further graphical parameters passed to
 | 
x, y, and z are wrapped to [-\pi,\pi)
before plotting. arrows = TRUE makes sequential calls to
arrow3d, and is substantially slower than
arrows = FALSE.
Nothing. The functions are called for drawing wrapped lines.
if (requireNamespace("rgl")) {
  n <- 20
  x <- toPiInt(rnorm(n, mean = seq(-pi, pi, l = n), sd = 0.5))
  y <- toPiInt(rnorm(n, mean = seq(-pi, pi, l = n), sd = 0.5))
  z <- toPiInt(x + y + rnorm(n, mean = seq(-pi, pi, l = n), sd = 0.5))
  rgl::plot3d(x, y, z, xlim = c(-pi, pi), ylim = c(-pi, pi),
              zlim = c(-pi, pi), col = rainbow(n), size = 2,
              box = FALSE, axes = FALSE)
  linesTorus3d(x = x, y = y, z = z, col = rainbow(n), lwd = 2)
  torusAxis3d()
  rgl::plot3d(x, y, z, xlim = c(-pi, pi), ylim = c(-pi, pi),
              zlim = c(-pi, pi), col = rainbow(n), size = 2,
              box = FALSE, axes = FALSE)
  linesTorus3d(x = x, y = y, z = z, col = rainbow(n), ltyCross = 2,
               arrows = TRUE, theta = 0.1 * pi / 180, barblen = 0.1)
  torusAxis3d()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.