Skip to contents

Rotate vector object to position that eigenvectors are parallel to axes of coordinate system: E3||X (north-south), E2||X(east-west), E1||X(vertical)

Usage

center(x, max_vertical = FALSE)

Arguments

x

Object of class "Vec3", "Line" or "Plane"

max_vertical

Whether the maximum of the von Mises-Fisher distribution is already vertical or not.

Value

Object of class of x

Examples

set.seed(1)
mu <- Line(120, 50)
x <- rvmf(100, mu = mu, k = 20)
x_centered <- center(x)
plot(x, col = "grey")
# points(mu, col = "red")
points(x_centered, col = "black")
points(Line(c(0, 90, 180), c(0, 0, 90)), col = 2:4)
text(Line(c(0, 90, 180), c(0, 0, 90)), col = 2:4, labels = c("E3", "E2", "E1"), pos = 3)