Learn R Programming

arrowheadr (version 1.0.2)

unitizer: Fit matrix to unit circle

Description

Fit matrix to unit circle

Usage

unitizer(x, center = rep(0, ncol(x)))

Value

matrix

Arguments

x

matrix

center

center of matrix

Examples

Run this code
A = matrix(c(1, 2,
            -8,6,
             9,5),
            ncol = 2,
            byrow = TRUE)
unitizer(A)
cA <- unitizer(A, center = colMeans(A))
plot(cA, xlim = c(-1, 1), ylim = c(-1, 1))
t <- seq(0,2*pi, length.out = 361)
lines(cos(t), sin(t))

Run the code above in your browser using DataLab