Rs <- ruars(20, rvmises, kappa = 0.01)
# Find the equal-weight projected mean
mean(Rs)
# Use the rotation misorientation angle as weight
wt <- abs(1 / mis.angle(Rs))
weighted.mean(Rs, wt)
rot.dist(mean(Rs))
# Usually much smaller than unweighted mean
rot.dist(weighted.mean(Rs, wt))
# Can do the same thing with quaternions
Qs <- as.Q4(Rs)
mean(Qs)
wt <- abs(1 / mis.angle(Qs))
weighted.mean(Qs, wt)
rot.dist(mean(Qs))
rot.dist(weighted.mean(Qs, wt))
Run the code above in your browser using DataLab