fitCircle | R Documentation |
Utility function for fitting a circle into 2D point configurations.
fitCircle(x, y)
x |
Vector with x-coordinates |
y |
Vector with y-coordinates |
cx |
x-coordinate center |
cy |
y-coordinate center |
radius |
circle radius |
Pratt, V. (1987). Direct least-squares fitting of algebraic surfaces. Computer Graphics, Vol. 21, pages 145-152.
## Dataset on Schwartz values:
require(plotrix)
valsD <- 1 - cor(indvalues)
fit <- mds(valsD)
plot(fit, main = "MDS Value Circle")
circle <- fitCircle(fit$conf[,1], fit$conf[,2])
draw.circle(circle$cx, circle$cy, radius = circle$radius, border = "gray")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.