p2p.multiLine: Multip-plane intersection lines

View source: R/geom_p2pIntersect.R

p2p.multiLineR Documentation

Multip-plane intersection lines

Description

Compute lines of intersection between multiple planes, one pair at a time. This uses the p2p.line function on all combinations of input planes.

Usage

p2p.multiLine(c.m)

Arguments

c.m

Matrix of coefficients for the plane equations, one per row.

Value

A dataframe containing the line equation coefficients (vector form, one per row) as well as the IDs of the planes whose intersection a given line represents.

TODO

Write unit tests.

Author(s)

Cornel M. Pop

Examples

# A multiline intersection case
c.m = rbind(c(1, -3, 2, 7), c(4, 1, -1, 5), c(6, -5, 3, -1))
res = Lithics3D:::p2p.multiLine(c.m)
## Not run: 
p1 = res[,1:3] # First point defining the intersection lines
p2 = res[,1:3] - res[,4:6]*0.1 # Second point defining the intersection line
library(rgl)
points3d(rbind(c(-10,-10,-10), c(10,10,10)))
lines3d(rbind(p1[1,], p2[1,]), lwd=5, col="red") # Draw the 1st intersection
lines3d(rbind(p1[2,], p2[2,]), lwd=5, col="blue") # Draw the 2nd intersection
lines3d(rbind(p1[3,], p2[3,]), lwd=5, col="yellow") # Draw the 3rd intersection
planes3d(c.m[,1], c.m[,2], c.m[,3], c.m[,4], col="green") # Render the intersecting planes

## End(Not run)

cornelmpop/Lithics3D documentation built on Feb. 10, 2024, 11:54 p.m.