
Last chance! 50% off unlimited learning
Sale ends in
Rotation matrix to project a set of 3D points to z-plane
rot2Zplane(vec, p)
3D normal vector
translation from this point
Matrix for projection
provides a matrix to rotate and translate a set of points to the X-Y plane. Used for internal calculations
gmat
# NOT RUN {
P1=runif(3)
P2=runif(3)
P3=runif(3)
PP = rbind(P1, P2, P3, rep(1, 3) )
g1 = PP[1, 1:3] - PP[3, 1:3]
g2 = PP[2, 1:3] - PP[3, 1:3]
B = unlist(AXB.prod(list(x = g1[1], y = g1[2], z = g1[3]),
list(x = g2[1], y = g2[2], z = g2[3])))
B = B/sqrt(sum(B * B))
MF = rot2Zplane(B, P3)
UMAT = t(PP)
# }
# NOT RUN {
<!-- %*% MF -->
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab