Rotate to Z-plane

Share:

Description

Rotation matrix to project a set of 3D points to z-plane

Usage

1
rot2Zplane(vec, p)

Arguments

vec

3D normal vector

p

translation from this point

Details

provides a matrix to rotate and translate a set of points to the X-Y plane. Used for internal calculations

Value

Matrix for projection

Author(s)

Jonathan M. Lees<jonathan.lees@unc.edu>

See Also

gmat

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
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) 

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.