Learn R Programming

smacof (version 2.1-7)

fitCircle: Fitting circle into point configuration

Description

Utility function for fitting a circle into 2D point configurations.

Usage

fitCircle(x, y)

Value

cx

x-coordinate center

cy

y-coordinate center

radius

circle radius

Arguments

x

Vector with x-coordinates

y

Vector with y-coordinates

References

Pratt, V. (1987). Direct least-squares fitting of algebraic surfaces. Computer Graphics, Vol. 21, pages 145-152.

Examples

Run this code
## 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") 

Run the code above in your browser using DataLab