【发布时间】:2020-04-03 22:25:39
【问题描述】:
我无法理解rgl::plane3d 的参数需要绘制一个由两个向量(x0、x1)跨越的平面,通过给定点( O=原点)。这是一个解释投影的图表。
rgl 文档没有提供足够的示例让我理解要指定的内容。
这是我的 MWE:
library(matlib)
library(rgl)
rgl::open3d()
O <- c(0, 0, 0)
x0 <- c(1, 1, 1)
x1 <- c(0, 1, 1)
y <- c(1, 1, 3)
XX <- rbind(x0=x0, x1=x1)
matlib::vectors3d(XX, lwd=2)
matlib::vectors3d(y, labels=c("", "y"), color="red", lwd=3)
# how to specify the plane spanned by x0, x1 ???
# planes3d(..., col="gray", alpha=0.2)
# draw projection of y on plane of XX
py <- matlib::Proj(y, t(XX))
rgl::segments3d(rbind( y, py))
rgl::segments3d(rbind( O, py))
【问题讨论】:
标签: r projection rgl plane